app-studio 0.0.15 → 0.1.2
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/dist/app-studio.cjs.development.js +45 -209
- package/dist/app-studio.cjs.development.js.map +1 -1
- package/dist/app-studio.cjs.production.min.js +1 -1
- package/dist/app-studio.cjs.production.min.js.map +1 -1
- package/dist/app-studio.esm.js +45 -209
- package/dist/app-studio.esm.js.map +1 -1
- package/dist/components/Element.d.ts +0 -16
- package/dist/components/Form.d.ts +18 -2
- package/dist/components/Image.d.ts +1 -0
- package/dist/components/Text.d.ts +2 -2
- package/dist/components/View.d.ts +1 -0
- package/package.json +1 -1
|
@@ -26,21 +26,6 @@ function _setPrototypeOf(o, p) {
|
|
|
26
26
|
return _setPrototypeOf(o, p);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
30
|
-
if (source == null) return {};
|
|
31
|
-
var target = {};
|
|
32
|
-
var sourceKeys = Object.keys(source);
|
|
33
|
-
var key, i;
|
|
34
|
-
|
|
35
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
36
|
-
key = sourceKeys[i];
|
|
37
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
38
|
-
target[key] = source[key];
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return target;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
29
|
var palette = {
|
|
45
30
|
whiteAlpha: {
|
|
46
31
|
50: 'rgba(255, 255, 255, 0.04)',
|
|
@@ -618,64 +603,29 @@ var applyStyle = function applyStyle(props) {
|
|
|
618
603
|
});
|
|
619
604
|
return newProps;
|
|
620
605
|
}; // function convertToCSS(props: any) {
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
// breakpoints[size].max &&
|
|
645
|
-
// breakpoints[size].max >= 0 &&
|
|
646
|
-
// breakpoints[size].max < Infinity
|
|
647
|
-
// ? ' and '
|
|
648
|
-
// : ''
|
|
649
|
-
// } ${
|
|
650
|
-
// breakpoints[size].max &&
|
|
651
|
-
// breakpoints[size].max >= 0 &&
|
|
652
|
-
// breakpoints[size].max < Infinity
|
|
653
|
-
// ? ' (max-width:' + breakpoints[size].max + 'px)'
|
|
654
|
-
// : ''
|
|
655
|
-
// } {
|
|
656
|
-
// ${convertToCSS(props[size])}
|
|
657
|
-
// }`
|
|
658
|
-
// : '';
|
|
659
|
-
// })
|
|
660
|
-
// .join('\n');
|
|
661
|
-
// return mediaQueries;
|
|
662
|
-
// };
|
|
663
|
-
|
|
664
|
-
var StyledView = /*#__PURE__*/styled.div(function (props) {
|
|
665
|
-
return applyStyle(props);
|
|
666
|
-
});
|
|
667
|
-
var StyledImage = /*#__PURE__*/styled.img(function (props) {
|
|
668
|
-
return applyStyle(props);
|
|
669
|
-
});
|
|
670
|
-
var StyledSpan = /*#__PURE__*/styled.span(function (props) {
|
|
671
|
-
return applyStyle(props);
|
|
672
|
-
});
|
|
673
|
-
var StyledInput = /*#__PURE__*/styled.input(function (props) {
|
|
674
|
-
return applyStyle(props);
|
|
675
|
-
});
|
|
676
|
-
var StyledForm = /*#__PURE__*/styled.form(function (props) {
|
|
677
|
-
return applyStyle(props);
|
|
678
|
-
});
|
|
606
|
+
var elements = {
|
|
607
|
+
form: /*#__PURE__*/styled.form(function (props) {
|
|
608
|
+
return applyStyle(props);
|
|
609
|
+
}),
|
|
610
|
+
button: /*#__PURE__*/styled.button(function (props) {
|
|
611
|
+
return applyStyle(props);
|
|
612
|
+
}),
|
|
613
|
+
input: /*#__PURE__*/styled.input(function (props) {
|
|
614
|
+
return applyStyle(props);
|
|
615
|
+
}),
|
|
616
|
+
span: /*#__PURE__*/styled.span(function (props) {
|
|
617
|
+
return applyStyle(props);
|
|
618
|
+
}),
|
|
619
|
+
img: /*#__PURE__*/styled.img(function (props) {
|
|
620
|
+
return applyStyle(props);
|
|
621
|
+
}),
|
|
622
|
+
div: /*#__PURE__*/styled.div(function (props) {
|
|
623
|
+
return applyStyle(props);
|
|
624
|
+
}),
|
|
625
|
+
video: /*#__PURE__*/styled.video(function (props) {
|
|
626
|
+
return applyStyle(props);
|
|
627
|
+
})
|
|
628
|
+
};
|
|
679
629
|
var ViewElement = /*#__PURE__*/function (_React$PureComponent) {
|
|
680
630
|
_inheritsLoose(ViewElement, _React$PureComponent);
|
|
681
631
|
|
|
@@ -686,112 +636,14 @@ var ViewElement = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
686
636
|
var _proto = ViewElement.prototype;
|
|
687
637
|
|
|
688
638
|
_proto.render = function render() {
|
|
689
|
-
var
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
onClick = this.props.onPress;
|
|
693
|
-
} //console.log(this.props);
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
return React__default.createElement(StyledView, Object.assign({}, this.props, {
|
|
697
|
-
onClick: onClick
|
|
639
|
+
var Element = elements[this.props.tag] ? elements[this.props.tag] : elements.div;
|
|
640
|
+
return React__default.createElement(Element, Object.assign({}, this.props, {
|
|
641
|
+
onClick: this.props.onPress !== undefined ? this.props.onPress : this.props.onClick
|
|
698
642
|
}));
|
|
699
643
|
};
|
|
700
644
|
|
|
701
645
|
return ViewElement;
|
|
702
646
|
}(React__default.PureComponent);
|
|
703
|
-
var ImageElement = /*#__PURE__*/function (_React$PureComponent2) {
|
|
704
|
-
_inheritsLoose(ImageElement, _React$PureComponent2);
|
|
705
|
-
|
|
706
|
-
function ImageElement() {
|
|
707
|
-
return _React$PureComponent2.apply(this, arguments) || this;
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
var _proto2 = ImageElement.prototype;
|
|
711
|
-
|
|
712
|
-
_proto2.render = function render() {
|
|
713
|
-
var onClick = this.props.onClick;
|
|
714
|
-
|
|
715
|
-
if (this.props.onPress !== undefined) {
|
|
716
|
-
onClick = this.props.onPress;
|
|
717
|
-
}
|
|
718
|
-
|
|
719
|
-
return React__default.createElement(StyledImage, Object.assign({}, this.props, {
|
|
720
|
-
onClick: onClick
|
|
721
|
-
}));
|
|
722
|
-
};
|
|
723
|
-
|
|
724
|
-
return ImageElement;
|
|
725
|
-
}(React__default.PureComponent);
|
|
726
|
-
var SpanElement = /*#__PURE__*/function (_React$PureComponent3) {
|
|
727
|
-
_inheritsLoose(SpanElement, _React$PureComponent3);
|
|
728
|
-
|
|
729
|
-
function SpanElement() {
|
|
730
|
-
return _React$PureComponent3.apply(this, arguments) || this;
|
|
731
|
-
}
|
|
732
|
-
|
|
733
|
-
var _proto3 = SpanElement.prototype;
|
|
734
|
-
|
|
735
|
-
_proto3.render = function render() {
|
|
736
|
-
var onClick = this.props.onClick;
|
|
737
|
-
|
|
738
|
-
if (this.props.onPress !== undefined) {
|
|
739
|
-
onClick = this.props.onPress;
|
|
740
|
-
}
|
|
741
|
-
|
|
742
|
-
return React__default.createElement(StyledSpan, Object.assign({}, this.props, {
|
|
743
|
-
onClick: onClick
|
|
744
|
-
}));
|
|
745
|
-
};
|
|
746
|
-
|
|
747
|
-
return SpanElement;
|
|
748
|
-
}(React__default.PureComponent);
|
|
749
|
-
var InputElement = /*#__PURE__*/function (_React$PureComponent4) {
|
|
750
|
-
_inheritsLoose(InputElement, _React$PureComponent4);
|
|
751
|
-
|
|
752
|
-
function InputElement() {
|
|
753
|
-
return _React$PureComponent4.apply(this, arguments) || this;
|
|
754
|
-
}
|
|
755
|
-
|
|
756
|
-
var _proto4 = InputElement.prototype;
|
|
757
|
-
|
|
758
|
-
_proto4.render = function render() {
|
|
759
|
-
var onClick = this.props.onClick;
|
|
760
|
-
|
|
761
|
-
if (this.props.onPress !== undefined) {
|
|
762
|
-
onClick = this.props.onPress;
|
|
763
|
-
}
|
|
764
|
-
|
|
765
|
-
return React__default.createElement(StyledInput, Object.assign({}, this.props, {
|
|
766
|
-
onClick: onClick
|
|
767
|
-
}));
|
|
768
|
-
};
|
|
769
|
-
|
|
770
|
-
return InputElement;
|
|
771
|
-
}(React__default.PureComponent);
|
|
772
|
-
var FormElement = /*#__PURE__*/function (_React$PureComponent5) {
|
|
773
|
-
_inheritsLoose(FormElement, _React$PureComponent5);
|
|
774
|
-
|
|
775
|
-
function FormElement() {
|
|
776
|
-
return _React$PureComponent5.apply(this, arguments) || this;
|
|
777
|
-
}
|
|
778
|
-
|
|
779
|
-
var _proto5 = FormElement.prototype;
|
|
780
|
-
|
|
781
|
-
_proto5.render = function render() {
|
|
782
|
-
var onClick = this.props.onClick;
|
|
783
|
-
|
|
784
|
-
if (this.props.onPress !== undefined) {
|
|
785
|
-
onClick = this.props.onPress;
|
|
786
|
-
}
|
|
787
|
-
|
|
788
|
-
return React__default.createElement(StyledForm, Object.assign({}, this.props, {
|
|
789
|
-
onClick: onClick
|
|
790
|
-
}));
|
|
791
|
-
};
|
|
792
|
-
|
|
793
|
-
return FormElement;
|
|
794
|
-
}(React__default.PureComponent);
|
|
795
647
|
|
|
796
648
|
var View = function View(props) {
|
|
797
649
|
return React__default.createElement(ViewElement, Object.assign({}, props));
|
|
@@ -804,51 +656,35 @@ var Scroll = function Scroll(props) {
|
|
|
804
656
|
}, props));
|
|
805
657
|
};
|
|
806
658
|
var Span = function Span(props) {
|
|
807
|
-
return React__default.createElement(
|
|
659
|
+
return React__default.createElement(ViewElement, Object.assign({}, props, {
|
|
660
|
+
tag: "span"
|
|
661
|
+
}));
|
|
808
662
|
};
|
|
809
663
|
|
|
810
664
|
var Image = function Image(props) {
|
|
811
|
-
return React__default.createElement(
|
|
665
|
+
return React__default.createElement(ViewElement, Object.assign({}, props, {
|
|
666
|
+
tag: "img"
|
|
667
|
+
}));
|
|
812
668
|
};
|
|
813
669
|
|
|
814
|
-
var _excluded = ["toUpperCase", "children"];
|
|
815
|
-
var TextSpan = /*#__PURE__*/styled.span(function (props) {
|
|
816
|
-
return applyStyle(props);
|
|
817
|
-
});
|
|
818
670
|
var Text = function Text(props) {
|
|
819
|
-
|
|
820
|
-
toUpperCase = _props$toUpperCase === void 0 ? false : _props$toUpperCase,
|
|
821
|
-
children = props.children,
|
|
822
|
-
textPops = _objectWithoutPropertiesLoose(props, _excluded);
|
|
823
|
-
|
|
824
|
-
var content = children;
|
|
825
|
-
|
|
826
|
-
if (typeof content === 'string' && toUpperCase) {
|
|
827
|
-
content = content.toUpperCase();
|
|
828
|
-
} // if (typeof content === 'string' && toFormat) {
|
|
829
|
-
// const newtext: any = content
|
|
830
|
-
// .split('\n')
|
|
831
|
-
// .map((item: any, key: number): any => {
|
|
832
|
-
// return (
|
|
833
|
-
// <span key={key.toString()}>
|
|
834
|
-
// {item}
|
|
835
|
-
// <br />
|
|
836
|
-
// </span>
|
|
837
|
-
// );
|
|
838
|
-
// });
|
|
839
|
-
// }
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
return React__default.createElement(TextSpan, Object.assign({}, textPops, {
|
|
843
|
-
children: content
|
|
844
|
-
}));
|
|
671
|
+
return React__default.createElement(ViewElement, Object.assign({}, props));
|
|
845
672
|
};
|
|
846
673
|
|
|
847
674
|
var Form = function Form(props) {
|
|
848
|
-
return React__default.createElement(
|
|
675
|
+
return React__default.createElement(ViewElement, Object.assign({}, props, {
|
|
676
|
+
tag: "form"
|
|
677
|
+
}));
|
|
849
678
|
};
|
|
850
679
|
var Input = function Input(props) {
|
|
851
|
-
return React__default.createElement(
|
|
680
|
+
return React__default.createElement(ViewElement, Object.assign({}, props, {
|
|
681
|
+
tag: "input"
|
|
682
|
+
}));
|
|
683
|
+
};
|
|
684
|
+
var Button = function Button(props) {
|
|
685
|
+
return React__default.createElement(ViewElement, Object.assign({}, props, {
|
|
686
|
+
tag: "button"
|
|
687
|
+
}));
|
|
852
688
|
};
|
|
853
689
|
|
|
854
690
|
var useMount = function useMount(callback) {
|
|
@@ -964,6 +800,7 @@ var useResponsive = function useResponsive() {
|
|
|
964
800
|
};
|
|
965
801
|
};
|
|
966
802
|
|
|
803
|
+
exports.Button = Button;
|
|
967
804
|
exports.Div = Div;
|
|
968
805
|
exports.Form = Form;
|
|
969
806
|
exports.Image = Image;
|
|
@@ -974,7 +811,6 @@ exports.SafeArea = SafeArea;
|
|
|
974
811
|
exports.Scroll = Scroll;
|
|
975
812
|
exports.Span = Span;
|
|
976
813
|
exports.Text = Text;
|
|
977
|
-
exports.TextSpan = TextSpan;
|
|
978
814
|
exports.ThemeContext = ThemeContext;
|
|
979
815
|
exports.ThemeProvider = ThemeProvider;
|
|
980
816
|
exports.View = View;
|