@expo/html-elements 57.0.0 → 58.0.0-canary-20260805-ccd18b9
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/.tsbuildinfo +1 -0
- package/.turbo/turbo-build.log +27 -0
- package/CHANGELOG.md +1 -1
- package/README.md +11 -11
- package/babel/jest.config.js +2 -6
- package/build/Elements.d.ts +0 -1
- package/build/Elements.js +9 -0
- package/build/Elements.js.map +1 -0
- package/build/css/createSafeStyledView.d.ts +0 -1
- package/build/css/createSafeStyledView.js +6 -0
- package/build/css/createSafeStyledView.js.map +1 -0
- package/build/css/createSafeStyledView.native.d.ts +0 -1
- package/build/css/createSafeStyledView.native.js +17 -0
- package/build/css/createSafeStyledView.native.js.map +1 -0
- package/build/css/filterStyles.d.ts +0 -1
- package/build/css/filterStyles.js +86 -0
- package/build/css/filterStyles.js.map +1 -0
- package/build/css/units.d.ts +0 -1
- package/build/css/units.js +11 -0
- package/build/css/units.js.map +1 -0
- package/build/elements/Anchor.d.ts +0 -1
- package/build/elements/Anchor.js +30 -0
- package/build/elements/Anchor.js.map +1 -0
- package/build/elements/Headings.d.ts +0 -1
- package/build/elements/Headings.js +82 -0
- package/build/elements/Headings.js.map +1 -0
- package/build/elements/Layout.d.ts +0 -1
- package/build/elements/Layout.js +60 -0
- package/build/elements/Layout.js.map +1 -0
- package/build/elements/Lists.d.ts +0 -1
- package/build/elements/Lists.js +46 -0
- package/build/elements/Lists.js.map +1 -0
- package/build/elements/Rules.d.ts +0 -1
- package/build/elements/Rules.js +23 -0
- package/build/elements/Rules.js.map +1 -0
- package/build/elements/Rules.web.d.ts +0 -1
- package/build/elements/Rules.web.js +6 -0
- package/build/elements/Rules.web.js.map +1 -0
- package/build/elements/Table.d.ts +0 -1
- package/build/elements/Table.js +83 -0
- package/build/elements/Table.js.map +1 -0
- package/build/elements/Table.web.d.ts +0 -1
- package/build/elements/Table.web.js +47 -0
- package/build/elements/Table.web.js.map +1 -0
- package/build/elements/Text.d.ts +1 -2
- package/build/elements/Text.js +169 -0
- package/build/elements/Text.js.map +1 -0
- package/build/elements/Text.types.d.ts +0 -1
- package/build/elements/Text.types.js +3 -0
- package/build/elements/Text.types.js.map +1 -0
- package/build/primitives/Image.d.ts +0 -1
- package/build/primitives/Image.js +6 -0
- package/build/primitives/Image.js.map +1 -0
- package/build/primitives/RNWView.d.ts +0 -1
- package/build/primitives/RNWView.js +128 -0
- package/build/primitives/RNWView.js.map +1 -0
- package/build/primitives/Table.d.ts +0 -1
- package/build/primitives/Table.js +4 -0
- package/build/primitives/Table.js.map +1 -0
- package/build/primitives/Text.d.ts +0 -1
- package/build/primitives/Text.js +6 -0
- package/build/primitives/Text.js.map +1 -0
- package/build/primitives/View.d.ts +0 -1
- package/build/primitives/View.js +11 -0
- package/build/primitives/View.js.map +1 -0
- package/build/primitives/createDevView.d.ts +0 -1
- package/build/primitives/createDevView.js +56 -0
- package/build/primitives/createDevView.js.map +1 -0
- package/build/ts-declarations/process.d.ts +7 -0
- package/build/ts-declarations/react-native-web.d.ts +1015 -0
- package/package.json +55 -34
- package/src/css/__tests__/createSafeStyledView.test.native.tsx +0 -1
- package/src/elements/Anchor.tsx +1 -1
- package/src/elements/Text.tsx +1 -1
- package/src/elements/__tests__/Anchor.test.ios.tsx +0 -1
- package/src/elements/__tests__/Anchor.test.web.tsx +0 -1
- package/src/elements/__tests__/Headings.test.ios.tsx +1 -2
- package/src/elements/__tests__/Layout.test.ios.tsx +0 -1
- package/src/elements/__tests__/Layout.test.web.tsx +0 -1
- package/src/elements/__tests__/Lists.test.native.tsx +0 -1
- package/src/elements/__tests__/Lists.test.web.tsx +0 -1
- package/src/elements/__tests__/Rules.test.native.tsx +0 -1
- package/src/elements/__tests__/Rules.test.web.tsx +0 -1
- package/src/elements/__tests__/Table.test.ios.tsx +0 -1
- package/src/elements/__tests__/Table.test.web.tsx +0 -1
- package/src/elements/__tests__/Text.test.ios.tsx +0 -1
- package/src/primitives/Image.tsx +1 -1
- package/src/primitives/Text.tsx +1 -1
- package/src/primitives/View.tsx +1 -1
- package/src/primitives/__tests__/createDevView.test.tsx +0 -1
- package/src/ts-declarations/react-native-web.d.ts +6 -7
- package/tsconfig.json +2 -3
- package/.eslintrc.js +0 -2
- package/build/Elements.d.ts.map +0 -1
- package/build/css/createSafeStyledView.d.ts.map +0 -1
- package/build/css/createSafeStyledView.native.d.ts.map +0 -1
- package/build/css/filterStyles.d.ts.map +0 -1
- package/build/css/units.d.ts.map +0 -1
- package/build/elements/Anchor.d.ts.map +0 -1
- package/build/elements/Headings.d.ts.map +0 -1
- package/build/elements/Layout.d.ts.map +0 -1
- package/build/elements/Lists.d.ts.map +0 -1
- package/build/elements/Rules.d.ts.map +0 -1
- package/build/elements/Rules.web.d.ts.map +0 -1
- package/build/elements/Table.d.ts.map +0 -1
- package/build/elements/Table.web.d.ts.map +0 -1
- package/build/elements/Text.d.ts.map +0 -1
- package/build/elements/Text.types.d.ts.map +0 -1
- package/build/primitives/Image.d.ts.map +0 -1
- package/build/primitives/RNWView.d.ts.map +0 -1
- package/build/primitives/Table.d.ts.map +0 -1
- package/build/primitives/Text.d.ts.map +0 -1
- package/build/primitives/View.d.ts.map +0 -1
- package/build/primitives/createDevView.d.ts.map +0 -1
- /package/src/primitives/{Table.ts → Table.tsx} +0 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { StyleSheet } from 'react-native';
|
|
3
|
+
import { em } from '../css/units';
|
|
4
|
+
import { TableText } from '../primitives/Table';
|
|
5
|
+
import Text from '../primitives/Text';
|
|
6
|
+
import View from '../primitives/View';
|
|
7
|
+
export function Table(props) {
|
|
8
|
+
return /*#__PURE__*/ _jsx(View, {
|
|
9
|
+
...props
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
export function THead(props) {
|
|
13
|
+
return /*#__PURE__*/ _jsx(View, {
|
|
14
|
+
...props
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
export function TBody(props) {
|
|
18
|
+
return /*#__PURE__*/ _jsx(View, {
|
|
19
|
+
...props
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
export function TFoot(props) {
|
|
23
|
+
return /*#__PURE__*/ _jsx(View, {
|
|
24
|
+
...props
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
export function TH(props) {
|
|
28
|
+
return /*#__PURE__*/ _jsx(TableText, {
|
|
29
|
+
...props,
|
|
30
|
+
style: [
|
|
31
|
+
styles.th,
|
|
32
|
+
props.style
|
|
33
|
+
]
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
export function TR(props) {
|
|
37
|
+
return /*#__PURE__*/ _jsx(View, {
|
|
38
|
+
...props,
|
|
39
|
+
style: [
|
|
40
|
+
styles.tr,
|
|
41
|
+
props.style
|
|
42
|
+
]
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
export function TD(props) {
|
|
46
|
+
return /*#__PURE__*/ _jsx(TableText, {
|
|
47
|
+
...props,
|
|
48
|
+
style: [
|
|
49
|
+
styles.td,
|
|
50
|
+
props.style
|
|
51
|
+
]
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
export function Caption(props) {
|
|
55
|
+
return /*#__PURE__*/ _jsx(Text, {
|
|
56
|
+
...props,
|
|
57
|
+
style: [
|
|
58
|
+
styles.caption,
|
|
59
|
+
props.style
|
|
60
|
+
]
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
const styles = StyleSheet.create({
|
|
64
|
+
caption: {
|
|
65
|
+
textAlign: 'center',
|
|
66
|
+
fontSize: em(1)
|
|
67
|
+
},
|
|
68
|
+
th: {
|
|
69
|
+
textAlign: 'center',
|
|
70
|
+
fontWeight: 'bold',
|
|
71
|
+
flex: 1,
|
|
72
|
+
fontSize: em(1)
|
|
73
|
+
},
|
|
74
|
+
tr: {
|
|
75
|
+
flexDirection: 'row'
|
|
76
|
+
},
|
|
77
|
+
td: {
|
|
78
|
+
flex: 1,
|
|
79
|
+
fontSize: em(1)
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
//# sourceMappingURL=Table.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["elements/Table.tsx"],"sourcesContent":[null],"names":["StyleSheet","em","TableText","Text","View","Table","props","THead","TBody","TFoot","TH","style","styles","th","TR","tr","TD","td","Caption","caption","create","textAlign","fontSize","fontWeight","flex","flexDirection"],"mappings":";AAAA,SAASA,UAAU,QAAQ,eAAe;AAE1C,SAASC,EAAE,QAAQ,eAAe;AAElC,SAASC,SAAS,QAAQ,sBAAsB;AAEhD,OAAOC,UAAU,qBAAqB;AAEtC,OAAOC,UAAU,qBAAqB;AAEtC,OAAO,SAASC,MAAMC,KAAgB;IACpC,qBAAO,KAACF;QAAM,GAAGE,KAAK;;AACxB;AAEA,OAAO,SAASC,MAAMD,KAAgB;IACpC,qBAAO,KAACF;QAAM,GAAGE,KAAK;;AACxB;AAEA,OAAO,SAASE,MAAMF,KAAgB;IACpC,qBAAO,KAACF;QAAM,GAAGE,KAAK;;AACxB;AAEA,OAAO,SAASG,MAAMH,KAAgB;IACpC,qBAAO,KAACF;QAAM,GAAGE,KAAK;;AACxB;AAEA,OAAO,SAASI,GAAGJ,KAAqB;IACtC,qBAAO,KAACJ;QAAW,GAAGI,KAAK;QAAEK,OAAO;YAACC,OAAOC,EAAE;YAAEP,MAAMK,KAAK;SAAC;;AAC9D;AAEA,OAAO,SAASG,GAAGR,KAAgB;IACjC,qBAAO,KAACF;QAAM,GAAGE,KAAK;QAAEK,OAAO;YAACC,OAAOG,EAAE;YAAET,MAAMK,KAAK;SAAC;;AACzD;AAEA,OAAO,SAASK,GAAGV,KAAqB;IACtC,qBAAO,KAACJ;QAAW,GAAGI,KAAK;QAAEK,OAAO;YAACC,OAAOK,EAAE;YAAEX,MAAMK,KAAK;SAAC;;AAC9D;AAEA,OAAO,SAASO,QAAQZ,KAAgB;IACtC,qBAAO,KAACH;QAAM,GAAGG,KAAK;QAAEK,OAAO;YAACC,OAAOO,OAAO;YAAEb,MAAMK,KAAK;SAAC;;AAC9D;AAEA,MAAMC,SAASZ,WAAWoB,MAAM,CAAC;IAC/BD,SAAS;QACPE,WAAW;QACXC,UAAUrB,GAAG;IACf;IACAY,IAAI;QACFQ,WAAW;QACXE,YAAY;QACZC,MAAM;QACNF,UAAUrB,GAAG;IACf;IACAc,IAAI;QACFU,eAAe;IACjB;IACAR,IAAI;QACFO,MAAM;QACNF,UAAUrB,GAAG;IACf;AACF"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import View from '../primitives/RNWView';
|
|
3
|
+
function createView(nativeProps) {
|
|
4
|
+
return function Dom(props) {
|
|
5
|
+
// @ts-expect-error - View and ViewProps have no properties in common
|
|
6
|
+
return /*#__PURE__*/ _jsx(View, {
|
|
7
|
+
...nativeProps,
|
|
8
|
+
...props
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export const Table = createView({
|
|
13
|
+
__element: 'table'
|
|
14
|
+
});
|
|
15
|
+
export const THead = createView({
|
|
16
|
+
__element: 'thead'
|
|
17
|
+
});
|
|
18
|
+
export const TBody = createView({
|
|
19
|
+
__element: 'tbody'
|
|
20
|
+
});
|
|
21
|
+
export const TFoot = createView({
|
|
22
|
+
__element: 'tfoot'
|
|
23
|
+
});
|
|
24
|
+
export const TH = createView({
|
|
25
|
+
__element: 'th'
|
|
26
|
+
});
|
|
27
|
+
export const TR = createView({
|
|
28
|
+
__element: 'tr'
|
|
29
|
+
});
|
|
30
|
+
export const TD = createView({
|
|
31
|
+
__element: 'td'
|
|
32
|
+
});
|
|
33
|
+
export const Caption = createView({
|
|
34
|
+
__element: 'caption'
|
|
35
|
+
});
|
|
36
|
+
if (__DEV__) {
|
|
37
|
+
Table.displayName = 'Table';
|
|
38
|
+
THead.displayName = 'THead';
|
|
39
|
+
TBody.displayName = 'TBody';
|
|
40
|
+
TFoot.displayName = 'TFoot';
|
|
41
|
+
TH.displayName = 'TH';
|
|
42
|
+
TR.displayName = 'TR';
|
|
43
|
+
TD.displayName = 'TD';
|
|
44
|
+
Caption.displayName = 'Caption';
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
//# sourceMappingURL=Table.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["elements/Table.web.tsx"],"sourcesContent":[null],"names":["View","createView","nativeProps","Dom","props","Table","__element","THead","TBody","TFoot","TH","TR","TD","Caption","__DEV__","displayName"],"mappings":";AAEA,OAAOA,UAAU,wBAAwB;AAGzC,SAASC,WAAWC,WAA8C;IAChE,OAAO,SAASC,IAAIC,KAAgB;QAClC,qEAAqE;QACrE,qBAAO,KAACJ;YAAM,GAAGE,WAAW;YAAG,GAAGE,KAAK;;IACzC;AACF;AAEA,OAAO,MAAMC,QAAQJ,WAAW;IAAEK,WAAW;AAAQ,GAAG;AAExD,OAAO,MAAMC,QAAQN,WAAW;IAAEK,WAAW;AAAQ,GAAG;AAExD,OAAO,MAAME,QAAQP,WAAW;IAAEK,WAAW;AAAQ,GAAG;AAExD,OAAO,MAAMG,QAAQR,WAAW;IAAEK,WAAW;AAAQ,GAAG;AAExD,OAAO,MAAMI,KAAKT,WAAW;IAAEK,WAAW;AAAK,GAAG;AAElD,OAAO,MAAMK,KAAKV,WAAW;IAAEK,WAAW;AAAK,GAAG;AAElD,OAAO,MAAMM,KAAKX,WAAW;IAAEK,WAAW;AAAK,GAAG;AAElD,OAAO,MAAMO,UAAUZ,WAAW;IAAEK,WAAW;AAAU,GAAG;AAE5D,IAAIQ,SAAS;IACXT,MAAMU,WAAW,GAAG;IACpBR,MAAMQ,WAAW,GAAG;IACpBP,MAAMO,WAAW,GAAG;IACpBN,MAAMM,WAAW,GAAG;IACpBL,GAAGK,WAAW,GAAG;IACjBJ,GAAGI,WAAW,GAAG;IACjBH,GAAGG,WAAW,GAAG;IACjBF,QAAQE,WAAW,GAAG;AACxB"}
|
package/build/elements/Text.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { BlockQuoteProps, QuoteProps, TimeProps } from './Text.types';
|
|
2
1
|
import type { TextProps } from '../primitives/Text';
|
|
3
2
|
import type { ViewProps } from '../primitives/View';
|
|
3
|
+
import type { BlockQuoteProps, QuoteProps, TimeProps } from './Text.types';
|
|
4
4
|
export declare function P({ style, ...props }: TextProps): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export declare function B({ style, ...props }: TextProps): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export declare function S({ style, ...props }: TextProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -18,4 +18,3 @@ export declare const Del: typeof S;
|
|
|
18
18
|
export declare const EM: typeof I;
|
|
19
19
|
export declare const Span: import("react").ComponentType<TextProps>;
|
|
20
20
|
export {};
|
|
21
|
-
//# sourceMappingURL=Text.d.ts.map
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { StyleSheet, Platform } from 'react-native';
|
|
3
|
+
import { em } from '../css/units';
|
|
4
|
+
import Text from '../primitives/Text';
|
|
5
|
+
import View from '../primitives/View';
|
|
6
|
+
export function P({ style, ...props }) {
|
|
7
|
+
return /*#__PURE__*/ _jsx(Text, {
|
|
8
|
+
...props,
|
|
9
|
+
style: [
|
|
10
|
+
styles.p,
|
|
11
|
+
style
|
|
12
|
+
]
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
export function B({ style, ...props }) {
|
|
16
|
+
return /*#__PURE__*/ _jsx(Text, {
|
|
17
|
+
...props,
|
|
18
|
+
style: [
|
|
19
|
+
styles.b,
|
|
20
|
+
style
|
|
21
|
+
]
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
export function S({ style, ...props }) {
|
|
25
|
+
return /*#__PURE__*/ _jsx(Text, {
|
|
26
|
+
...props,
|
|
27
|
+
style: [
|
|
28
|
+
styles.s,
|
|
29
|
+
style
|
|
30
|
+
]
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
export function I({ style, ...props }) {
|
|
34
|
+
return /*#__PURE__*/ _jsx(Text, {
|
|
35
|
+
...props,
|
|
36
|
+
style: [
|
|
37
|
+
styles.i,
|
|
38
|
+
style
|
|
39
|
+
]
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
export function Q({ children, cite, style, ...props }) {
|
|
43
|
+
return /*#__PURE__*/ _jsxs(Text, {
|
|
44
|
+
...props,
|
|
45
|
+
style: [
|
|
46
|
+
styles.q,
|
|
47
|
+
style
|
|
48
|
+
],
|
|
49
|
+
children: [
|
|
50
|
+
'"',
|
|
51
|
+
children,
|
|
52
|
+
'"'
|
|
53
|
+
]
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
export function BlockQuote({ style, cite, ...props }) {
|
|
57
|
+
return /*#__PURE__*/ _jsx(View, {
|
|
58
|
+
...props,
|
|
59
|
+
style: [
|
|
60
|
+
styles.blockQuote,
|
|
61
|
+
style
|
|
62
|
+
]
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
export function BR({ style, ...props }) {
|
|
66
|
+
return /*#__PURE__*/ _jsx(Text, {
|
|
67
|
+
...props,
|
|
68
|
+
style: [
|
|
69
|
+
styles.br,
|
|
70
|
+
style
|
|
71
|
+
]
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
export function Mark({ style, ...props }) {
|
|
75
|
+
return /*#__PURE__*/ _jsx(Text, {
|
|
76
|
+
...props,
|
|
77
|
+
style: [
|
|
78
|
+
styles.mark,
|
|
79
|
+
style
|
|
80
|
+
]
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
export function Code({ style, ...props }) {
|
|
84
|
+
return /*#__PURE__*/ _jsx(Text, {
|
|
85
|
+
...props,
|
|
86
|
+
style: [
|
|
87
|
+
styles.code,
|
|
88
|
+
style
|
|
89
|
+
]
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
function isTextProps(props) {
|
|
93
|
+
return typeof props.children === 'string';
|
|
94
|
+
}
|
|
95
|
+
export function Pre(props) {
|
|
96
|
+
if (isTextProps(props)) {
|
|
97
|
+
return /*#__PURE__*/ _jsx(Text, {
|
|
98
|
+
...props,
|
|
99
|
+
style: [
|
|
100
|
+
styles.code,
|
|
101
|
+
styles.pre,
|
|
102
|
+
props.style
|
|
103
|
+
]
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
return /*#__PURE__*/ _jsx(View, {
|
|
107
|
+
...props,
|
|
108
|
+
style: [
|
|
109
|
+
styles.pre,
|
|
110
|
+
props.style
|
|
111
|
+
]
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
// Extract dateTime to prevent passing it to the native Text element
|
|
115
|
+
export function Time({ dateTime, ...props }) {
|
|
116
|
+
return /*#__PURE__*/ _jsx(Text, {
|
|
117
|
+
...props
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
export const Strong = B;
|
|
121
|
+
export const Del = S;
|
|
122
|
+
export const EM = I;
|
|
123
|
+
export const Span = Text;
|
|
124
|
+
const styles = StyleSheet.create({
|
|
125
|
+
p: {
|
|
126
|
+
// @ts-ignore
|
|
127
|
+
marginVertical: em(1)
|
|
128
|
+
},
|
|
129
|
+
b: {
|
|
130
|
+
fontWeight: 'bold'
|
|
131
|
+
},
|
|
132
|
+
q: {
|
|
133
|
+
fontStyle: 'italic'
|
|
134
|
+
},
|
|
135
|
+
code: {
|
|
136
|
+
fontFamily: Platform.select({
|
|
137
|
+
default: `SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace`,
|
|
138
|
+
ios: 'ui-monospace',
|
|
139
|
+
android: 'monospace'
|
|
140
|
+
}),
|
|
141
|
+
fontWeight: '500'
|
|
142
|
+
},
|
|
143
|
+
pre: {
|
|
144
|
+
// @ts-ignore
|
|
145
|
+
marginVertical: em(1)
|
|
146
|
+
},
|
|
147
|
+
blockQuote: {
|
|
148
|
+
// @ts-ignore
|
|
149
|
+
marginVertical: em(1)
|
|
150
|
+
},
|
|
151
|
+
br: {
|
|
152
|
+
width: 0,
|
|
153
|
+
// @ts-ignore
|
|
154
|
+
height: em(0.5)
|
|
155
|
+
},
|
|
156
|
+
s: {
|
|
157
|
+
textDecorationLine: 'line-through',
|
|
158
|
+
textDecorationStyle: 'solid'
|
|
159
|
+
},
|
|
160
|
+
mark: {
|
|
161
|
+
backgroundColor: 'yellow',
|
|
162
|
+
color: 'black'
|
|
163
|
+
},
|
|
164
|
+
i: {
|
|
165
|
+
fontStyle: 'italic'
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
//# sourceMappingURL=Text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["elements/Text.tsx"],"sourcesContent":[null],"names":["StyleSheet","Platform","em","Text","View","P","style","props","styles","p","B","b","S","s","I","i","Q","children","cite","q","BlockQuote","blockQuote","BR","br","Mark","mark","Code","code","isTextProps","Pre","pre","Time","dateTime","Strong","Del","EM","Span","create","marginVertical","fontWeight","fontStyle","fontFamily","select","default","ios","android","width","height","textDecorationLine","textDecorationStyle","backgroundColor","color"],"mappings":";AAAA,SAASA,UAAU,EAAEC,QAAQ,QAAQ,eAAe;AAEpD,SAASC,EAAE,QAAQ,eAAe;AAElC,OAAOC,UAAU,qBAAqB;AAEtC,OAAOC,UAAU,qBAAqB;AAGtC,OAAO,SAASC,EAAE,EAAEC,KAAK,EAAE,GAAGC,OAAkB;IAC9C,qBAAO,KAACJ;QAAM,GAAGI,KAAK;QAAED,OAAO;YAACE,OAAOC,CAAC;YAAEH;SAAM;;AAClD;AAEA,OAAO,SAASI,EAAE,EAAEJ,KAAK,EAAE,GAAGC,OAAkB;IAC9C,qBAAO,KAACJ;QAAM,GAAGI,KAAK;QAAED,OAAO;YA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"names":[],"mappings":"AASA,WAWE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["primitives/Image.tsx"],"sourcesContent":[null],"names":["Image","NativeImage","createSafeStyledView"],"mappings":"AAEA,SAASA,SAASC,WAAW,QAAQ,eAAe;AAEpD,SAASC,oBAAoB,QAAQ,8BAA8B;AAwBnE,MAAMF,QAAQC;AAEd,eAAeC,qBAAqBF,OAAoC"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Expo.
|
|
3
|
+
* Copyright (c) Nicolas Gallagher.
|
|
4
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/ import * as React from 'react';
|
|
9
|
+
import StyleSheet from 'react-native-web/dist/exports/StyleSheet';
|
|
10
|
+
import TextAncestorContext from 'react-native-web/dist/exports/Text/TextAncestorContext';
|
|
11
|
+
import createElement from 'react-native-web/dist/exports/createElement';
|
|
12
|
+
import * as forwardedProps from 'react-native-web/dist/modules/forwardedProps';
|
|
13
|
+
import pick from 'react-native-web/dist/modules/pick';
|
|
14
|
+
import useElementLayout from 'react-native-web/dist/modules/useElementLayout';
|
|
15
|
+
import { useLocaleContext, getLocaleDirection } from 'react-native-web/dist/modules/useLocale';
|
|
16
|
+
import useMergeRefs from 'react-native-web/dist/modules/useMergeRefs';
|
|
17
|
+
import usePlatformMethods from 'react-native-web/dist/modules/usePlatformMethods';
|
|
18
|
+
import useResponderEvents from 'react-native-web/dist/modules/useResponderEvents';
|
|
19
|
+
const forwardPropsList = Object.assign({}, forwardedProps.defaultProps, forwardedProps.accessibilityProps, forwardedProps.clickProps, forwardedProps.defaultProps, forwardedProps.accessibilityProps, forwardedProps.clickProps, forwardedProps.focusProps, forwardedProps.keyboardProps, forwardedProps.mouseProps, forwardedProps.touchProps, forwardedProps.styleProps, {
|
|
20
|
+
href: true,
|
|
21
|
+
lang: true,
|
|
22
|
+
onScroll: true,
|
|
23
|
+
onWheel: true,
|
|
24
|
+
pointerEvents: true
|
|
25
|
+
});
|
|
26
|
+
function pickProps(props) {
|
|
27
|
+
return pick(props, forwardPropsList);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* This is the View from react-native-web copied out in order to supply a custom `__element` property.
|
|
31
|
+
* In the past, you could use `createElement` to create an element with a custom HTML element, but this changed
|
|
32
|
+
* somewhere between 0.14...0.17.
|
|
33
|
+
*/ function View(props) {
|
|
34
|
+
const { __element, hrefAttrs, onLayout, onMoveShouldSetResponder, onMoveShouldSetResponderCapture, onResponderEnd, onResponderGrant, onResponderMove, onResponderReject, onResponderRelease, onResponderStart, onResponderTerminate, onResponderTerminationRequest, onScrollShouldSetResponder, onScrollShouldSetResponderCapture, onSelectionChangeShouldSetResponder, onSelectionChangeShouldSetResponderCapture, onStartShouldSetResponder, onStartShouldSetResponderCapture, ref: forwardedRef, ...rest } = props;
|
|
35
|
+
// if (process.env.NODE_ENV !== 'production') {
|
|
36
|
+
// React.Children.toArray(props.children).forEach((item) => {
|
|
37
|
+
// if (typeof item === 'string') {
|
|
38
|
+
// console.error(`Unexpected text node: ${item}. A text node cannot be a child of a <View>.`);
|
|
39
|
+
// }
|
|
40
|
+
// });
|
|
41
|
+
// }
|
|
42
|
+
const hasTextAncestor = React.use(TextAncestorContext);
|
|
43
|
+
const hostRef = React.useRef(null);
|
|
44
|
+
const { direction: contextDirection } = useLocaleContext();
|
|
45
|
+
useElementLayout(hostRef, onLayout);
|
|
46
|
+
useResponderEvents(hostRef, {
|
|
47
|
+
onMoveShouldSetResponder,
|
|
48
|
+
onMoveShouldSetResponderCapture,
|
|
49
|
+
onResponderEnd,
|
|
50
|
+
onResponderGrant,
|
|
51
|
+
onResponderMove,
|
|
52
|
+
onResponderReject,
|
|
53
|
+
onResponderRelease,
|
|
54
|
+
onResponderStart,
|
|
55
|
+
onResponderTerminate,
|
|
56
|
+
onResponderTerminationRequest,
|
|
57
|
+
onScrollShouldSetResponder,
|
|
58
|
+
onScrollShouldSetResponderCapture,
|
|
59
|
+
onSelectionChangeShouldSetResponder,
|
|
60
|
+
onSelectionChangeShouldSetResponderCapture,
|
|
61
|
+
onStartShouldSetResponder,
|
|
62
|
+
onStartShouldSetResponderCapture
|
|
63
|
+
});
|
|
64
|
+
let component = __element ?? 'div';
|
|
65
|
+
const langDirection = props.lang != null ? getLocaleDirection(props.lang) : null;
|
|
66
|
+
const componentDirection = props.dir || langDirection;
|
|
67
|
+
const writingDirection = componentDirection || contextDirection;
|
|
68
|
+
const supportedProps = pickProps(rest);
|
|
69
|
+
supportedProps.dir = componentDirection;
|
|
70
|
+
supportedProps.style = [
|
|
71
|
+
styles.view$raw,
|
|
72
|
+
hasTextAncestor && styles.inline,
|
|
73
|
+
props.style
|
|
74
|
+
];
|
|
75
|
+
if (props.href != null) {
|
|
76
|
+
component = 'a';
|
|
77
|
+
if (hrefAttrs != null) {
|
|
78
|
+
const { download, rel, target } = hrefAttrs;
|
|
79
|
+
if (download != null) {
|
|
80
|
+
supportedProps.download = download;
|
|
81
|
+
}
|
|
82
|
+
if (rel != null) {
|
|
83
|
+
supportedProps.rel = rel;
|
|
84
|
+
}
|
|
85
|
+
if (typeof target === 'string') {
|
|
86
|
+
supportedProps.target = target.charAt(0) !== '_' ? '_' + target : target;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
const platformMethodsRef = usePlatformMethods(supportedProps);
|
|
91
|
+
const setRef = useMergeRefs(hostRef, platformMethodsRef, forwardedRef);
|
|
92
|
+
return createElement(component, {
|
|
93
|
+
...supportedProps,
|
|
94
|
+
ref: setRef
|
|
95
|
+
}, // @ts-expect-error TODO(cedric): 'writingDirection' does not exist in type 'ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | Promise<...>'
|
|
96
|
+
{
|
|
97
|
+
writingDirection
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
if (__DEV__) {
|
|
101
|
+
View.displayName = 'View';
|
|
102
|
+
}
|
|
103
|
+
const styles = StyleSheet.create({
|
|
104
|
+
view$raw: {
|
|
105
|
+
alignItems: 'stretch',
|
|
106
|
+
backgroundColor: 'transparent',
|
|
107
|
+
border: '0 solid black',
|
|
108
|
+
boxSizing: 'border-box',
|
|
109
|
+
display: 'flex',
|
|
110
|
+
flexBasis: 'auto',
|
|
111
|
+
flexDirection: 'column',
|
|
112
|
+
flexShrink: 0,
|
|
113
|
+
listStyle: 'none',
|
|
114
|
+
margin: 0,
|
|
115
|
+
minHeight: 0,
|
|
116
|
+
minWidth: 0,
|
|
117
|
+
padding: 0,
|
|
118
|
+
position: 'relative',
|
|
119
|
+
textDecoration: 'none',
|
|
120
|
+
zIndex: 0
|
|
121
|
+
},
|
|
122
|
+
inline: {
|
|
123
|
+
display: 'inline-flex'
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
export default View;
|
|
127
|
+
|
|
128
|
+
//# sourceMappingURL=RNWView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["primitives/RNWView.tsx"],"sourcesContent":[null],"names":["React","StyleSheet","TextAncestorContext","createElement","forwardedProps","pick","useElementLayout","useLocaleContext","getLocaleDirection","useMergeRefs","usePlatformMethods","useResponderEvents","forwardPropsList","Object","assign","defaultProps","accessibilityProps","clickProps","focusProps","keyboardProps","mouseProps","touchProps","styleProps","href","lang","onScroll","onWheel","pointerEvents","pickProps","props","View","__element","hrefAttrs","onLayout","onMoveShouldSetResponder","onMoveShouldSetResponderCapture","onResponderEnd","onResponderGrant","onResponderMove","onResponderReject","onResponderRelease","onResponderStart","onResponderTerminate","onResponderTerminationRequest","onScrollShouldSetResponder","onScrollShouldSetResponderCapture","onSelectionChangeShouldSetResponder","onSelectionChangeShouldSetResponderCapture","onStartShouldSetResponder","onStartShouldSetResponderCapture","ref","forwardedRef","rest","hasTextAncestor","use","hostRef","useRef","direction","contextDirection","component","langDirection","componentDirection","dir","writingDirection","supportedProps","style","styles","view$raw","inline","download","rel","target","charAt","platformMethodsRef","setRef","__DEV__","displayName","create","alignItems","backgroundColor","border","boxSizing","display","flexBasis","flexDirection","flexShrink","listStyle","margin","minHeight","minWidth","padding","position","textDecoration","zIndex"],"mappings":"AAAA;;;;;;;CAOC,GACD,YAAYA,WAAW,QAAQ;AAC/B,OAAOC,gBAAgB,2CAA2C;AAClE,OAAOC,yBAAyB,yDAAyD;AAEzF,OAAOC,mBAAmB,8CAA8C;AACxE,YAAYC,oBAAoB,+CAA+C;AAC/E,OAAOC,UAAU,qCAAqC;AACtD,OAAOC,sBAAsB,iDAAiD;AAC9E,SAASC,gBAAgB,EAAEC,kBAAkB,QAAQ,0CAA0C;AAC/F,OAAOC,kBAAkB,6CAA6C;AACtE,OAAOC,wBAAwB,mDAAmD;AAClF,OAAOC,wBAAwB,mDAAmD;AAElF,MAAMC,mBAAmBC,OAAOC,MAAM,CACpC,CAAC,GACDV,eAAeW,YAAY,EAC3BX,eAAeY,kBAAkB,EACjCZ,eAAea,UAAU,EACzBb,eAAeW,YAAY,EAC3BX,eAAeY,kBAAkB,EACjCZ,eAAea,UAAU,EACzBb,eAAec,UAAU,EACzBd,eAAee,aAAa,EAC5Bf,eAAegB,UAAU,EACzBhB,eAAeiB,UAAU,EACzBjB,eAAekB,UAAU,EACzB;IACEC,MAAM;IACNC,MAAM;IACNC,UAAU;IACVC,SAAS;IACTC,eAAe;AACjB;AAGF,SAASC,UAAUC,KAAgC;IACjD,OAAOxB,KAAKwB,OAAOjB;AACrB;AAEA;;;;CAIC,GAED,SAASkB,KAAKD,KAAgB;IAC5B,MAAM,EACJE,SAAS,EACTC,SAAS,EACTC,QAAQ,EACRC,wBAAwB,EACxBC,+BAA+B,EAC/BC,cAAc,EACdC,gBAAgB,EAChBC,eAAe,EACfC,iBAAiB,EACjBC,kBAAkB,EAClBC,gBAAgB,EAChBC,oBAA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eO,MAAM,GAAGA,OAAOC,MAAM,CAAC,OAAO,MAAM,MAAMD,SAASA;YACpE;QACF;IACF;IAEA,MAAME,qBAAqB/D,mBAAmBsD;IAC9C,MAAMU,SAASjE,aAAa8C,SAASkB,oBAAoBtB;IAEzD,OAAOhD,cACLwD,WACA;QACE,GAAGK,cAAc;QACjBd,KAAKwB;IACP,GACA,2LAA2L;IAC3L;QAAEX;IAAiB;AAEvB;AAEA,IAAIY,SAAS;IACX7C,KAAK8C,WAAW,GAAG;AACrB;AAEA,MAAMV,SAASjE,WAAW4E,MAAM,CAAC;IAC/BV,UAAU;QACRW,YAAY;QACZC,iBAAiB;QACjBC,QAAQ;QACRC,WAAW;QACXC,SAAS;QACTC,WAAW;QACXC,eAAe;QACfC,YAAY;QACZC,WAAW;QACXC,QAAQ;QACRC,WAAW;QACXC,UAAU;QACVC,SAAS;QACTC,UAAU;QACVC,gBAAgB;QAChBC,QAAQ;IACV;IACAzB,QAAQ;QACNc,SAAS;IACX;AACF;AAEA,eAAepD,KAAK"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["primitives/Table.tsx"],"sourcesContent":[null],"names":["Text","TableText"],"mappings":"AAEA,OAAOA,UAAU,SAAS;AAW1B,OAAO,MAAMC,YAAYD,KAAsC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["primitives/Text.tsx"],"sourcesContent":[null],"names":["Text","NativeText","createSafeStyledView"],"mappings":"AAEA,SAASA,QAAQC,UAAU,QAAQ,eAAe;AAElD,SAASC,oBAAoB,QAAQ,8BAA8B;AA8DnE,MAAMF,OAAOC;AAEb,eAAeC,qBAAqBF,MAAkC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { View as NativeView } from 'react-native';
|
|
2
|
+
import { createSafeStyledView } from '../css/createSafeStyledView';
|
|
3
|
+
import { createDevView } from './createDevView';
|
|
4
|
+
let View = NativeView;
|
|
5
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
6
|
+
// Add better errors and warnings in development builds.
|
|
7
|
+
View = createDevView(NativeView);
|
|
8
|
+
}
|
|
9
|
+
export default createSafeStyledView(View);
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=View.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["primitives/View.tsx"],"sourcesContent":[null],"names":["View","NativeView","createSafeStyledView","createDevView","process","env","NODE_ENV"],"mappings":"AACA,SAMEA,QAAQC,UAAU,QACb,eAAe;AAEtB,SAASC,oBAAoB,QAAQ,8BAA8B;AACnE,SAASC,aAAa,QAAQ,kBAAkB;AA8HhD,IAAIH,OAAOC;AAEX,IAAIG,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;IACzC,wDAAwD;IACxDN,OAAOG,cAAcF;AACvB;AAEA,eAAeC,qBAAqBF,MAAkC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
/** Extend a view with a `children` filter that asserts more helpful warnings/errors. */
|
|
3
3
|
export declare function createDevView<TView extends React.ComponentType<any>>(View: TView): ({ children, ...props }: any) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
//# sourceMappingURL=createDevView.d.ts.map
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Platform, StyleSheet, Text } from 'react-native';
|
|
4
|
+
function useChildren(inputChildren) {
|
|
5
|
+
return React.useMemo(()=>{
|
|
6
|
+
const children = [];
|
|
7
|
+
React.Children.forEach(inputChildren, (child)=>{
|
|
8
|
+
if (child == null || typeof child === 'boolean') {} else if (typeof child === 'string' || typeof child === 'number' || typeof child === 'bigint') {
|
|
9
|
+
// Wrap text in a Text component.
|
|
10
|
+
let message = `Invalid raw text as a child of View: "${child}"${child === '' ? ` [empty string]` : ''}.`;
|
|
11
|
+
message += ' Wrap the text contents with a Text element or remove it.';
|
|
12
|
+
console.warn(message);
|
|
13
|
+
children.push(/*#__PURE__*/ _jsxs(Text, {
|
|
14
|
+
style: [
|
|
15
|
+
StyleSheet.absoluteFill,
|
|
16
|
+
styles.error
|
|
17
|
+
],
|
|
18
|
+
children: [
|
|
19
|
+
'Unwrapped text: "',
|
|
20
|
+
/*#__PURE__*/ _jsx(Text, {
|
|
21
|
+
style: {
|
|
22
|
+
fontWeight: 'bold'
|
|
23
|
+
},
|
|
24
|
+
children: child
|
|
25
|
+
}),
|
|
26
|
+
'"'
|
|
27
|
+
]
|
|
28
|
+
}));
|
|
29
|
+
} else if ('type' in child && typeof child?.type === 'string' && Platform.OS !== 'web') {
|
|
30
|
+
// Disallow untransformed react-dom elements on native.
|
|
31
|
+
throw new Error(`Using unsupported React DOM element: <${child.type} />`);
|
|
32
|
+
} else {
|
|
33
|
+
children.push(child);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
return children;
|
|
37
|
+
}, [
|
|
38
|
+
inputChildren
|
|
39
|
+
]);
|
|
40
|
+
}
|
|
41
|
+
/** Extend a view with a `children` filter that asserts more helpful warnings/errors. */ export function createDevView(View) {
|
|
42
|
+
return function DevView({ children, ...props }) {
|
|
43
|
+
return /*#__PURE__*/ _jsx(View, {
|
|
44
|
+
...props,
|
|
45
|
+
children: useChildren(children)
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
const styles = StyleSheet.create({
|
|
50
|
+
error: {
|
|
51
|
+
backgroundColor: 'firebrick',
|
|
52
|
+
color: 'white'
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
//# sourceMappingURL=createDevView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["primitives/createDevView.tsx"],"sourcesContent":[null],"names":["React","Platform","StyleSheet","Text","useChildren","inputChildren","useMemo","children","Children","forEach","child","message","console","warn","push","style","absoluteFill","styles","error","fontWeight","type","OS","Error","createDevView","View","DevView","props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