@expo/html-elements 0.6.2 → 0.7.0

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/CHANGELOG.md CHANGED
@@ -10,6 +10,12 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 0.7.0 — 2023-10-17
14
+
15
+ ### 💡 Others
16
+
17
+ - Ship untranspiled JSX to support custom handling of `jsx` and `createElement`. ([#24889](https://github.com/expo/expo/pull/24889) by [@EvanBacon](https://github.com/EvanBacon))
18
+
13
19
  ## 0.6.2 — 2023-09-04
14
20
 
15
21
  _This version does not introduce any user-facing changes._
@@ -4,7 +4,7 @@ export function createSafeStyledView(View) {
4
4
  return React.forwardRef(({ style, ...props }, forwardedRef) => {
5
5
  // Filter and apply `center` prop.
6
6
  const finalStyle = useMemo(() => filterStyles(style), [style]);
7
- return React.createElement(View, { ref: forwardedRef, style: finalStyle, ...props });
7
+ return <View ref={forwardedRef} style={finalStyle} {...props}/>;
8
8
  });
9
9
  }
10
10
  //# sourceMappingURL=createSafeStyledView.native.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createSafeStyledView.native.js","sourceRoot":"","sources":["../../src/css/createSafeStyledView.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,UAAU,oBAAoB,CAAyC,IAAW;IACtF,OAAO,KAAK,CAAC,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAAO,EAAE,YAA8B,EAAE,EAAE;QACnF,kCAAkC;QAClC,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;QAE/D,OAAO,oBAAC,IAAI,IAAC,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,KAAM,KAAK,GAAI,CAAC;IACnE,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import React, { useMemo } from 'react';\n\nimport { filterStyles } from './filterStyles';\n\nexport function createSafeStyledView<TView extends React.ComponentType<any>>(View: TView) {\n return React.forwardRef(({ style, ...props }: any, forwardedRef: React.Ref<TView>) => {\n // Filter and apply `center` prop.\n const finalStyle = useMemo(() => filterStyles(style), [style]);\n\n return <View ref={forwardedRef} style={finalStyle} {...props} />;\n });\n}\n"]}
1
+ {"version":3,"file":"createSafeStyledView.native.js","sourceRoot":"","sources":["../../src/css/createSafeStyledView.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,MAAM,UAAU,oBAAoB,CAAyC,IAAW;IACtF,OAAO,KAAK,CAAC,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAAO,EAAE,YAA8B,EAAE,EAAE;QACnF,kCAAkC;QAClC,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;QAE/D,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;IACnE,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import React, { useMemo } from 'react';\n\nimport { filterStyles } from './filterStyles';\n\nexport function createSafeStyledView<TView extends React.ComponentType<any>>(View: TView) {\n return React.forwardRef(({ style, ...props }: any, forwardedRef: React.Ref<TView>) => {\n // Filter and apply `center` prop.\n const finalStyle = useMemo(() => filterStyles(style), [style]);\n\n return <View ref={forwardedRef} style={finalStyle} {...props} />;\n });\n}\n"]}
@@ -20,6 +20,6 @@ export const A = forwardRef(({ href, target, download, rel, ...props }, ref) =>
20
20
  },
21
21
  },
22
22
  });
23
- return React.createElement(Text, { accessibilityRole: "link", ...props, ...nativeProps, ref: ref });
23
+ return <Text accessibilityRole="link" {...props} {...nativeProps} ref={ref}/>;
24
24
  });
25
25
  //# sourceMappingURL=Anchor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Anchor.js","sourceRoot":"","sources":["../../src/elements/Anchor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,UAAU,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGjD,OAAO,IAAI,MAAM,oBAAoB,CAAC;AAEtC,MAAM,CAAC,MAAM,CAAC,GAAG,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,KAAK,EAAa,EAAE,GAAG,EAAE,EAAE;IACxF,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAY;QAC7C,GAAG,EAAE;YACH,IAAI;YACJ,SAAS,EAAE;gBACT,MAAM;gBACN,QAAQ;gBACR,GAAG;aACJ;SACF;QACD,OAAO,EAAE;YACP,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;gBACjB,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;gBACtC,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,IAAI,KAAK,SAAS,EAAE;oBAC/C,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;iBACvB;YACH,CAAC;SACF;KACF,CAAC,CAAC;IACH,OAAO,oBAAC,IAAI,IAAC,iBAAiB,EAAC,MAAM,KAAK,KAAK,KAAM,WAAW,EAAE,GAAG,EAAE,GAAG,GAAI,CAAC;AACjF,CAAC,CAA6B,CAAC","sourcesContent":["import React, { ComponentType, forwardRef } from 'react';\nimport { Linking, Platform } from 'react-native';\n\nimport { LinkProps } from './Text.types';\nimport Text from '../primitives/Text';\n\nexport const A = forwardRef(({ href, target, download, rel, ...props }: LinkProps, ref) => {\n const nativeProps = Platform.select<LinkProps>({\n web: {\n href,\n hrefAttrs: {\n target,\n download,\n rel,\n },\n },\n default: {\n onPress: (event) => {\n props.onPress && props.onPress(event);\n if (Platform.OS !== 'web' && href !== undefined) {\n Linking.openURL(href);\n }\n },\n },\n });\n return <Text accessibilityRole=\"link\" {...props} {...nativeProps} ref={ref} />;\n}) as ComponentType<LinkProps>;\n"]}
1
+ {"version":3,"file":"Anchor.js","sourceRoot":"","sources":["../../src/elements/Anchor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,UAAU,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGjD,OAAO,IAAI,MAAM,oBAAoB,CAAC;AAEtC,MAAM,CAAC,MAAM,CAAC,GAAG,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,KAAK,EAAa,EAAE,GAAG,EAAE,EAAE;IACxF,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAY;QAC7C,GAAG,EAAE;YACH,IAAI;YACJ,SAAS,EAAE;gBACT,MAAM;gBACN,QAAQ;gBACR,GAAG;aACJ;SACF;QACD,OAAO,EAAE;YACP,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;gBACjB,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;gBACtC,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,IAAI,KAAK,SAAS,EAAE;oBAC/C,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;iBACvB;YACH,CAAC;SACF;KACF,CAAC,CAAC;IACH,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAG,CAAC;AACjF,CAAC,CAA6B,CAAC","sourcesContent":["import React, { ComponentType, forwardRef } from 'react';\nimport { Linking, Platform } from 'react-native';\n\nimport { LinkProps } from './Text.types';\nimport Text from '../primitives/Text';\n\nexport const A = forwardRef(({ href, target, download, rel, ...props }: LinkProps, ref) => {\n const nativeProps = Platform.select<LinkProps>({\n web: {\n href,\n hrefAttrs: {\n target,\n download,\n rel,\n },\n },\n default: {\n onPress: (event) => {\n props.onPress && props.onPress(event);\n if (Platform.OS !== 'web' && href !== undefined) {\n Linking.openURL(href);\n }\n },\n },\n });\n return <Text accessibilityRole=\"link\" {...props} {...nativeProps} ref={ref} />;\n}) as ComponentType<LinkProps>;\n"]}
@@ -10,7 +10,7 @@ function createHeadingComponent(level) {
10
10
  default: {},
11
11
  });
12
12
  return forwardRef((props, ref) => {
13
- return (React.createElement(Text, { ...nativeProps, accessibilityRole: "header", ...props, style: [styles[`h${level}`], props.style], ref: ref }));
13
+ return (<Text {...nativeProps} accessibilityRole="header" {...props} style={[styles[`h${level}`], props.style]} ref={ref}/>);
14
14
  });
15
15
  }
16
16
  export const H1 = createHeadingComponent(1);
