@draftbit/core 48.4.2-13b338.2 → 48.4.2-a1df21.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/lib/commonjs/components/Layout/Center.js +1 -1
- package/lib/commonjs/components/Layout/Circle.js +1 -1
- package/lib/commonjs/components/Layout/LayoutCommon.js +1 -0
- package/lib/commonjs/components/Layout/Square.js +1 -1
- package/lib/typescript/src/components/Layout/Center.js +3 -1
- package/lib/typescript/src/components/Layout/Center.js.map +1 -1
- package/lib/typescript/src/components/Layout/Circle.js +4 -1
- package/lib/typescript/src/components/Layout/Circle.js.map +1 -1
- package/lib/typescript/src/components/Layout/LayoutCommon.d.ts +15 -0
- package/lib/typescript/src/components/Layout/LayoutCommon.js +8 -0
- package/lib/typescript/src/components/Layout/LayoutCommon.js.map +1 -0
- package/lib/typescript/src/components/Layout/Square.js +4 -0
- package/lib/typescript/src/components/Layout/Square.js.map +1 -1
- package/lib/typescript/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/components/Layout/Center.js +3 -1
- package/src/components/Layout/Center.js.map +1 -1
- package/src/components/Layout/Center.tsx +5 -1
- package/src/components/Layout/Circle.js +4 -1
- package/src/components/Layout/Circle.js.map +1 -1
- package/src/components/Layout/Circle.tsx +14 -1
- package/src/components/Layout/LayoutCommon.js +8 -0
- package/src/components/Layout/LayoutCommon.js.map +1 -0
- package/src/components/Layout/LayoutCommon.ts +25 -0
- package/src/components/Layout/Square.js +4 -0
- package/src/components/Layout/Square.js.map +1 -1
- package/src/components/Layout/Square.tsx +7 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["style"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Layout/Center.tsx";var Center=function Center(_ref){var style=_ref.style,rest=(0,_objectWithoutProperties2.default)(_ref,_excluded);return(0,_jsxRuntime.jsx)(_reactNative.View,Object.assign({},rest,{style:[styles.center,style]}));};var styles=_reactNative.StyleSheet.create({center:{alignItems:"center",justifyContent:"center"}});var _default=Center;exports.default=_default;
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _LayoutCommon=require("./LayoutCommon");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["style"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Layout/Center.tsx";var Center=function Center(_ref){var style=_ref.style,rest=(0,_objectWithoutProperties2.default)(_ref,_excluded);var backwardsCompatibleStyle=(0,_LayoutCommon.convertBackwardCompatiblePropsToStyle)(rest);return(0,_jsxRuntime.jsx)(_reactNative.View,Object.assign({},rest,{style:[styles.center,backwardsCompatibleStyle,style]}));};var styles=_reactNative.StyleSheet.create({center:{alignItems:"center",justifyContent:"center"}});var _default=Center;exports.default=_default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _Square=_interopRequireDefault(require("./Square"));var _jsxRuntime=require("react/jsx-runtime");var _excluded=["size","style"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Layout/Circle.tsx";var Circle=function Circle(_ref){var size=_ref.size,style=_ref.style,rest=(0,_objectWithoutProperties2.default)(_ref,_excluded);return(0,_jsxRuntime.jsx)(_Square.default,Object.assign({},rest,{size:size,style:[style,styles.circle]}));};var styles=_reactNative.StyleSheet.create({circle:{borderRadius:1000}});var _default=Circle;exports.default=_default;
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _Square=_interopRequireDefault(require("./Square"));var _lodash=require("lodash");var _LayoutCommon=require("./LayoutCommon");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["size","style"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Layout/Circle.tsx";var Circle=function Circle(_ref){var size=_ref.size,style=_ref.style,rest=(0,_objectWithoutProperties2.default)(_ref,_excluded);var backwardsCompatibleStyle=(0,_lodash.pick)((0,_LayoutCommon.convertBackwardCompatiblePropsToStyle)(rest),"backgroundColor");return(0,_jsxRuntime.jsx)(_Square.default,Object.assign({},rest,{size:size,style:[backwardsCompatibleStyle,style,styles.circle]}));};var styles=_reactNative.StyleSheet.create({circle:{borderRadius:1000}});var _default=Circle;exports.default=_default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});exports.convertBackwardCompatiblePropsToStyle=convertBackwardCompatiblePropsToStyle;function convertBackwardCompatiblePropsToStyle(props){return{width:props.width,height:props.height,backgroundColor:props.bgColor};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _Center=_interopRequireDefault(require("./Center"));var _jsxRuntime=require("react/jsx-runtime");var _excluded=["size","style","onLayout"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Layout/Square.tsx";var Square=function Square(_ref){var size=_ref.size,style=_ref.style,_onLayout=_ref.onLayout,rest=(0,_objectWithoutProperties2.default)(_ref,_excluded);var _React$useState=_react.default.useState(0),_React$useState2=(0,_slicedToArray2.default)(_React$useState,2),calculatedSize=_React$useState2[0],setCalculatedSize=_React$useState2[1];return(0,_jsxRuntime.jsx)(_Center.default,Object.assign({onLayout:function onLayout(e){var layout=e.nativeEvent.layout;setCalculatedSize(Math.max(layout.width,layout.height));_onLayout==null?void 0:_onLayout(e);}},rest,{style:[style,size!=undefined?{width:size,height:size}:{},calculatedSize>0?{width:calculatedSize,height:calculatedSize}:{}]}));};var _default=Square;exports.default=_default;
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireDefault(require("react"));var _Center=_interopRequireDefault(require("./Center"));var _lodash=require("lodash");var _LayoutCommon=require("./LayoutCommon");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["size","style","onLayout"];var _this=this,_jsxFileName="/home/runner/work/react-native-jigsaw/react-native-jigsaw/packages/core/src/components/Layout/Square.tsx";var Square=function Square(_ref){var size=_ref.size,style=_ref.style,_onLayout=_ref.onLayout,rest=(0,_objectWithoutProperties2.default)(_ref,_excluded);var _React$useState=_react.default.useState(0),_React$useState2=(0,_slicedToArray2.default)(_React$useState,2),calculatedSize=_React$useState2[0],setCalculatedSize=_React$useState2[1];var backwardsCompatibleStyle=(0,_lodash.pick)((0,_LayoutCommon.convertBackwardCompatiblePropsToStyle)(rest),"backgroundColor");return(0,_jsxRuntime.jsx)(_Center.default,Object.assign({onLayout:function onLayout(e){var layout=e.nativeEvent.layout;setCalculatedSize(Math.max(layout.width,layout.height));_onLayout==null?void 0:_onLayout(e);}},rest,{style:[backwardsCompatibleStyle,style,size!=undefined?{width:size,height:size}:{},calculatedSize>0?{width:calculatedSize,height:calculatedSize}:{}]}));};var _default=Square;exports.default=_default;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { View, StyleSheet } from "react-native";
|
|
3
|
+
import { convertBackwardCompatiblePropsToStyle } from "./LayoutCommon";
|
|
3
4
|
const Center = ({ style, ...rest }) => {
|
|
4
|
-
|
|
5
|
+
const backwardsCompatibleStyle = convertBackwardCompatiblePropsToStyle(rest);
|
|
6
|
+
return (React.createElement(View, { ...rest, style: [styles.center, backwardsCompatibleStyle, style] }));
|
|
5
7
|
};
|
|
6
8
|
const styles = StyleSheet.create({
|
|
7
9
|
center: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Center.js","sourceRoot":"","sources":["../../../../../src/components/Layout/Center.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAa,UAAU,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"Center.js","sourceRoot":"","sources":["../../../../../src/components/Layout/Center.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAa,UAAU,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,qCAAqC,EAAE,MAAM,gBAAgB,CAAC;AAEvE,MAAM,MAAM,GAAwB,CAAC,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE;IACzD,MAAM,wBAAwB,GAAG,qCAAqC,CAAC,IAAI,CAAC,CAAC;IAC7E,OAAO,CACL,oBAAC,IAAI,OAAK,IAAI,EAAE,KAAK,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,wBAAwB,EAAE,KAAK,CAAC,GAAI,CAC5E,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,MAAM,EAAE;QACN,UAAU,EAAE,QAAQ;QACpB,cAAc,EAAE,QAAQ;KACzB;CACF,CAAC,CAAC;AAEH,eAAe,MAAM,CAAC"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { StyleSheet } from "react-native";
|
|
3
3
|
import Square from "./Square";
|
|
4
|
+
import { pick } from "lodash";
|
|
5
|
+
import { convertBackwardCompatiblePropsToStyle } from "./LayoutCommon";
|
|
4
6
|
const Circle = ({ size, style, ...rest }) => {
|
|
5
|
-
|
|
7
|
+
const backwardsCompatibleStyle = pick(convertBackwardCompatiblePropsToStyle(rest), "backgroundColor");
|
|
8
|
+
return (React.createElement(Square, { ...rest, size: size, style: [backwardsCompatibleStyle, style, styles.circle] }));
|
|
6
9
|
};
|
|
7
10
|
const styles = StyleSheet.create({
|
|
8
11
|
circle: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Circle.js","sourceRoot":"","sources":["../../../../../src/components/Layout/Circle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAa,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,MAAM,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"Circle.js","sourceRoot":"","sources":["../../../../../src/components/Layout/Circle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAa,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,qCAAqC,EAAE,MAAM,gBAAgB,CAAC;AAMvE,MAAM,MAAM,GAA0B,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE;IACjE,MAAM,wBAAwB,GAAG,IAAI,CACnC,qCAAqC,CAAC,IAAI,CAAC,EAC3C,iBAAiB,CAClB,CAAC;IAEF,OAAO,CACL,oBAAC,MAAM,OACD,IAAI,EACR,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,CAAC,wBAAwB,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,GACvD,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,MAAM,EAAE;QACN,YAAY,EAAE,IAAI,EAAE,gGAAgG;KACrH;CACF,CAAC,CAAC;AAEH,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ViewProps, ViewStyle } from "react-native";
|
|
2
|
+
/**
|
|
3
|
+
* Old and deprecated layout components of the same names had props that have since been removed
|
|
4
|
+
* This maintains correct rendering when using the older/deprecated props as to not break existing usage
|
|
5
|
+
* (See: deprecared-components/Layout)
|
|
6
|
+
*
|
|
7
|
+
* These deprecated props are not exposed in the component type to discourage their usage
|
|
8
|
+
*/
|
|
9
|
+
interface BackwardsCompatibleProps {
|
|
10
|
+
width?: number;
|
|
11
|
+
height?: number;
|
|
12
|
+
bgColor?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function convertBackwardCompatiblePropsToStyle(props: BackwardsCompatibleProps & ViewProps): ViewStyle;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LayoutCommon.js","sourceRoot":"","sources":["../../../../../src/components/Layout/LayoutCommon.ts"],"names":[],"mappings":"AAgBA,MAAM,UAAU,qCAAqC,CACnD,KAA2C;IAE3C,OAAO;QACL,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,eAAe,EAAE,KAAK,CAAC,OAAO;KAC/B,CAAC;AACJ,CAAC"}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import Center from "./Center";
|
|
3
|
+
import { pick } from "lodash";
|
|
4
|
+
import { convertBackwardCompatiblePropsToStyle } from "./LayoutCommon";
|
|
3
5
|
const Square = ({ size, style, onLayout, ...rest }) => {
|
|
4
6
|
const [calculatedSize, setCalculatedSize] = React.useState(0);
|
|
7
|
+
const backwardsCompatibleStyle = pick(convertBackwardCompatiblePropsToStyle(rest), "backgroundColor");
|
|
5
8
|
return (React.createElement(Center, { onLayout: (e) => {
|
|
6
9
|
const layout = e.nativeEvent.layout;
|
|
7
10
|
setCalculatedSize(Math.max(layout.width, layout.height));
|
|
8
11
|
onLayout === null || onLayout === void 0 ? void 0 : onLayout(e);
|
|
9
12
|
}, ...rest, style: [
|
|
13
|
+
backwardsCompatibleStyle,
|
|
10
14
|
style,
|
|
11
15
|
size != undefined ? { width: size, height: size } : {},
|
|
12
16
|
calculatedSize > 0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Square.js","sourceRoot":"","sources":["../../../../../src/components/Layout/Square.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,MAAM,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"Square.js","sourceRoot":"","sources":["../../../../../src/components/Layout/Square.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,qCAAqC,EAAE,MAAM,gBAAgB,CAAC;AAMvE,MAAM,MAAM,GAA0B,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,EAAE;IAC3E,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC9D,MAAM,wBAAwB,GAAG,IAAI,CACnC,qCAAqC,CAAC,IAAI,CAAC,EAC3C,iBAAiB,CAClB,CAAC;IAEF,OAAO,CACL,oBAAC,MAAM,IACL,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;YACd,MAAM,MAAM,GAAG,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC;YACpC,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC;YACzD,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAG,CAAC,CAAC,CAAC;QAChB,CAAC,KACG,IAAI,EACR,KAAK,EAAE;YACL,wBAAwB;YACxB,KAAK;YACL,IAAI,IAAI,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE;YACtD,cAAc,GAAG,CAAC;gBAChB,CAAC,CAAC;oBACE,KAAK,EAAE,cAAc;oBACrB,MAAM,EAAE,cAAc;iBACvB;gBACH,CAAC,CAAC,EAAE;SACP,GACD,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,MAAM,CAAC"}
|