@micromag/screen-map 0.3.103 → 0.3.107

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.
Files changed (3) hide show
  1. package/es/index.js +138 -58
  2. package/lib/index.js +138 -58
  3. package/package.json +17 -17
package/es/index.js CHANGED
@@ -140,8 +140,9 @@ function MapScreen(_ref) {
140
140
  var transitionPlaying = current && ready;
141
141
  var transitionDisabled = isStatic || isCapture || isPlaceholder || isPreview || isEdit;
142
142
  var scrollingDisabled = !isEdit && transitionDisabled || !current;
143
- var backgroundPlaying = current && (isView || isEdit);
144
- var backgroundShouldLoad = current || active || !isView;
143
+ var backgroundPlaying = current && (isView || isEdit); // const backgroundShouldLoad = current || active;
144
+
145
+ var backgroundShouldLoad = current || active;
145
146
 
146
147
  var _useState5 = useState(isStatic || isCapture),
147
148
  _useState6 = _slicedToArray(_useState5, 2),
@@ -293,7 +294,7 @@ function MapScreen(_ref) {
293
294
  } else if (stateId === 'map') {
294
295
  setOpened(true);
295
296
  setSelectedMarkerIndex(null);
296
- } else if (stateId === 'markers') {
297
+ } else if (stateId === 'markers' || stateId === 'markers-with-image') {
297
298
  setOpened(true);
298
299
  setSelectedMarkerIndex(parseInt(markerIndex, 10));
299
300
  }
@@ -782,75 +783,154 @@ var definition = [{
782
783
  component: MapImagesScreen,
783
784
  layouts: ['normal'],
784
785
  transforms: transforms,
785
- fields: [{
786
- name: 'title',
787
- type: 'heading-element',
788
- theme: {
789
- textStyle: 'heading1'
790
- },
791
- label: defineMessage({
792
- id: "+AEVbJ",
793
- defaultMessage: [{
794
- "type": 0,
795
- "value": "Title"
796
- }]
797
- })
798
- }, {
799
- name: 'description',
800
- type: 'text-element',
801
- theme: {
802
- textStyle: 'text'
803
- },
804
- label: defineMessage({
805
- id: "ZCe0r4",
806
- defaultMessage: [{
807
- "type": 0,
808
- "value": "Description"
809
- }]
810
- })
811
- }, {
812
- name: 'button',
813
- type: 'button-element',
814
- theme: {
815
- textStyle: 'button'
816
- },
786
+ states: [{
787
+ id: 'intro',
817
788
  label: defineMessage({
818
- id: "i6bmbD",
789
+ id: "BgrRxZ",
819
790
  defaultMessage: [{
820
791
  "type": 0,
821
- "value": "Button"
792
+ "value": "Intro"
822
793
  }]
823
- })
794
+ }),
795
+ fields: [{
796
+ name: 'title',
797
+ type: 'heading-element',
798
+ theme: {
799
+ textStyle: 'heading1'
800
+ },
801
+ label: defineMessage({
802
+ id: "+AEVbJ",
803
+ defaultMessage: [{
804
+ "type": 0,
805
+ "value": "Title"
806
+ }]
807
+ })
808
+ }, {
809
+ name: 'description',
810
+ type: 'text-element',
811
+ theme: {
812
+ textStyle: 'text'
813
+ },
814
+ label: defineMessage({
815
+ id: "ZCe0r4",
816
+ defaultMessage: [{
817
+ "type": 0,
818
+ "value": "Description"
819
+ }]
820
+ })
821
+ }, {
822
+ name: 'button',
823
+ type: 'button-element',
824
+ theme: {
825
+ textStyle: 'button'
826
+ },
827
+ label: defineMessage({
828
+ id: "i6bmbD",
829
+ defaultMessage: [{
830
+ "type": 0,
831
+ "value": "Button"
832
+ }]
833
+ })
834
+ }]
824
835
  }, {
825
- name: 'draggable',
826
- type: 'toggle',
827
- defaultValue: true,
836
+ id: 'map',
828
837
  label: defineMessage({
829
- id: "A7ncT3",
838
+ id: "eYHEYe",
830
839
  defaultMessage: [{
831
840
  "type": 0,
832
- "value": "Draggable"
841
+ "value": "Map"
833
842
  }]
834
- })
843
+ }),
844
+ fields: [{
845
+ name: 'draggable',
846
+ type: 'toggle',
847
+ defaultValue: true,
848
+ label: defineMessage({
849
+ id: "A7ncT3",
850
+ defaultMessage: [{
851
+ "type": 0,
852
+ "value": "Draggable"
853
+ }]
854
+ })
855
+ }, {
856
+ name: 'fitBounds',
857
+ type: 'toggle',
858
+ defaultValue: true,
859
+ label: defineMessage({
860
+ id: "NVUpOG",
861
+ defaultMessage: [{
862
+ "type": 0,
863
+ "value": "Map fit markers"
864
+ }]
865
+ })
866
+ }, {
867
+ name: 'zoom',
868
+ type: 'slider',
869
+ defaultValue: 9,
870
+ min: 0,
871
+ max: 16,
872
+ label: defineMessage({
873
+ id: "vRzzo6",
874
+ defaultMessage: [{
875
+ "type": 0,
876
+ "value": "Zoom"
877
+ }]
878
+ })
879
+ }, {
880
+ name: 'center',
881
+ type: 'geo-position',
882
+ label: defineMessage({
883
+ id: "W5qWPj",
884
+ defaultMessage: [{
885
+ "type": 0,
886
+ "value": "Center"
887
+ }]
888
+ })
889
+ }]
835
890
  }, {
836
- name: 'markers',
837
- type: 'markers-with-image',
838
- theme: {
839
- title: {
840
- textStyle: 'heading3'
841
- },
842
- description: {
843
- textStyle: 'text'
844
- }
845
- },
891
+ id: 'markers-with-image',
846
892
  label: defineMessage({
847
- id: "CW3KAC",
893
+ id: "+LvOvJ",
848
894
  defaultMessage: [{
849
895
  "type": 0,
850
- "value": "Markers with image"
896
+ "value": "Markers"
851
897
  }]
852
- })
853
- }, {
898
+ }),
899
+ repeatable: true,
900
+ fieldName: 'markers',
901
+ fields: [{
902
+ name: 'title',
903
+ type: 'heading-element',
904
+ label: defineMessage({
905
+ id: "+AEVbJ",
906
+ defaultMessage: [{
907
+ "type": 0,
908
+ "value": "Title"
909
+ }]
910
+ })
911
+ }, {
912
+ name: 'description',
913
+ type: 'text-element',
914
+ label: defineMessage({
915
+ id: "ZCe0r4",
916
+ defaultMessage: [{
917
+ "type": 0,
918
+ "value": "Description"
919
+ }]
920
+ })
921
+ }, {
922
+ name: 'geoPosition',
923
+ type: 'geo-position',
924
+ label: defineMessage({
925
+ id: "u3ok54",
926
+ defaultMessage: [{
927
+ "type": 0,
928
+ "value": "Position"
929
+ }]
930
+ })
931
+ }]
932
+ }],
933
+ fields: [{
854
934
  name: 'background',
855
935
  type: 'background',
856
936
  label: defineMessage({
package/lib/index.js CHANGED
@@ -162,8 +162,9 @@ function MapScreen(_ref) {
162
162
  var transitionPlaying = current && ready;
163
163
  var transitionDisabled = isStatic || isCapture || isPlaceholder || isPreview || isEdit;
164
164
  var scrollingDisabled = !isEdit && transitionDisabled || !current;
165
- var backgroundPlaying = current && (isView || isEdit);
166
- var backgroundShouldLoad = current || active || !isView;
165
+ var backgroundPlaying = current && (isView || isEdit); // const backgroundShouldLoad = current || active;
166
+
167
+ var backgroundShouldLoad = current || active;
167
168
 
168
169
  var _useState5 = React.useState(isStatic || isCapture),
169
170
  _useState6 = _slicedToArray__default["default"](_useState5, 2),
@@ -315,7 +316,7 @@ function MapScreen(_ref) {
315
316
  } else if (stateId === 'map') {
316
317
  setOpened(true);
317
318
  setSelectedMarkerIndex(null);
318
- } else if (stateId === 'markers') {
319
+ } else if (stateId === 'markers' || stateId === 'markers-with-image') {
319
320
  setOpened(true);
320
321
  setSelectedMarkerIndex(parseInt(markerIndex, 10));
321
322
  }
@@ -804,75 +805,154 @@ var definition = [{
804
805
  component: MapImagesScreen,
805
806
  layouts: ['normal'],
806
807
  transforms: transforms,
807
- fields: [{
808
- name: 'title',
809
- type: 'heading-element',
810
- theme: {
811
- textStyle: 'heading1'
812
- },
813
- label: reactIntl.defineMessage({
814
- id: "+AEVbJ",
815
- defaultMessage: [{
816
- "type": 0,
817
- "value": "Title"
818
- }]
819
- })
820
- }, {
821
- name: 'description',
822
- type: 'text-element',
823
- theme: {
824
- textStyle: 'text'
825
- },
826
- label: reactIntl.defineMessage({
827
- id: "ZCe0r4",
828
- defaultMessage: [{
829
- "type": 0,
830
- "value": "Description"
831
- }]
832
- })
833
- }, {
834
- name: 'button',
835
- type: 'button-element',
836
- theme: {
837
- textStyle: 'button'
838
- },
808
+ states: [{
809
+ id: 'intro',
839
810
  label: reactIntl.defineMessage({
840
- id: "i6bmbD",
811
+ id: "BgrRxZ",
841
812
  defaultMessage: [{
842
813
  "type": 0,
843
- "value": "Button"
814
+ "value": "Intro"
844
815
  }]
845
- })
816
+ }),
817
+ fields: [{
818
+ name: 'title',
819
+ type: 'heading-element',
820
+ theme: {
821
+ textStyle: 'heading1'
822
+ },
823
+ label: reactIntl.defineMessage({
824
+ id: "+AEVbJ",
825
+ defaultMessage: [{
826
+ "type": 0,
827
+ "value": "Title"
828
+ }]
829
+ })
830
+ }, {
831
+ name: 'description',
832
+ type: 'text-element',
833
+ theme: {
834
+ textStyle: 'text'
835
+ },
836
+ label: reactIntl.defineMessage({
837
+ id: "ZCe0r4",
838
+ defaultMessage: [{
839
+ "type": 0,
840
+ "value": "Description"
841
+ }]
842
+ })
843
+ }, {
844
+ name: 'button',
845
+ type: 'button-element',
846
+ theme: {
847
+ textStyle: 'button'
848
+ },
849
+ label: reactIntl.defineMessage({
850
+ id: "i6bmbD",
851
+ defaultMessage: [{
852
+ "type": 0,
853
+ "value": "Button"
854
+ }]
855
+ })
856
+ }]
846
857
  }, {
847
- name: 'draggable',
848
- type: 'toggle',
849
- defaultValue: true,
858
+ id: 'map',
850
859
  label: reactIntl.defineMessage({
851
- id: "A7ncT3",
860
+ id: "eYHEYe",
852
861
  defaultMessage: [{
853
862
  "type": 0,
854
- "value": "Draggable"
863
+ "value": "Map"
855
864
  }]
856
- })
865
+ }),
866
+ fields: [{
867
+ name: 'draggable',
868
+ type: 'toggle',
869
+ defaultValue: true,
870
+ label: reactIntl.defineMessage({
871
+ id: "A7ncT3",
872
+ defaultMessage: [{
873
+ "type": 0,
874
+ "value": "Draggable"
875
+ }]
876
+ })
877
+ }, {
878
+ name: 'fitBounds',
879
+ type: 'toggle',
880
+ defaultValue: true,
881
+ label: reactIntl.defineMessage({
882
+ id: "NVUpOG",
883
+ defaultMessage: [{
884
+ "type": 0,
885
+ "value": "Map fit markers"
886
+ }]
887
+ })
888
+ }, {
889
+ name: 'zoom',
890
+ type: 'slider',
891
+ defaultValue: 9,
892
+ min: 0,
893
+ max: 16,
894
+ label: reactIntl.defineMessage({
895
+ id: "vRzzo6",
896
+ defaultMessage: [{
897
+ "type": 0,
898
+ "value": "Zoom"
899
+ }]
900
+ })
901
+ }, {
902
+ name: 'center',
903
+ type: 'geo-position',
904
+ label: reactIntl.defineMessage({
905
+ id: "W5qWPj",
906
+ defaultMessage: [{
907
+ "type": 0,
908
+ "value": "Center"
909
+ }]
910
+ })
911
+ }]
857
912
  }, {
858
- name: 'markers',
859
- type: 'markers-with-image',
860
- theme: {
861
- title: {
862
- textStyle: 'heading3'
863
- },
864
- description: {
865
- textStyle: 'text'
866
- }
867
- },
913
+ id: 'markers-with-image',
868
914
  label: reactIntl.defineMessage({
869
- id: "CW3KAC",
915
+ id: "+LvOvJ",
870
916
  defaultMessage: [{
871
917
  "type": 0,
872
- "value": "Markers with image"
918
+ "value": "Markers"
873
919
  }]
874
- })
875
- }, {
920
+ }),
921
+ repeatable: true,
922
+ fieldName: 'markers',
923
+ fields: [{
924
+ name: 'title',
925
+ type: 'heading-element',
926
+ label: reactIntl.defineMessage({
927
+ id: "+AEVbJ",
928
+ defaultMessage: [{
929
+ "type": 0,
930
+ "value": "Title"
931
+ }]
932
+ })
933
+ }, {
934
+ name: 'description',
935
+ type: 'text-element',
936
+ label: reactIntl.defineMessage({
937
+ id: "ZCe0r4",
938
+ defaultMessage: [{
939
+ "type": 0,
940
+ "value": "Description"
941
+ }]
942
+ })
943
+ }, {
944
+ name: 'geoPosition',
945
+ type: 'geo-position',
946
+ label: reactIntl.defineMessage({
947
+ id: "u3ok54",
948
+ defaultMessage: [{
949
+ "type": 0,
950
+ "value": "Position"
951
+ }]
952
+ })
953
+ }]
954
+ }],
955
+ fields: [{
876
956
  name: 'background',
877
957
  type: 'background',
878
958
  label: reactIntl.defineMessage({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/screen-map",
3
- "version": "0.3.103",
3
+ "version": "0.3.107",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "javascript"
@@ -40,26 +40,26 @@
40
40
  "prepare": "../../scripts/prepare-package.sh"
41
41
  },
42
42
  "devDependencies": {
43
- "react": "^16.8.0 || ^17.0.0",
44
- "react-dom": "^16.8.0 || ^17.0.0"
43
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
44
+ "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
45
45
  },
46
46
  "peerDependencies": {
47
- "react": "^16.8.0 || ^17.0.0",
48
- "react-dom": "^16.8.0 || ^17.0.0"
47
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
48
+ "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
49
49
  },
50
50
  "dependencies": {
51
51
  "@babel/runtime": "^7.13.10",
52
- "@micromag/core": "^0.3.91",
53
- "@micromag/element-background": "^0.3.91",
54
- "@micromag/element-button": "^0.3.91",
55
- "@micromag/element-call-to-action": "^0.3.103",
56
- "@micromag/element-container": "^0.3.91",
57
- "@micromag/element-heading": "^0.3.91",
58
- "@micromag/element-image": "^0.3.91",
59
- "@micromag/element-map": "^0.3.91",
60
- "@micromag/element-scroll": "^0.3.91",
61
- "@micromag/element-text": "^0.3.91",
62
- "@micromag/transforms": "^0.3.91",
52
+ "@micromag/core": "^0.3.107",
53
+ "@micromag/element-background": "^0.3.107",
54
+ "@micromag/element-button": "^0.3.107",
55
+ "@micromag/element-call-to-action": "^0.3.107",
56
+ "@micromag/element-container": "^0.3.107",
57
+ "@micromag/element-heading": "^0.3.107",
58
+ "@micromag/element-image": "^0.3.107",
59
+ "@micromag/element-map": "^0.3.107",
60
+ "@micromag/element-scroll": "^0.3.107",
61
+ "@micromag/element-text": "^0.3.107",
62
+ "@micromag/transforms": "^0.3.107",
63
63
  "classnames": "^2.2.6",
64
64
  "lodash": "^4.17.21",
65
65
  "prop-types": "^15.7.2",
@@ -69,5 +69,5 @@
69
69
  "publishConfig": {
70
70
  "access": "public"
71
71
  },
72
- "gitHead": "660b2ada7b03941feb841470abf5cd2cc6e3e68f"
72
+ "gitHead": "952ef450fe62328a0ae3ab6dbb3c3079bb66d17a"
73
73
  }