@@ -1 +1 @@
1
- {"version":3,"file":"Headings.js","sourceRoot":"","sources":["../../src/elements/Headings.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,UAAU,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,IAAmB,MAAM,oBAAoB,CAAC;AAErD,SAAS,sBAAsB,CAAC,KAAa;IAC3C,MAAM,WAAW,GAAQ,QAAQ,CAAC,MAAM,CAAC;QACvC,GAAG,EAAE;YACH,kBAAkB,EAAE,KAAK;SAC1B;QACD,OAAO,EAAE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AC,CAAC;QACrB,UAAU,EAAE,MAAM;KACnB;IACD,EAAE,EAAE;QACF,aAAa;QACb,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;QACf,aAAa;QACb,cAAc,EAAE,EAAE,CAAC,IAAI,CAAC;QACxB,UAAU,EAAE,MAAM;KACnB;IACD,EAAE,EAAE;QACF,aAAa;QACb,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC;QAClB,aAAa;QACb,cAAc,EAAE,EAAE,CAAC,IAAI,CAAC;QACxB,UAAU,EAAE,MAAM;KACnB;IACD,EAAE,EAAE;QACF,aAAa;QACb,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC;QAClB,aAAa;QACb,cAAc,EAAE,EAAE,CAAC,IAAI,CAAC;QACxB,UAAU,EAAE,MAAM;KACnB;CACF,CAAC,CAAC","sourcesContent":["import React, { ComponentType, forwardRef } from 'react';\nimport { Platform, StyleSheet } from 'react-native';\n\nimport { em } from '../css/units';\nimport Text, { TextProps } from '../primitives/Text';\n\nfunction createHeadingComponent(level: number): ComponentType<TextProps> {\n const nativeProps: any = Platform.select({\n web: {\n accessibilityLevel: level,\n },\n default: {},\n });\n return forwardRef((props: TextProps, ref) => {\n return (\n <Text\n {...nativeProps}\n accessibilityRole=\"header\"\n {...props}\n style={[styles[`h${level}`], props.style]}\n ref={ref}\n />\n );\n }) as ComponentType<TextProps>;\n}\n\nexport const H1 = createHeadingComponent(1);\nexport const H2 = createHeadingComponent(2);\nexport const H3 = createHeadingComponent(3);\nexport const H4 = createHeadingComponent(4);\nexport const H5 = createHeadingComponent(5);\nexport const H6 = createHeadingComponent(6);\n\n// Default web styles: http://trac.webkit.org/browser/trunk/Source/WebCore/css/html.css\nconst styles = StyleSheet.create({\n h1: {\n // @ts-ignore\n fontSize: em(2),\n // @ts-ignore\n marginVertical: em(0.67),\n fontWeight: 'bold',\n },\n h2: {\n // @ts-ignore\n fontSize: em(1.5),\n // @ts-ignore\n marginVertical: em(0.83),\n fontWeight: 'bold',\n },\n h3: {\n // @ts-ignore\n fontSize: em(1.17),\n // @ts-ignore\n marginVertical: em(1),\n fontWeight: 'bold',\n },\n h4: {\n // @ts-ignore\n fontSize: em(1),\n // @ts-ignore\n marginVertical: em(1.33),\n fontWeight: 'bold',\n },\n h5: {\n // @ts-ignore\n fontSize: em(0.83),\n // @ts-ignore\n marginVertical: em(1.67),\n fontWeight: 'bold',\n },\n h6: {\n // @ts-ignore\n fontSize: em(0.67),\n // @ts-ignore\n marginVertical: em(2.33),\n fontWeight: 'bold',\n },\n});\n"]}
1
+ {"version":3,"file":"Headings.js","sourceRoot":"","sources":["../../src/elements/Headings.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,UAAU,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,IAAmB,MAAM,oBAAoB,CAAC;AAErD,SAAS,sBAAsB,CAAC,KAAa;IAC3C,MAAM,WAAW,GAAQ,QAAQ,CAAC,MAAM,CAAC;QACvC,GAAG,EAAE;YACH,kBAAkB,EAAE,KAAK;SAC1B;QACD,OAAO,EAAE,EAAE;KACZ,CAAC,CAAC;IACH,OAAO,UAAU,CAAC,CAAC,KAAgB,EAAE,GAAG,EAAE,EAAE;QAC1C,OAAO,CACL,CAAC,IAAI,CACH,IAAI,WAAW,CAAC,CAChB,iBAAiB,CAAC,QAAQ,CAC1B,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAC1C,GAAG,CAAC,CAAC,GAAG,CAAC,EACT,CACH,CAAC;IACJ,CAAC,CAA6B,CAAC;AACjC,CAAC;AAED,MAAM,CAAC,MAAM,EAAE,GAAG,sBAAsB,CAAC,CAAC,CAAC,CAAC;AAC5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AI,CAAC;QAClB,aAAa;QACb,cAAc,EAAE,EAAE,CAAC,IAAI,CAAC;QACxB,UAAU,EAAE,MAAM;KACnB;CACF,CAAC,CAAC","sourcesContent":["import React, { ComponentType, forwardRef } from 'react';\nimport { Platform, StyleSheet } from 'react-native';\n\nimport { em } from '../css/units';\nimport Text, { TextProps } from '../primitives/Text';\n\nfunction createHeadingComponent(level: number): ComponentType<TextProps> {\n const nativeProps: any = Platform.select({\n web: {\n accessibilityLevel: level,\n },\n default: {},\n });\n return forwardRef((props: TextProps, ref) => {\n return (\n <Text\n {...nativeProps}\n accessibilityRole=\"header\"\n {...props}\n style={[styles[`h${level}`], props.style]}\n ref={ref}\n />\n );\n }) as ComponentType<TextProps>;\n}\n\nexport const H1 = createHeadingComponent(1);\nexport const H2 = createHeadingComponent(2);\nexport const H3 = createHeadingComponent(3);\nexport const H4 = createHeadingComponent(4);\nexport const H5 = createHeadingComponent(5);\nexport const H6 = createHeadingComponent(6);\n\n// Default web styles: http://trac.webkit.org/browser/trunk/Source/WebCore/css/html.css\nconst styles = StyleSheet.create({\n h1: {\n // @ts-ignore\n fontSize: em(2),\n // @ts-ignore\n marginVertical: em(0.67),\n fontWeight: 'bold',\n },\n h2: {\n // @ts-ignore\n fontSize: em(1.5),\n // @ts-ignore\n marginVertical: em(0.83),\n fontWeight: 'bold',\n },\n h3: {\n // @ts-ignore\n fontSize: em(1.17),\n // @ts-ignore\n marginVertical: em(1),\n fontWeight: 'bold',\n },\n h4: {\n // @ts-ignore\n fontSize: em(1),\n // @ts-ignore\n marginVertical: em(1.33),\n fontWeight: 'bold',\n },\n h5: {\n // @ts-ignore\n fontSize: em(0.83),\n // @ts-ignore\n marginVertical: em(1.67),\n fontWeight: 'bold',\n },\n h6: {\n // @ts-ignore\n fontSize: em(0.67),\n // @ts-ignore\n marginVertical: em(2.33),\n fontWeight: 'bold',\n },\n});\n"]}
@@ -3,7 +3,7 @@ import { Platform } from 'react-native';
3
3
  import View from '../primitives/View';
4
4
  function createView(nativeProps = {}) {
5
5
  return forwardRef((props, ref) => {
6
- return React.createElement(View, { ...nativeProps, ...props, ref: ref });
6
+ return <View {...nativeProps} {...props} ref={ref}/>;
7
7
  });
8
8
  }
9
9
  export const Div = createView();
@@ -1 +1 @@
1
- {"version":3,"file":"Layout.js","sourceRoot":"","sources":["../../src/elements/Layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,UAAU,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,IAAmB,MAAM,oBAAoB,CAAC;AAErD,SAAS,UAAU,CAAC,cAAyB,EAAE;IAC7C,OAAO,UAAU,CAAC,CAAC,KAAgB,EAAE,GAAG,EAAE,EAAE;QAC1C,OAAO,oBAAC,IAAI,OAAK,WAAW,KAAM,KAAK,EAAE,GAAG,EAAE,GAAG,GAAI,CAAC;IACxD,CAAC,CAA6B,CAAC;AACjC,CAAC;AAED,MAAM,CAAC,MAAM,GAAG,GAAG,UAAU,EAAE,CAAC;AAEhC,MAAM,CAAC,MAAM,GAAG,GAAG,UAAU,CAC3B,QAAQ,CAAC,MAAM,CAAC;IACd,GAAG,EAAE;QACH,iBAAiB,EAAE,YAAY;KAChC;CACF,CAAC,CACH,CAAC;AACF,MAAM,CAAC,MAAM,MAAM,GAAG,UAAU,CAC9B,QAAQ,CAAC,MAAM,CAAC;IACd,GAAG,EAAE;QACH,iBAAiB,EAAE,aAAa;KACjC;CACF,CAAC,CACH,CAAC;AACF,MAAM,CAAC,MAAM,KAAK,GAAG,UAAU,CAC7B,QAAQ,CAAC,MAAM,CAAC;IACd,GAAG,EAAE;QACH,iBAAiB,EAAE,eAAe;KACnC;CACF,CAAC,CACH,CAAC;AACF,MAAM,CAAC,MAAM,MAAM,GAAG,UAAU,CAC9B,QAAQ,CAAC,MAAM,CAAC;IACd,GAAG,EAAE;QACH,iBAAiB,EAAE,QAAQ;KAC5B;IACD,OAAO,EAAE;QACP,iBAAiB,EAAE,QAAQ;KAC5B;CACF,CAAC,CACH,CAAC;AACF,MAAM,CAAC,MAAM,IAAI,GAAG,UAAU,CAC5B,QAAQ,CAAC,MAAM,CAAC;IACd,GAAG,EAAE;QACH,iBAAiB,EAAE,MAAM;KAC1B;CACF,CAAC,CACH,CAAC;AACF,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAC/B,QAAQ,CAAC,MAAM,CAAC;IACd,GAAG,EAAE;QACH,iBAAiB,EAAE,SAAS;KAC7B;CACF,CAAC,CACH,CAAC;AACF,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAAC;IAChC,iBAAiB,EAAE,SAAS,EAAE,UAAU;CACzC,CAAC,CAAC","sourcesContent":["import React, { ComponentType, forwardRef } from 'react';\nimport { Platform } from 'react-native';\n\nimport View, { ViewProps } from '../primitives/View';\n\nfunction createView(nativeProps: ViewProps = {}): ComponentType<ViewProps> {\n return forwardRef((props: ViewProps, ref) => {\n return <View {...nativeProps} {...props} ref={ref} />;\n }) as ComponentType<ViewProps>;\n}\n\nexport const Div = createView();\n\nexport const Nav = createView(\n Platform.select({\n web: {\n accessibilityRole: 'navigation',\n },\n })\n);\nexport const Footer = createView(\n Platform.select({\n web: {\n accessibilityRole: 'contentinfo',\n },\n })\n);\nexport const Aside = createView(\n Platform.select({\n web: {\n accessibilityRole: 'complementary',\n },\n })\n);\nexport const Header = createView(\n Platform.select({\n web: {\n accessibilityRole: 'banner',\n },\n default: {\n accessibilityRole: 'header',\n },\n })\n);\nexport const Main = createView(\n Platform.select({\n web: {\n accessibilityRole: 'main',\n },\n })\n);\nexport const Article = createView(\n Platform.select({\n web: {\n accessibilityRole: 'article',\n },\n })\n);\nexport const Section = createView({\n accessibilityRole: 'summary', // region?\n});\n"]}
1
+ {"version":3,"file":"Layout.js","sourceRoot":"","sources":["../../src/elements/Layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,UAAU,EAAE,MAAM,OAAO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Q,CAAC,MAAM,CAAC;IACd,GAAG,EAAE;QACH,iBAAiB,EAAE,SAAS;KAC7B;CACF,CAAC,CACH,CAAC;AACF,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAAC;IAChC,iBAAiB,EAAE,SAAS,EAAE,UAAU;CACzC,CAAC,CAAC","sourcesContent":["import React, { ComponentType, forwardRef } from 'react';\nimport { Platform } from 'react-native';\n\nimport View, { ViewProps } from '../primitives/View';\n\nfunction createView(nativeProps: ViewProps = {}): ComponentType<ViewProps> {\n return forwardRef((props: ViewProps, ref) => {\n return <View {...nativeProps} {...props} ref={ref} />;\n }) as ComponentType<ViewProps>;\n}\n\nexport const Div = createView();\n\nexport const Nav = createView(\n Platform.select({\n web: {\n accessibilityRole: 'navigation',\n },\n })\n);\nexport const Footer = createView(\n Platform.select({\n web: {\n accessibilityRole: 'contentinfo',\n },\n })\n);\nexport const Aside = createView(\n Platform.select({\n web: {\n accessibilityRole: 'complementary',\n },\n })\n);\nexport const Header = createView(\n Platform.select({\n web: {\n accessibilityRole: 'banner',\n },\n default: {\n accessibilityRole: 'header',\n },\n })\n);\nexport const Main = createView(\n Platform.select({\n web: {\n accessibilityRole: 'main',\n },\n })\n);\nexport const Article = createView(\n Platform.select({\n web: {\n accessibilityRole: 'article',\n },\n })\n);\nexport const Section = createView({\n accessibilityRole: 'summary', // region?\n});\n"]}
@@ -4,7 +4,7 @@ import Text from '../primitives/Text';
4
4
  import View from '../primitives/View';
5
5
  function createView(nativeProps = {}) {
6
6
  return forwardRef((props, ref) => {
7
- return React.createElement(View, { ...nativeProps, ...props, ref: ref });
7
+ return <View {...nativeProps} {...props} ref={ref}/>;
8
8
  });
9
9
  }
10
10
  export const UL = createView(Platform.select({
@@ -22,12 +22,12 @@ export const LI = forwardRef((props, ref) => {
22
22
  web: 'listitem',
23
23
  default: props.accessibilityRole,
24
24
  });
25
- return React.createElement(Text, { ...props, accessibilityRole: accessibilityRole, ref: ref });
25
+ return <Text {...props} accessibilityRole={accessibilityRole} ref={ref}/>;
26
26
  }
27
27
  const accessibilityRole = Platform.select({
28
28
  web: 'listitem',
29
29
  default: props.accessibilityRole,
30
30
  });
31
- return React.createElement(View, { ...props, accessibilityRole: accessibilityRole, ref: ref });
31
+ return <View {...props} accessibilityRole={accessibilityRole} ref={ref}/>;
32
32
  });
33
33
  //# sourceMappingURL=Lists.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Lists.js","sourceRoot":"","sources":["../../src/elements/Lists.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,UAAU,EAAqB,MAAM,OAAO,CAAC;AAC5E,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,IAAmB,MAAM,oBAAoB,CAAC;AACrD,OAAO,IAAmB,MAAM,oBAAoB,CAAC;AAErD,SAAS,UAAU,CAAC,cAAyB,EAAE;IAC7C,OAAO,UAAU,CAAC,CAAC,KAAgB,EAAE,GAAG,EAAE,EAAE;QAC1C,OAAO,oBAAC,IAAI,OAAK,WAAW,KAAM,KAAK,EAAE,GAAG,EAAE,GAAG,GAAI,CAAC;IACxD,CAAC,CAA6B,CAAC;AACjC,CAAC;AAED,MAAM,CAAC,MAAM,EAAE,GAAG,UAAU,CAC1B,QAAQ,CAAC,MAAM,CAAC;IACd,GAAG,EAAE;QACH,iBAAiB,EAAE,MAAM;KAC1B;CACF,CAAC,CACH,CAAC;AAEF,SAAS,WAAW,CAAC,KAAU;IAC7B,qCAAqC;IACrC,OAAO,OAAO,KAAK,CAAC,QAAQ,KAAK,QAAQ,CAAC;AAC5C,CAAC;AAID,MAAM,CAAC,MAAM,EAAE,GAAG,UAAU,CAAC,CAAC,KAAiC,EAAE,GAAQ,EAAE,EAAE;IAC3E,IAAI,WAAW,CAAC,KAAK,CAAC,EAAE;QACtB,MAAM,iBAAiB,GAAiC,QAAQ,CAAC,MAAM,CAAC;YACtE,GAAG,EAAE,UAAU;YACf,OAAO,EAAE,KAAK,CAAC,iBAAiB;SACjC,CAAC,CAAC;QACH,OAAO,oBAAC,IAAI,OAAK,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,GAAG,EAAE,GAAG,GAAI,CAAC;KAC5E;IACD,MAAM,iBAAiB,GAAiC,QAAQ,CAAC,MAAM,CAAC;QACtE,GAAG,EAAE,UAAU;QACf,OAAO,EAAE,KAAK,CAAC,iBAAiB;KACjC,CAAC,CAAC;IACH,OAAO,oBAAC,IAAI,OAAK,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,GAAG,EAAE,GAAG,GAAI,CAAC;AAC7E,CAAC,CAA2B,CAAC","sourcesContent":["import React, { ComponentType, forwardRef, PropsWithChildren } from 'react';\nimport { Platform } from 'react-native';\n\nimport Text, { TextProps } from '../primitives/Text';\nimport View, { ViewProps } from '../primitives/View';\n\nfunction createView(nativeProps: ViewProps = {}): ComponentType<ViewProps> {\n return forwardRef((props: ViewProps, ref) => {\n return <View {...nativeProps} {...props} ref={ref} />;\n }) as ComponentType<ViewProps>;\n}\n\nexport const UL = createView(\n Platform.select({\n web: {\n accessibilityRole: 'list',\n },\n })\n);\n\nfunction isTextProps(props: any): props is TextProps {\n // Treat <li></li> as a Text element.\n return typeof props.children === 'string';\n}\n\ntype LIProps = TextProps | ViewProps;\n\nexport const LI = forwardRef((props: PropsWithChildren<LIProps>, ref: any) => {\n if (isTextProps(props)) {\n const accessibilityRole: LIProps['accessibilityRole'] = Platform.select({\n web: 'listitem',\n default: props.accessibilityRole,\n });\n return <Text {...props} accessibilityRole={accessibilityRole} ref={ref} />;\n }\n const accessibilityRole: LIProps['accessibilityRole'] = Platform.select({\n web: 'listitem',\n default: props.accessibilityRole,\n });\n return <View {...props} accessibilityRole={accessibilityRole} ref={ref} />;\n}) as ComponentType<LIProps>;\n"]}
1
+ {"version":3,"file":"Lists.js","sourceRoot":"","sources":["../../src/elements/Lists.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,UAAU,EAAqB,MA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I,KAAK,CAAC,CAAC,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAG,CAAC;AAC7E,CAAC,CAA2B,CAAC","sourcesContent":["import React, { ComponentType, forwardRef, PropsWithChildren } from 'react';\nimport { Platform } from 'react-native';\n\nimport Text, { TextProps } from '../primitives/Text';\nimport View, { ViewProps } from '../primitives/View';\n\nfunction createView(nativeProps: ViewProps = {}): ComponentType<ViewProps> {\n return forwardRef((props: ViewProps, ref) => {\n return <View {...nativeProps} {...props} ref={ref} />;\n }) as ComponentType<ViewProps>;\n}\n\nexport const UL = createView(\n Platform.select({\n web: {\n accessibilityRole: 'list',\n },\n })\n);\n\nfunction isTextProps(props: any): props is TextProps {\n // Treat <li></li> as a Text element.\n return typeof props.children === 'string';\n}\n\ntype LIProps = TextProps | ViewProps;\n\nexport const LI = forwardRef((props: PropsWithChildren<LIProps>, ref: any) => {\n if (isTextProps(props)) {\n const accessibilityRole: LIProps['accessibilityRole'] = Platform.select({\n web: 'listitem',\n default: props.accessibilityRole,\n });\n return <Text {...props} accessibilityRole={accessibilityRole} ref={ref} />;\n }\n const accessibilityRole: LIProps['accessibilityRole'] = Platform.select({\n web: 'listitem',\n default: props.accessibilityRole,\n });\n return <View {...props} accessibilityRole={accessibilityRole} ref={ref} />;\n}) as ComponentType<LIProps>;\n"]}
@@ -2,7 +2,7 @@ import React, { forwardRef } from 'react';
2
2
  import { StyleSheet } from 'react-native';
3
3
  import View from '../primitives/View';
4
4
  export const HR = forwardRef((props, ref) => {
5
- return React.createElement(View, { ...props, style: [styles.hr, props.style], ref: ref });
5
+ return <View {...props} style={[styles.hr, props.style]} ref={ref}/>;
6
6
  });
7
7
  const styles = StyleSheet.create({
8
8
  hr: {
@@ -1 +1 @@
1
- {"version":3,"file":"Rules.js","sourceRoot":"","sources":["../../src/elements/Rules.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,UAAU,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,IAAmB,MAAM,oBAAoB,CAAC;AAErD,MAAM,CAAC,MAAM,EAAE,GAAG,UAAU,CAAC,CAAC,KAAgB,EAAE,GAAG,EAAE,EAAE;IACrD,OAAO,oBAAC,IAAI,OAAK,KAAK,EAAE,KAAK,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,GAAG,GAAI,CAAC;AACxE,CAAC,CAA6B,CAAC;AAE/B,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,EAAE,EAAE;QACF,cAAc,EAAE,UAAU,CAAC,aAAa;QACxC,iBAAiB,EAAE,UAAU,CAAC,aAAa;QAC3C,cAAc,EAAE,SAAS;QACzB,iBAAiB,EAAE,SAAS;QAC5B,cAAc,EAAE,CAAC;KAClB;CACF,CAAC,CAAC","sourcesContent":["import React, { ComponentType, forwardRef } from 'react';\nimport { StyleSheet } from 'react-native';\n\nimport View, { ViewProps } from '../primitives/View';\n\nexport const HR = forwardRef((props: ViewProps, ref) => {\n return <View {...props} style={[styles.hr, props.style]} ref={ref} />;\n}) as ComponentType<ViewProps>;\n\nconst styles = StyleSheet.create({\n hr: {\n borderTopWidth: StyleSheet.hairlineWidth,\n borderBottomWidth: StyleSheet.hairlineWidth,\n borderTopColor: '#9A9A9A',\n borderBottomColor: '#EEEEEE',\n marginVertical: 8,\n },\n});\n"]}
1
+ {"version":3,"file":"Rules.js","sourceRoot":"","sources":["../../src/elements/Rules.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,UAAU,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,IAAmB,MAAM,oBAAoB,CAAC;AAErD,MAAM,CAAC,MAAM,EAAE,GAAG,UAAU,CAAC,CAAC,KAAgB,EAAE,GAAG,EAAE,EAAE;IACrD,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAG,CAAC;AACxE,CAAC,CAA6B,CAAC;AAE/B,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,EAAE,EAAE;QACF,cAAc,EAAE,UAAU,CAAC,aAAa;QACxC,iBAAiB,EAAE,UAAU,CAAC,aAAa;QAC3C,cAAc,EAAE,SAAS;QACzB,iBAAiB,EAAE,SAAS;QAC5B,cAAc,EAAE,CAAC;KAClB;CACF,CAAC,CAAC","sourcesContent":["import React, { ComponentType, forwardRef } from 'react';\nimport { StyleSheet } from 'react-native';\n\nimport View, { ViewProps } from '../primitives/View';\n\nexport const HR = forwardRef((props: ViewProps, ref) => {\n return <View {...props} style={[styles.hr, props.style]} ref={ref} />;\n}) as ComponentType<ViewProps>;\n\nconst styles = StyleSheet.create({\n hr: {\n borderTopWidth: StyleSheet.hairlineWidth,\n borderBottomWidth: StyleSheet.hairlineWidth,\n borderTopColor: '#9A9A9A',\n borderBottomColor: '#EEEEEE',\n marginVertical: 8,\n },\n});\n"]}
@@ -5,28 +5,28 @@ import { TableText } from '../primitives/Table';
5
5
  import Text from '../primitives/Text';
6
6
  import View from '../primitives/View';
7
7
  export const Table = forwardRef((props, ref) => {
8
- return React.createElement(View, { ...props, ref: ref });
8
+ return <View {...props} ref={ref}/>;
9
9
  });
10
10
  export const THead = forwardRef((props, ref) => {
11
- return React.createElement(View, { ...props, ref: ref });
11
+ return <View {...props} ref={ref}/>;
12
12
  });
13
13
  export const TBody = forwardRef((props, ref) => {
14
- return React.createElement(View, { ...props, ref: ref });
14
+ return <View {...props} ref={ref}/>;
15
15
  });
16
16
  export const TFoot = forwardRef((props, ref) => {
17
- return React.createElement(View, { ...props, ref: ref });
17
+ return <View {...props} ref={ref}/>;
18
18
  });
19
19
  export const TH = forwardRef((props, ref) => {
20
- return React.createElement(TableText, { ...props, style: [styles.th, props.style], ref: ref });
20
+ return <TableText {...props} style={[styles.th, props.style]} ref={ref}/>;
21
21
  });
22
22
  export const TR = forwardRef((props, ref) => {
23
- return React.createElement(View, { ...props, style: [styles.tr, props.style], ref: ref });
23
+ return <View {...props} style={[styles.tr, props.style]} ref={ref}/>;
24
24
  });
25
25
  export const TD = forwardRef((props, ref) => {
26
- return React.createElement(TableText, { ...props, style: [styles.td, props.style], ref: ref });
26
+ return <TableText {...props} style={[styles.td, props.style]} ref={ref}/>;
27
27
  });
28
28
  export const Caption = forwardRef((props, ref) => {
29
- return React.createElement(Text, { ...props, style: [styles.caption, props.style], ref: ref });
29
+ return <Text {...props} style={[styles.caption, props.style]} ref={ref}/>;
30
30
  });
31
31
  const styles = StyleSheet.create({
32
32
  caption: {
@@ -1 +1 @@
1
- {"version":3,"file":"Table.js","sourceRoot":"","sources":["../../src/elements/Table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,UAAU,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,SAAS,EAAkB,MAAM,qBAAqB,CAAC;AAChE,OAAO,IAAmB,MAAM,oBAAoB,CAAC;AACrD,OAAO,IAAmB,MAAM,oBAAoB,CAAC;AAErD,MAAM,CAAC,MAAM,KAAK,GAAG,UAAU,CAAC,CAAC,KAAgB,EAAE,GAAG,EAAE,EAAE;IACxD,OAAO,oBAAC,IAAI,OAAK,KAAK,EAAE,GAAG,EAAE,GAAG,GAAI,CAAC;AACvC,CAAC,CAA6B,CAAC;AAE/B,MAAM,CAAC,MAAM,KAAK,GAAG,UAAU,CAAC,CAAC,KAAgB,EAAE,GAAG,EAAE,EAAE;IACxD,OAAO,oBAAC,I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pC,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAAC,CAAC,KAAgB,EAAE,GAAQ,EAAE,EAAE;IAC/D,OAAO,oBAAC,IAAI,OAAK,KAAK,EAAE,KAAK,EAAE,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,GAAG,GAAI,CAAC;AAC7E,CAAC,CAA6B,CAAC;AAE/B,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,OAAO,EAAE;QACP,SAAS,EAAE,QAAQ;QACnB,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAW;KAC1B;IACD,EAAE,EAAE;QACF,SAAS,EAAE,QAAQ;QACnB,UAAU,EAAE,MAAM;QAClB,IAAI,EAAE,CAAC;QACP,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAW;KAC1B;IACD,EAAE,EAAE;QACF,aAAa,EAAE,KAAK;KACrB;IACD,EAAE,EAAE;QACF,IAAI,EAAE,CAAC;QACP,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAW;KAC1B;CACF,CAAC,CAAC","sourcesContent":["import React, { ComponentType, forwardRef } from 'react';\nimport { StyleSheet } from 'react-native';\n\nimport { em } from '../css/units';\nimport { TableText, TableTextProps } from '../primitives/Table';\nimport Text, { TextProps } from '../primitives/Text';\nimport View, { ViewProps } from '../primitives/View';\n\nexport const Table = forwardRef((props: ViewProps, ref) => {\n return <View {...props} ref={ref} />;\n}) as ComponentType<ViewProps>;\n\nexport const THead = forwardRef((props: ViewProps, ref) => {\n return <View {...props} ref={ref} />;\n}) as ComponentType<ViewProps>;\n\nexport const TBody = forwardRef((props: ViewProps, ref) => {\n return <View {...props} ref={ref} />;\n}) as ComponentType<ViewProps>;\n\nexport const TFoot = forwardRef((props: ViewProps, ref) => {\n return <View {...props} ref={ref} />;\n}) as ComponentType<ViewProps>;\n\nexport const TH = forwardRef((props: TableTextProps, ref: any) => {\n return <TableText {...props} style={[styles.th, props.style]} ref={ref} />;\n}) as ComponentType<TableTextProps>;\n\nexport const TR = forwardRef((props: ViewProps, ref) => {\n return <View {...props} style={[styles.tr, props.style]} ref={ref} />;\n}) as ComponentType<ViewProps>;\n\nexport const TD = forwardRef((props: TableTextProps, ref: any) => {\n return <TableText {...props} style={[styles.td, props.style]} ref={ref} />;\n}) as ComponentType<TableTextProps>;\n\nexport const Caption = forwardRef((props: TextProps, ref: any) => {\n return <Text {...props} style={[styles.caption, props.style]} ref={ref} />;\n}) as ComponentType<TextProps>;\n\nconst styles = StyleSheet.create({\n caption: {\n textAlign: 'center',\n fontSize: em(1) as number,\n },\n th: {\n textAlign: 'center',\n fontWeight: 'bold',\n flex: 1,\n fontSize: em(1) as number,\n },\n tr: {\n flexDirection: 'row',\n },\n td: {\n flex: 1,\n fontSize: em(1) as number,\n },\n});\n"]}
1
+ {"version":3,"file":"Table.js","sourceRoot":"","sources":["../../src/elements/Table.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,UAAU,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,SAAS,EAAkB,MAAM,qBAAqB,CAAC;AAChE,OAAO,IAAmB,MAAM,oBAAoB,CAAC;AACrD,OAAO,IAAmB,MAAM,oBAAoB,CAAC;AAErD,MAAM,CAAC,MAAM,KAAK,GAAG,UAAU,CAAC,CAAC,KAAgB,EAAE,GAAG,EAAE,EAAE;IACxD,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAG,CAAC;AACvC,CAAC,CAA6B,CAAC;AAE/B,MAAM,CAAC,MAAM,KAAK,GAAG,UAAU,CAAC,CAAC,KAAgB,EAAE,GAAG,EAAE,EAAE;IACxD,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,GA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AAC,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAG,CAAC;AAC7E,CAAC,CAAkC,CAAC;AAEpC,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAAC,CAAC,KAAgB,EAAE,GAAQ,EAAE,EAAE;IAC/D,OAAO,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAG,CAAC;AAC7E,CAAC,CAA6B,CAAC;AAE/B,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,OAAO,EAAE;QACP,SAAS,EAAE,QAAQ;QACnB,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAW;KAC1B;IACD,EAAE,EAAE;QACF,SAAS,EAAE,QAAQ;QACnB,UAAU,EAAE,MAAM;QAClB,IAAI,EAAE,CAAC;QACP,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAW;KAC1B;IACD,EAAE,EAAE;QACF,aAAa,EAAE,KAAK;KACrB;IACD,EAAE,EAAE;QACF,IAAI,EAAE,CAAC;QACP,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAW;KAC1B;CACF,CAAC,CAAC","sourcesContent":["import React, { ComponentType, forwardRef } from 'react';\nimport { StyleSheet } from 'react-native';\n\nimport { em } from '../css/units';\nimport { TableText, TableTextProps } from '../primitives/Table';\nimport Text, { TextProps } from '../primitives/Text';\nimport View, { ViewProps } from '../primitives/View';\n\nexport const Table = forwardRef((props: ViewProps, ref) => {\n return <View {...props} ref={ref} />;\n}) as ComponentType<ViewProps>;\n\nexport const THead = forwardRef((props: ViewProps, ref) => {\n return <View {...props} ref={ref} />;\n}) as ComponentType<ViewProps>;\n\nexport const TBody = forwardRef((props: ViewProps, ref) => {\n return <View {...props} ref={ref} />;\n}) as ComponentType<ViewProps>;\n\nexport const TFoot = forwardRef((props: ViewProps, ref) => {\n return <View {...props} ref={ref} />;\n}) as ComponentType<ViewProps>;\n\nexport const TH = forwardRef((props: TableTextProps, ref: any) => {\n return <TableText {...props} style={[styles.th, props.style]} ref={ref} />;\n}) as ComponentType<TableTextProps>;\n\nexport const TR = forwardRef((props: ViewProps, ref) => {\n return <View {...props} style={[styles.tr, props.style]} ref={ref} />;\n}) as ComponentType<ViewProps>;\n\nexport const TD = forwardRef((props: TableTextProps, ref: any) => {\n return <TableText {...props} style={[styles.td, props.style]} ref={ref} />;\n}) as ComponentType<TableTextProps>;\n\nexport const Caption = forwardRef((props: TextProps, ref: any) => {\n return <Text {...props} style={[styles.caption, props.style]} ref={ref} />;\n}) as ComponentType<TextProps>;\n\nconst styles = StyleSheet.create({\n caption: {\n textAlign: 'center',\n fontSize: em(1) as number,\n },\n th: {\n textAlign: 'center',\n fontWeight: 'bold',\n flex: 1,\n fontSize: em(1) as number,\n },\n tr: {\n flexDirection: 'row',\n },\n td: {\n flex: 1,\n fontSize: em(1) as number,\n },\n});\n"]}
@@ -2,7 +2,7 @@ import React, { forwardRef } from 'react';
2
2
  import View from '../primitives/RNWView';
3
3
  function createView(nativeProps) {
4
4
  return forwardRef((props, ref) => {
5
- return React.createElement(View, { ...nativeProps, ...props, ref: ref });
5
+ return <View {...nativeProps} {...props} ref={ref}/>;
6
6
  });
7
7
  }
8
8
  export const Table = createView({ __element: 'table' });
@@ -1 +1 @@
1
- {"version":3,"file":"Table.web.js","sourceRoot":"","sources":["../../src/elements/Table.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,UAAU,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,IAAI,MAAM,uBAAuB,CAAC;AAGzC,SAAS,UAAU,CAAC,WAA8C;IAChE,OAAO,UAAU,CAAC,CAAC,KAAgB,EAAE,GAAG,EAAE,EAAE;QAC1C,OAAO,oBAAC,IAAI,OAA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from '../primitives/View';\n\nfunction createView(nativeProps: ViewProps & { __element: string }): ComponentType<ViewProps> {\n return forwardRef((props: ViewProps, ref) => {\n return <View {...nativeProps} {...props} ref={ref} />;\n }) as ComponentType<ViewProps>;\n}\n\nexport const Table = createView({ __element: 'table' });\nTable.displayName = 'Table';\n\nexport const THead = createView({ __element: 'thead' });\nTHead.displayName = 'THead';\n\nexport const TBody = createView({ __element: 'tbody' });\nTBody.displayName = 'TBody';\n\nexport const TFoot = createView({ __element: 'tfoot' });\nTFoot.displayName = 'TFoot';\n\nexport const TH = createView({ __element: 'th' });\nTH.displayName = 'TH';\n\nexport const TR = createView({ __element: 'tr' });\nTR.displayName = 'TR';\n\nexport const TD = createView({ __element: 'td' });\nTD.displayName = 'TD';\n\nexport const Caption = createView({ __element: 'caption' });\nCaption.displayName = 'Caption';\n"]}
1
+ {"version":3,"file":"Table.web.js","sourceRoot":"","sources":["../../src/elements/Table.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,UAAU,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,IAAI,MAAM,uBAAuB,CAAC;AAGzC,SAAS,UAAU,CAAC,WAA8C;IAChE,OAAO,UAAU,CAAC,CAAC,KAAgB,EAAE,GAAG,EAAE,EAAE;QAC1C,OAAO,CAAC,IAAI,CAAC,IAAI,WAAW,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,EAAG,CAAC;IACxD,CAAC,CAA6B,CAAC;AACjC,CAAC;AAED,MAAM,CAAC,MAAM,KAAK,GAAG,UAAU,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC;AACxD,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC;AAE5B,MAAM,CAAC,MAAM,KAAK,GAAG,UAAU,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC;AACxD,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC;AAE5B,MAAM,CAAC,MAAM,KAAK,GAAG,UAAU,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC;AACxD,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC;AAE5B,MAAM,CAAC,MAAM,KAAK,GAAG,UAAU,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC;AACxD,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC;AAE5B,MAAM,CAAC,MAAM,EAAE,GAAG,UAAU,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAClD,EAAE,CAAC,WAAW,GAAG,IAAI,CAAC;AAEtB,MAAM,CAAC,MAAM,EAAE,GAAG,UAAU,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAClD,EAAE,CAAC,WAAW,GAAG,IAAI,CAAC;AAEtB,MAAM,CAAC,MAAM,EAAE,GAAG,UAAU,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAClD,EAAE,CAAC,WAAW,GAAG,IAAI,CAAC;AAEtB,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC;AAC5D,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC","sourcesContent":["import React, { ComponentType, forwardRef } from 'react';\n\nimport View from '../primitives/RNWView';\nimport { ViewProps } from '../primitives/View';\n\nfunction createView(nativeProps: ViewProps & { __element: string }): ComponentType<ViewProps> {\n return forwardRef((props: ViewProps, ref) => {\n return <View {...nativeProps} {...props} ref={ref} />;\n }) as ComponentType<ViewProps>;\n}\n\nexport const Table = createView({ __element: 'table' });\nTable.displayName = 'Table';\n\nexport const THead = createView({ __element: 'thead' });\nTHead.displayName = 'THead';\n\nexport const TBody = createView({ __element: 'tbody' });\nTBody.displayName = 'TBody';\n\nexport const TFoot = createView({ __element: 'tfoot' });\nTFoot.displayName = 'TFoot';\n\nexport const TH = createView({ __element: 'th' });\nTH.displayName = 'TH';\n\nexport const TR = createView({ __element: 'tr' });\nTR.displayName = 'TR';\n\nexport const TD = createView({ __element: 'td' });\nTD.displayName = 'TD';\n\nexport const Caption = createView({ __element: 'caption' });\nCaption.displayName = 'Caption';\n"]}
@@ -4,47 +4,46 @@ import { em } from '../css/units';
4
4
  import Text from '../primitives/Text';
5
5
  import View from '../primitives/View';
6
6
  export const P = forwardRef(({ style, ...props }, ref) => {
7
- return React.createElement(Text, { ...props, style: [styles.p, style], ref: ref });
7
+ return <Text {...props} style={[styles.p, style]} ref={ref}/>;
8
8
  });
9
9
  export const B = forwardRef(({ style, ...props }, ref) => {
10
- return React.createElement(Text, { ...props, style: [styles.b, style], ref: ref });
10
+ return <Text {...props} style={[styles.b, style]} ref={ref}/>;
11
11
  });
12
12
  export const S = forwardRef(({ style, ...props }, ref) => {
13
- return React.createElement(Text, { ...props, style: [styles.s, style], ref: ref });
13
+ return <Text {...props} style={[styles.s, style]} ref={ref}/>;
14
14
  });
15
15
  export const I = forwardRef(({ style, ...props }, ref) => {
16
- return React.createElement(Text, { ...props, style: [styles.i, style], ref: ref });
16
+ return <Text {...props} style={[styles.i, style]} ref={ref}/>;
17
17
  });
18
18
  export const Q = forwardRef(({ children, cite, style, ...props }, ref) => {
19
- return (React.createElement(Text, { ...props, style: [styles.q, style], ref: ref },
20
- "\"",
21
- children,
22
- "\""));
19
+ return (<Text {...props} style={[styles.q, style]} ref={ref}>
20
+ "{children}"
21
+ </Text>);
23
22
  });
24
23
  export const BlockQuote = forwardRef(({ style, cite, ...props }, ref) => {
25
- return React.createElement(View, { ...props, style: [styles.blockQuote, style], ref: ref });
24
+ return <View {...props} style={[styles.blockQuote, style]} ref={ref}/>;
26
25
  });
27
26
  export const BR = forwardRef(({ style, ...props }, ref) => {
28
- return React.createElement(Text, { ...props, style: [styles.br, style], ref: ref });
27
+ return <Text {...props} style={[styles.br, style]} ref={ref}/>;
29
28
  });
30
29
  export const Mark = forwardRef(({ style, ...props }, ref) => {
31
- return React.createElement(Text, { ...props, style: [styles.mark, style], ref: ref });
30
+ return <Text {...props} style={[styles.mark, style]} ref={ref}/>;
32
31
  });
33
32
  export const Code = forwardRef(({ style, ...props }, ref) => {
34
- return React.createElement(Text, { ...props, style: [styles.code, style], ref: ref });
33
+ return <Text {...props} style={[styles.code, style]} ref={ref}/>;
35
34
  });
36
35
  function isTextProps(props) {
37
36
  return typeof props.children === 'string';
38
37
  }
39
38
  export const Pre = forwardRef((props, ref) => {
40
39
  if (isTextProps(props)) {
41
- return React.createElement(Text, { ...props, style: [styles.code, styles.pre, props.style], ref: ref });
40
+ return <Text {...props} style={[styles.code, styles.pre, props.style]} ref={ref}/>;
42
41
  }
43
- return React.createElement(View, { ...props, style: [styles.pre, props.style], ref: ref });
42
+ return <View {...props} style={[styles.pre, props.style]} ref={ref}/>;
44
43
  });
45
44
  // Extract dateTime to prevent passing it to the native Text element
46
45
  export const Time = forwardRef(({ dateTime, ...props }, ref) => {
47
- return React.createElement(Text, { ...props, ref: ref });
46
+ return <Text {...props} ref={ref}/>;
48
47
  });
49
48
  export const Strong = B;
50
49
  export const Del = S;
@@ -1 +1 @@
1
- {"version":3,"file":"Text.js","sourceRoot":"","sources":["../../src/elements/Text.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAiB,UAAU,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGpD,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,IAAmB,MAAM,oBAAoB,CAAC;AACrD,OAAO,IAAmB,MAAM,oBAAoB,CAAC;AAErD,MAAM,CAAC,MAAM,CAAC,GAAG,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAAa,EAAE,GAAG,EAAE,EAAE;IAClE,OAAO,oBAAC,IAAI,OAAK,KAAK,EAAE,KAAK,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC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AAE,KAAK;KAClB;IACD,GAAG,EAAE;QACH,aAAa;QACb,cAAc,EAAE,EAAE,CAAC,CAAC,CAAC;KACtB;IACD,UAAU,EAAE;QACV,aAAa;QACb,cAAc,EAAE,EAAE,CAAC,CAAC,CAAC;KACtB;IACD,EAAE,EAAE;QACF,KAAK,EAAE,CAAC;QACR,aAAa;QACb,MAAM,EAAE,EAAE,CAAC,GAAG,CAAC;KAChB;IACD,CAAC,EAAE;QACD,kBAAkB,EAAE,cAAc;QAClC,mBAAmB,EAAE,OAAO;KAC7B;IACD,IAAI,EAAE;QACJ,eAAe,EAAE,QAAQ;QACzB,KAAK,EAAE,OAAO;KACf;IACD,CAAC,EAAE;QACD,SAAS,EAAE,QAAQ;KACpB;CACF,CAAC,CAAC","sourcesContent":["import React, { ComponentType, forwardRef } from 'react';\nimport { StyleSheet, Platform } from 'react-native';\n\nimport { BlockQuoteProps, QuoteProps, TimeProps } from './Text.types';\nimport { em } from '../css/units';\nimport Text, { TextProps } from '../primitives/Text';\nimport View, { ViewProps } from '../primitives/View';\n\nexport const P = forwardRef(({ style, ...props }: TextProps, ref) => {\n return <Text {...props} style={[styles.p, style]} ref={ref} />;\n}) as ComponentType<TextProps>;\n\nexport const B = forwardRef(({ style, ...props }: TextProps, ref) => {\n return <Text {...props} style={[styles.b, style]} ref={ref} />;\n}) as ComponentType<TextProps>;\n\nexport const S = forwardRef(({ style, ...props }: TextProps, ref) => {\n return <Text {...props} style={[styles.s, style]} ref={ref} />;\n}) as ComponentType<TextProps>;\n\nexport const I = forwardRef(({ style, ...props }: TextProps, ref) => {\n return <Text {...props} style={[styles.i, style]} ref={ref} />;\n}) as ComponentType<TextProps>;\n\nexport const Q = forwardRef(({ children, cite, style, ...props }: QuoteProps, ref) => {\n return (\n <Text {...props} style={[styles.q, style]} ref={ref}>\n \"{children}\"\n </Text>\n );\n}) as ComponentType<QuoteProps>;\n\nexport const BlockQuote = forwardRef(({ style, cite, ...props }: BlockQuoteProps, ref) => {\n return <View {...props} style={[styles.blockQuote, style]} ref={ref} />;\n}) as ComponentType<BlockQuoteProps>;\n\nexport const BR = forwardRef(({ style, ...props }: TextProps, ref) => {\n return <Text {...props} style={[styles.br, style]} ref={ref} />;\n}) as ComponentType<TextProps>;\n\nexport const Mark = forwardRef(({ style, ...props }: TextProps, ref) => {\n return <Text {...props} style={[styles.mark, style]} ref={ref} />;\n}) as ComponentType<TextProps>;\n\nexport const Code = forwardRef(({ style, ...props }: TextProps, ref) => {\n return <Text {...props} style={[styles.code, style]} ref={ref} />;\n}) as ComponentType<TextProps>;\n\nfunction isTextProps(props: any): props is TextProps {\n return typeof props.children === 'string';\n}\n\ntype PreProps = TextProps | ViewProps;\n\nexport const Pre = forwardRef((props: PreProps, ref: any) => {\n if (isTextProps(props)) {\n return <Text {...props} style={[styles.code, styles.pre, props.style]} ref={ref} />;\n }\n return <View {...props} style={[styles.pre, props.style]} ref={ref} />;\n}) as ComponentType<PreProps>;\n\n// Extract dateTime to prevent passing it to the native Text element\nexport const Time = forwardRef(({ dateTime, ...props }: TimeProps, ref) => {\n return <Text {...props} ref={ref} />;\n}) as ComponentType<TimeProps>;\n\nexport const Strong = B;\nexport const Del = S;\nexport const EM = I;\nexport const Span = Text;\n\nconst styles = StyleSheet.create({\n p: {\n // @ts-ignore\n marginVertical: em(1),\n },\n b: {\n fontWeight: 'bold',\n },\n q: {\n fontStyle: 'italic',\n },\n code: {\n fontFamily: Platform.select({ default: 'Courier', ios: 'Courier New', android: 'monospace' }),\n fontWeight: '500',\n },\n pre: {\n // @ts-ignore\n marginVertical: em(1),\n },\n blockQuote: {\n // @ts-ignore\n marginVertical: em(1),\n },\n br: {\n width: 0,\n // @ts-ignore\n height: em(0.5),\n },\n s: {\n textDecorationLine: 'line-through',\n textDecorationStyle: 'solid',\n },\n mark: {\n backgroundColor: 'yellow',\n color: 'black',\n },\n i: {\n fontStyle: 'italic',\n },\n});\n"]}
1
+ {"version":3,"file":"Text.js","sourceRoot":"","sources":["../../src/elements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QAClC,mBAAmB,EAAE,OAAO;KAC7B;IACD,IAAI,EAAE;QACJ,eAAe,EAAE,QAAQ;QACzB,KAAK,EAAE,OAAO;KACf;IACD,CAAC,EAAE;QACD,SAAS,EAAE,QAAQ;KACpB;CACF,CAAC,CAAC","sourcesContent":["import React, { ComponentType, forwardRef } from 'react';\nimport { StyleSheet, Platform } from 'react-native';\n\nimport { BlockQuoteProps, QuoteProps, TimeProps } from './Text.types';\nimport { em } from '../css/units';\nimport Text, { TextProps } from '../primitives/Text';\nimport View, { ViewProps } from '../primitives/View';\n\nexport const P = forwardRef(({ style, ...props }: TextProps, ref) => {\n return <Text {...props} style={[styles.p, style]} ref={ref} />;\n}) as ComponentType<TextProps>;\n\nexport const B = forwardRef(({ style, ...props }: TextProps, ref) => {\n return <Text {...props} style={[styles.b, style]} ref={ref} />;\n}) as ComponentType<TextProps>;\n\nexport const S = forwardRef(({ style, ...props }: TextProps, ref) => {\n return <Text {...props} style={[styles.s, style]} ref={ref} />;\n}) as ComponentType<TextProps>;\n\nexport const I = forwardRef(({ style, ...props }: TextProps, ref) => {\n return <Text {...props} style={[styles.i, style]} ref={ref} />;\n}) as ComponentType<TextProps>;\n\nexport const Q = forwardRef(({ children, cite, style, ...props }: QuoteProps, ref) => {\n return (\n <Text {...props} style={[styles.q, style]} ref={ref}>\n \"{children}\"\n </Text>\n );\n}) as ComponentType<QuoteProps>;\n\nexport const BlockQuote = forwardRef(({ style, cite, ...props }: BlockQuoteProps, ref) => {\n return <View {...props} style={[styles.blockQuote, style]} ref={ref} />;\n}) as ComponentType<BlockQuoteProps>;\n\nexport const BR = forwardRef(({ style, ...props }: TextProps, ref) => {\n return <Text {...props} style={[styles.br, style]} ref={ref} />;\n}) as ComponentType<TextProps>;\n\nexport const Mark = forwardRef(({ style, ...props }: TextProps, ref) => {\n return <Text {...props} style={[styles.mark, style]} ref={ref} />;\n}) as ComponentType<TextProps>;\n\nexport const Code = forwardRef(({ style, ...props }: TextProps, ref) => {\n return <Text {...props} style={[styles.code, style]} ref={ref} />;\n}) as ComponentType<TextProps>;\n\nfunction isTextProps(props: any): props is TextProps {\n return typeof props.children === 'string';\n}\n\ntype PreProps = TextProps | ViewProps;\n\nexport const Pre = forwardRef((props: PreProps, ref: any) => {\n if (isTextProps(props)) {\n return <Text {...props} style={[styles.code, styles.pre, props.style]} ref={ref} />;\n }\n return <View {...props} style={[styles.pre, props.style]} ref={ref} />;\n}) as ComponentType<PreProps>;\n\n// Extract dateTime to prevent passing it to the native Text element\nexport const Time = forwardRef(({ dateTime, ...props }: TimeProps, ref) => {\n return <Text {...props} ref={ref} />;\n}) as ComponentType<TimeProps>;\n\nexport const Strong = B;\nexport const Del = S;\nexport const EM = I;\nexport const Span = Text;\n\nconst styles = StyleSheet.create({\n p: {\n // @ts-ignore\n marginVertical: em(1),\n },\n b: {\n fontWeight: 'bold',\n },\n q: {\n fontStyle: 'italic',\n },\n code: {\n fontFamily: Platform.select({ default: 'Courier', ios: 'Courier New', android: 'monospace' }),\n fontWeight: '500',\n },\n pre: {\n // @ts-ignore\n marginVertical: em(1),\n },\n blockQuote: {\n // @ts-ignore\n marginVertical: em(1),\n },\n br: {\n width: 0,\n // @ts-ignore\n height: em(0.5),\n },\n s: {\n textDecorationLine: 'line-through',\n textDecorationStyle: 'solid',\n },\n mark: {\n backgroundColor: 'yellow',\n color: 'black',\n },\n i: {\n fontStyle: 'italic',\n },\n});\n"]}
@@ -11,10 +11,9 @@ function useChildren(inputChildren) {
11
11
  let message = `Invalid raw text as a child of View: "${child}"${child === '' ? ` [empty string]` : ''}.`;
12
12
  message += ' Wrap the text contents with a Text element or remove it.';
13
13
  console.warn(message);
14
- children.push(React.createElement(Text, { style: [StyleSheet.absoluteFill, styles.error] },
15
- "Unwrapped text: \"",
16
- React.createElement(Text, { style: { fontWeight: 'bold' } }, child),
17
- "\""));
14
+ children.push(<Text style={[StyleSheet.absoluteFill, styles.error]}>
15
+ Unwrapped text: "<Text style={{ fontWeight: 'bold' }}>{child}</Text>"
16
+ </Text>);
18
17
  }
19
18
  else if ('type' in child && typeof child?.type === 'string' && Platform.OS !== 'web') {
20
19
  // Disallow untransformed react-dom elements on native.
@@ -30,7 +29,7 @@ function useChildren(inputChildren) {
30
29
  /** Extend a view with a `children` filter that asserts more helpful warnings/errors. */
31
30
  export function createDevView(View) {
32
31
  return React.forwardRef(({ children, ...props }, forwardedRef) => {
33
- return React.createElement(View, { ref: forwardedRef, ...props, children: useChildren(children) });
32
+ return <View ref={forwardedRef} {...props} children={useChildren(children)}/>;
34
33
  });
35
34
  }
36
35
  const styles = StyleSheet.create({
@@ -1 +1 @@
1
- {"version":3,"file":"createDevView.js","sourceRoot":"","sources":["../../src/primitives/createDevView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAE1D,SAAS,WAAW,CAAC,aAA8B;IACjD,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QACxB,MAAM,QAAQ,GAAsB,EAAE,CAAC;QACvC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,EAAE;YAC9C,IAAI,KAAK,IAAI,IAAI,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE;aAChD;iBAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;gBACjE,iCAAiC;gBACjC,IAAI,OAAO,GAAG,yCAAyC,KAAK,IAC1D,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,EACrC,GAAG,CAAC;gBACJ,OAAO,IAAI,2DAA2D,CAAC;gBACvE,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;gBACtB,QAAQ,CAAC,IAAI,CACX,oBAAC,IAAI,IAAC,KAAK,EAAE,CAAC,UAAU,CAAC,YAAY,EAAE,MAAM,CAAC,KAAK,CAAC;;oBACjC,oBAAC,IAAI,IAAC,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,IAAG,KAAK,CAAQ;yBAC/D,CACR,CAAC;aACH;iBAAM,IAAI,MAAM,IAAI,KAAK,IAAI,OAAO,KAAK,EAAE,IAAI,KAAK,QAAQ,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,EAAE;gBACtF,uDAAuD;gBACvD,MAAM,IAAI,KAAK,CAAC,yCAAyC,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC;aAC3E;iBAAM;gBACL,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;aACtB;QACH,CAAC,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC;IAClB,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;AACtB,CAAC;AAED,wFAAwF;AACxF,MAAM,UAAU,aAAa,CAAyC,IAAW;IAC/E,OAAO,KAAK,CAAC,UAAU,CAAC,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAO,EAAE,YAA8B,EAAE,EAAE;QACtF,OAAO,oBAAC,IAAI,IAAC,GAAG,EAAE,YAAY,KAAM,KAAK,EAAE,QAAQ,EAAE,WAAW,CAAC,QAAQ,CAAC,GAAI,CAAC;IACjF,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,KAAK,EAAE;QACL,eAAe,EAAE,WAAW;QAC5B,KAAK,EAAE,OAAO;KACf;CACF,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { Platform, StyleSheet, Text } from 'react-native';\n\nfunction useChildren(inputChildren: React.ReactNode) {\n return React.useMemo(() => {\n const children: React.ReactNode[] = [];\n React.Children.forEach(inputChildren, (child) => {\n if (child == null || typeof child === 'boolean') {\n } else if (typeof child === 'string' || typeof child === 'number') {\n // Wrap text in a Text component.\n let message = `Invalid raw text as a child of View: \"${child}\"${\n child === '' ? ` [empty string]` : ''\n }.`;\n message += ' Wrap the text contents with a Text element or remove it.';\n console.warn(message);\n children.push(\n <Text style={[StyleSheet.absoluteFill, styles.error]}>\n Unwrapped text: \"<Text style={{ fontWeight: 'bold' }}>{child}</Text>\"\n </Text>\n );\n } else if ('type' in child && typeof child?.type === 'string' && Platform.OS !== 'web') {\n // Disallow untransformed react-dom elements on native.\n throw new Error(`Using unsupported React DOM element: <${child.type} />`);\n } else {\n children.push(child);\n }\n });\n return children;\n }, [inputChildren]);\n}\n\n/** Extend a view with a `children` filter that asserts more helpful warnings/errors. */\nexport function createDevView<TView extends React.ComponentType<any>>(View: TView) {\n return React.forwardRef(({ children, ...props }: any, forwardedRef: React.Ref<TView>) => {\n return <View ref={forwardedRef} {...props} children={useChildren(children)} />;\n });\n}\n\nconst styles = StyleSheet.create({\n error: {\n backgroundColor: 'firebrick',\n color: 'white',\n },\n});\n"]}
1
+ {"version":3,"file":"createDevView.js","sourceRoot":"","sources":["../../src/primitives/createDevView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAE1D,SAAS,WAAW,CAAC,aAA8B;IACjD,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QACxB,MAAM,QAAQ,GAAsB,EAAE,CAAC;QACvC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,EAAE;YAC9C,IAAI,KAAK,IAAI,IAAI,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE;aAChD;iBAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;gBACjE,iCAAiC;gBACjC,IAAI,OAAO,GAAG,yCAAyC,KAAK,IAC1D,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,EACrC,GA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;KACf;CACF,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { Platform, StyleSheet, Text } from 'react-native';\n\nfunction useChildren(inputChildren: React.ReactNode) {\n return React.useMemo(() => {\n const children: React.ReactNode[] = [];\n React.Children.forEach(inputChildren, (child) => {\n if (child == null || typeof child === 'boolean') {\n } else if (typeof child === 'string' || typeof child === 'number') {\n // Wrap text in a Text component.\n let message = `Invalid raw text as a child of View: \"${child}\"${\n child === '' ? ` [empty string]` : ''\n }.`;\n message += ' Wrap the text contents with a Text element or remove it.';\n console.warn(message);\n children.push(\n <Text style={[StyleSheet.absoluteFill, styles.error]}>\n Unwrapped text: \"<Text style={{ fontWeight: 'bold' }}>{child}</Text>\"\n </Text>\n );\n } else if ('type' in child && typeof child?.type === 'string' && Platform.OS !== 'web') {\n // Disallow untransformed react-dom elements on native.\n throw new Error(`Using unsupported React DOM element: <${child.type} />`);\n } else {\n children.push(child);\n }\n });\n return children;\n }, [inputChildren]);\n}\n\n/** Extend a view with a `children` filter that asserts more helpful warnings/errors. */\nexport function createDevView<TView extends React.ComponentType<any>>(View: TView) {\n return React.forwardRef(({ children, ...props }: any, forwardedRef: React.Ref<TView>) => {\n return <View ref={forwardedRef} {...props} children={useChildren(children)} />;\n });\n}\n\nconst styles = StyleSheet.create({\n error: {\n backgroundColor: 'firebrick',\n color: 'white',\n },\n});\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/html-elements",
3
- "version": "0.6.2",
3
+ "version": "0.7.0",
4
4
  "description": "Universal semantic HTML React components for iOS, Android, web, and desktop",
5
5
  "main": "build/Elements.js",
6
6
  "types": "build/Elements.d.ts",
@@ -59,5 +59,5 @@
59
59
  "devDependencies": {
60
60
  "expo-module-scripts": "^3.0.0"
61
61
  },
62
- "gitHead": "79607a7325f47aa17c36d266100d09a4ff2cc544"
62
+ "gitHead": "da25937e2a99661cbe5eb60ca1d8d6245fc96a50"
63
63
  }