@tamagui/react-native-web-lite 1.129.6 → 1.129.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/createElement/index.cjs +14 -3
- package/dist/cjs/createElement/index.js +18 -2
- package/dist/cjs/createElement/index.js.map +1 -1
- package/dist/cjs/createElement/index.native.js +33 -4
- package/dist/cjs/createElement/index.native.js.map +2 -2
- package/dist/esm/createElement/index.js +24 -4
- package/dist/esm/createElement/index.js.map +1 -1
- package/dist/esm/createElement/index.mjs +15 -4
- package/dist/esm/createElement/index.mjs.map +1 -1
- package/dist/esm/createElement/index.native.js +34 -6
- package/dist/esm/createElement/index.native.js.map +1 -1
- package/package.json +6 -6
- package/src/createElement/index.tsx +33 -5
|
@@ -34,18 +34,29 @@ __export(createElement_exports, {
|
|
|
34
34
|
default: () => createElement_default
|
|
35
35
|
});
|
|
36
36
|
module.exports = __toCommonJS(createElement_exports);
|
|
37
|
-
var
|
|
38
|
-
import_react_native_web_internals = require("@tamagui/react-native-web-internals"),
|
|
37
|
+
var import_react_native_web_internals = require("@tamagui/react-native-web-internals"),
|
|
39
38
|
import_web = require("@tamagui/web"),
|
|
39
|
+
import_react = __toESM(require("react")),
|
|
40
40
|
import_jsx_runtime = require("react/jsx-runtime");
|
|
41
41
|
const createElement = (component, props, options) => {
|
|
42
|
+
const isHydrated = (0, import_web.useDidFinishSSR)();
|
|
42
43
|
let accessibilityComponent;
|
|
43
44
|
component && component.constructor === String && (accessibilityComponent = import_react_native_web_internals.AccessibilityUtil.propsToAccessibilityComponent(props));
|
|
44
45
|
const Component = accessibilityComponent || component,
|
|
45
46
|
domProps = (0, import_react_native_web_internals.createDOMProps)(Component, props, options),
|
|
46
47
|
styles = import_react_native_web_internals.stylesFromProps.get(domProps);
|
|
47
48
|
let element = import_react.default.createElement(Component, domProps);
|
|
48
|
-
|
|
49
|
+
const styleTags = (0, import_react.useMemo)(() => isHydrated || !styles ? null : (0, import_web.getStyleTags)(styles, element), [
|
|
50
|
+
// never changes
|
|
51
|
+
]);
|
|
52
|
+
return element = /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
53
|
+
children: [element, styleTags]
|
|
54
|
+
}), (0, import_react.useInsertionEffect)(() => {
|
|
55
|
+
if (!styles) return;
|
|
56
|
+
const styleObj = {};
|
|
57
|
+
for (const style of styles) styleObj[style[0]] = style;
|
|
58
|
+
(0, import_web.insertStyleRules)(styleObj);
|
|
59
|
+
}, [styles]), domProps.dir ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react_native_web_internals.LocaleProvider, {
|
|
49
60
|
direction: domProps.dir,
|
|
50
61
|
locale: domProps.lang,
|
|
51
62
|
children: element
|
|
@@ -25,13 +25,29 @@ __export(createElement_exports, {
|
|
|
25
25
|
default: () => createElement_default
|
|
26
26
|
});
|
|
27
27
|
module.exports = __toCommonJS(createElement_exports);
|
|
28
|
-
var
|
|
28
|
+
var import_react_native_web_internals = require("@tamagui/react-native-web-internals"), import_web = require("@tamagui/web"), import_react = __toESM(require("react")), import_jsx_runtime = require("react/jsx-runtime");
|
|
29
29
|
const createElement = (component, props, options) => {
|
|
30
|
+
const isHydrated = (0, import_web.useDidFinishSSR)();
|
|
30
31
|
let accessibilityComponent;
|
|
31
32
|
component && component.constructor === String && (accessibilityComponent = import_react_native_web_internals.AccessibilityUtil.propsToAccessibilityComponent(props));
|
|
32
33
|
const Component = accessibilityComponent || component, domProps = (0, import_react_native_web_internals.createDOMProps)(Component, props, options), styles = import_react_native_web_internals.stylesFromProps.get(domProps);
|
|
33
34
|
let element = import_react.default.createElement(Component, domProps);
|
|
34
|
-
|
|
35
|
+
const styleTags = (0, import_react.useMemo)(
|
|
36
|
+
() => isHydrated || !styles ? null : (0, import_web.getStyleTags)(styles, element),
|
|
37
|
+
[
|
|
38
|
+
// never changes
|
|
39
|
+
]
|
|
40
|
+
);
|
|
41
|
+
return element = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
42
|
+
element,
|
|
43
|
+
styleTags
|
|
44
|
+
] }), (0, import_react.useInsertionEffect)(() => {
|
|
45
|
+
if (!styles) return;
|
|
46
|
+
const styleObj = {};
|
|
47
|
+
for (const style of styles)
|
|
48
|
+
styleObj[style[0]] = style;
|
|
49
|
+
(0, import_web.insertStyleRules)(styleObj);
|
|
50
|
+
}, [styles]), domProps.dir ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native_web_internals.LocaleProvider, { direction: domProps.dir, locale: domProps.lang, children: element }) : element;
|
|
35
51
|
};
|
|
36
52
|
var createElement_default = createElement;
|
|
37
53
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/createElement/index.tsx"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,wCAKO,gDACP,aAKO,yBACP,eAAmD,2BA2B/C;AAzBJ,MAAM,gBAAgB,CAAC,WAAW,OAAO,YAAa;AACpD,QAAM,iBAAa,4BAAgB;AAGnC,MAAI;AACJ,EAAI,aAAa,UAAU,gBAAgB,WACzC,yBAAyB,oDAAkB,8BAA8B,KAAK;AAEhF,QAAM,YAAY,0BAA0B,WACtC,eAAW,kDAAe,WAAW,OAAO,OAAO,GAEnD,SAAS,kDAAgB,IAAI,QAAQ;AAE3C,MAAI,UAAU,aAAAA,QAAM,cAAc,WAAW,QAAQ;AAErD,QAAM,gBAAY;AAAA,IAChB,MACS,cAAc,CAAC,SAAS,WAAO,yBAAa,QAAQ,OAAO;AAAA,IAEpE;AAAA;AAAA,IAEA;AAAA,EACF;AAEA,mBACE,4EACG;AAAA;AAAA,IACA;AAAA,KACH,OAGF,iCAAmB,MAAM;AACvB,QAAI,CAAC,OAAQ;AACb,UAAM,WAAwC,CAAC;AAC/C,eAAW,SAAS;AAClB,eAAS,MAAM,CAAC,CAAC,IAAI;AAEvB,qCAAiB,QAAQ;AAAA,EAC3B,GAAG,CAAC,MAAM,CAAC,GAGuB,SAAS,MACzC,4CAAC,oDAAe,WAAW,SAAS,KAAK,QAAQ,SAAS,MACvD,mBACH,IAEA;AAIJ;AAEA,IAAO,wBAAQ;",
|
|
5
5
|
"names": ["React"]
|
|
6
6
|
}
|
|
@@ -26,11 +26,40 @@ __export(createElement_exports, {
|
|
|
26
26
|
default: () => createElement_default
|
|
27
27
|
});
|
|
28
28
|
module.exports = __toCommonJS(createElement_exports);
|
|
29
|
-
var import_jsx_runtime = require("react/jsx-runtime"),
|
|
30
|
-
var accessibilityComponent;
|
|
29
|
+
var import_jsx_runtime = require("react/jsx-runtime"), import_react_native_web_internals = require("@tamagui/react-native-web-internals"), import_web = require("@tamagui/web"), import_react = __toESM(require("react")), createElement = function(component, props, options) {
|
|
30
|
+
var isHydrated = (0, import_web.useDidFinishSSR)(), accessibilityComponent;
|
|
31
31
|
component && component.constructor === String && (accessibilityComponent = import_react_native_web_internals.AccessibilityUtil.propsToAccessibilityComponent(props));
|
|
32
|
-
var Component = accessibilityComponent || component, domProps = (0, import_react_native_web_internals.createDOMProps)(Component, props, options), styles = import_react_native_web_internals.stylesFromProps.get(domProps), element = /* @__PURE__ */ import_react.default.createElement(Component, domProps)
|
|
33
|
-
|
|
32
|
+
var Component = accessibilityComponent || component, domProps = (0, import_react_native_web_internals.createDOMProps)(Component, props, options), styles = import_react_native_web_internals.stylesFromProps.get(domProps), element = /* @__PURE__ */ import_react.default.createElement(Component, domProps), styleTags = (0, import_react.useMemo)(function() {
|
|
33
|
+
return isHydrated || !styles ? null : (0, import_web.getStyleTags)(styles, element);
|
|
34
|
+
}, []);
|
|
35
|
+
element = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
36
|
+
children: [
|
|
37
|
+
element,
|
|
38
|
+
styleTags
|
|
39
|
+
]
|
|
40
|
+
}), (0, import_react.useInsertionEffect)(function() {
|
|
41
|
+
if (styles) {
|
|
42
|
+
var styleObj = {}, _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
|
43
|
+
try {
|
|
44
|
+
for (var _iterator = styles[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
|
45
|
+
var style = _step.value;
|
|
46
|
+
styleObj[style[0]] = style;
|
|
47
|
+
}
|
|
48
|
+
} catch (err) {
|
|
49
|
+
_didIteratorError = !0, _iteratorError = err;
|
|
50
|
+
} finally {
|
|
51
|
+
try {
|
|
52
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
53
|
+
} finally {
|
|
54
|
+
if (_didIteratorError)
|
|
55
|
+
throw _iteratorError;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
(0, import_web.insertStyleRules)(styleObj);
|
|
59
|
+
}
|
|
60
|
+
}, [
|
|
61
|
+
styles
|
|
62
|
+
]);
|
|
34
63
|
var elementWithLocaleProvider = domProps.dir ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_native_web_internals.LocaleProvider, {
|
|
35
64
|
direction: domProps.dir,
|
|
36
65
|
locale: domProps.lang,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/createElement/index.tsx"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;AAOC,yBAAA,8BAED,
|
|
5
|
-
"names": ["createElement", "component", "props", "options", "accessibilityComponent", "constructor", "String", "AccessibilityUtil", "propsToAccessibilityComponent", "Component", "domProps", "createDOMProps", "styles", "stylesFromProps", "get", "element", "React", "
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;AAOC,yBAAA,8BAED,oCAKO,gDACP,aAKO,yBACP,eAAmD,2BAE7CA,gBAAgB,SAACC,WAAWC,OAAOC,SAAAA;AACvC,MAAMC,iBAAaC,4BAAAA,GAGfC;AACJ,EAAIL,aAAaA,UAAUM,gBAAgBC,WACzCF,yBAAyBG,oDAAkBC,8BAA8BR,KAAAA;AAE3E,MAAMS,YAAYL,0BAA0BL,WACtCW,eAAWC,kDAAeF,WAAWT,OAAOC,OAAAA,GAE5CW,SAASC,kDAAgBC,IAAIJ,QAAAA,GAE/BK,UAAUC,6BAAAA,QAAMlB,cAAcW,WAAWC,QAAAA,GAEvCO,gBAAYC,sBAChB,WAAA;AACE,WAAOhB,cAAc,CAACU,SAAS,WAAOO,yBAAaP,QAAQG,OAAAA;EAC7D,GACA,CAAA,CAEC;AAGHA,YACE,uCAAAK,MAAA,mBAAAC,UAAA;;MACGN;MACAE;;UAILK,iCAAmB,WAAA;AACjB,QAAKV,QACL;UAAMW,WAAwC,CAAC,GAC1C,4BAAA,IAAA,oBAAA,IAAA,iBAAA;;AAAL,iBAAK,YAAeX,OAAAA,OAAAA,QAAAA,EAAAA,GAAf,OAAA,EAAA,6BAAA,QAAA,UAAA,KAAA,GAAA,OAAA,4BAAA,IAAuB;AAAvB,cAAMY,QAAN,MAAA;AACHD,mBAASC,MAAM,CAAA,CAAE,IAAIA;QACvB;;AAFK,4BAAA,IAAA,iBAAA;;;WAAA,6BAAA,UAAA,UAAA,QAAA,UAAA,OAAA;;cAAA;kBAAA;;;AAGLC,uCAAiBF,QAAAA;;EACnB,GAAG;IAACX;GAAO;AAGX,MAAMc,4BAA4BhB,SAASiB,MACzC,uCAAAC,KAACC,kDAAAA;IAAeC,WAAWpB,SAASiB;IAAKI,QAAQrB,SAASsB;cACvDjB;OAGHA;AAGF,SAAOW;AACT,GAEA,wBAAe5B;",
|
|
5
|
+
"names": ["createElement", "component", "props", "options", "isHydrated", "useDidFinishSSR", "accessibilityComponent", "constructor", "String", "AccessibilityUtil", "propsToAccessibilityComponent", "Component", "domProps", "createDOMProps", "styles", "stylesFromProps", "get", "element", "React", "styleTags", "useMemo", "getStyleTags", "_jsxs", "_Fragment", "useInsertionEffect", "styleObj", "style", "insertStyleRules", "elementWithLocaleProvider", "dir", "_jsx", "LocaleProvider", "direction", "locale", "lang"]
|
|
6
6
|
}
|
|
@@ -1,18 +1,38 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import {
|
|
3
2
|
AccessibilityUtil,
|
|
4
3
|
LocaleProvider,
|
|
5
4
|
createDOMProps,
|
|
6
5
|
stylesFromProps
|
|
7
6
|
} from "@tamagui/react-native-web-internals";
|
|
8
|
-
import {
|
|
9
|
-
|
|
7
|
+
import {
|
|
8
|
+
getStyleTags,
|
|
9
|
+
insertStyleRules,
|
|
10
|
+
useDidFinishSSR
|
|
11
|
+
} from "@tamagui/web";
|
|
12
|
+
import React, { useInsertionEffect, useMemo } from "react";
|
|
13
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
14
|
const createElement = (component, props, options) => {
|
|
15
|
+
const isHydrated = useDidFinishSSR();
|
|
11
16
|
let accessibilityComponent;
|
|
12
17
|
component && component.constructor === String && (accessibilityComponent = AccessibilityUtil.propsToAccessibilityComponent(props));
|
|
13
18
|
const Component = accessibilityComponent || component, domProps = createDOMProps(Component, props, options), styles = stylesFromProps.get(domProps);
|
|
14
19
|
let element = React.createElement(Component, domProps);
|
|
15
|
-
|
|
20
|
+
const styleTags = useMemo(
|
|
21
|
+
() => isHydrated || !styles ? null : getStyleTags(styles, element),
|
|
22
|
+
[
|
|
23
|
+
// never changes
|
|
24
|
+
]
|
|
25
|
+
);
|
|
26
|
+
return element = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
27
|
+
element,
|
|
28
|
+
styleTags
|
|
29
|
+
] }), useInsertionEffect(() => {
|
|
30
|
+
if (!styles) return;
|
|
31
|
+
const styleObj = {};
|
|
32
|
+
for (const style of styles)
|
|
33
|
+
styleObj[style[0]] = style;
|
|
34
|
+
insertStyleRules(styleObj);
|
|
35
|
+
}, [styles]), domProps.dir ? /* @__PURE__ */ jsx(LocaleProvider, { direction: domProps.dir, locale: domProps.lang, children: element }) : element;
|
|
16
36
|
};
|
|
17
37
|
var createElement_default = createElement;
|
|
18
38
|
export {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/createElement/index.tsx"],
|
|
4
|
-
"mappings": "AASA,
|
|
4
|
+
"mappings": "AASA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EAEE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,OAAO,SAAS,oBAAoB,eAAe;AA2B/C,mBAiBA,KAjBA;AAzBJ,MAAM,gBAAgB,CAAC,WAAW,OAAO,YAAa;AACpD,QAAM,aAAa,gBAAgB;AAGnC,MAAI;AACJ,EAAI,aAAa,UAAU,gBAAgB,WACzC,yBAAyB,kBAAkB,8BAA8B,KAAK;AAEhF,QAAM,YAAY,0BAA0B,WACtC,WAAW,eAAe,WAAW,OAAO,OAAO,GAEnD,SAAS,gBAAgB,IAAI,QAAQ;AAE3C,MAAI,UAAU,MAAM,cAAc,WAAW,QAAQ;AAErD,QAAM,YAAY;AAAA,IAChB,MACS,cAAc,CAAC,SAAS,OAAO,aAAa,QAAQ,OAAO;AAAA,IAEpE;AAAA;AAAA,IAEA;AAAA,EACF;AAEA,mBACE,iCACG;AAAA;AAAA,IACA;AAAA,KACH,GAGF,mBAAmB,MAAM;AACvB,QAAI,CAAC,OAAQ;AACb,UAAM,WAAwC,CAAC;AAC/C,eAAW,SAAS;AAClB,eAAS,MAAM,CAAC,CAAC,IAAI;AAEvB,qBAAiB,QAAQ;AAAA,EAC3B,GAAG,CAAC,MAAM,CAAC,GAGuB,SAAS,MACzC,oBAAC,kBAAe,WAAW,SAAS,KAAK,QAAQ,SAAS,MACvD,mBACH,IAEA;AAIJ;AAEA,IAAO,wBAAQ;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -1,15 +1,26 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { AccessibilityUtil, LocaleProvider, createDOMProps, stylesFromProps } from "@tamagui/react-native-web-internals";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { getStyleTags, insertStyleRules, useDidFinishSSR } from "@tamagui/web";
|
|
3
|
+
import React, { useInsertionEffect, useMemo } from "react";
|
|
4
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
const createElement = (component, props, options) => {
|
|
6
|
+
const isHydrated = useDidFinishSSR();
|
|
6
7
|
let accessibilityComponent;
|
|
7
8
|
component && component.constructor === String && (accessibilityComponent = AccessibilityUtil.propsToAccessibilityComponent(props));
|
|
8
9
|
const Component = accessibilityComponent || component,
|
|
9
10
|
domProps = createDOMProps(Component, props, options),
|
|
10
11
|
styles = stylesFromProps.get(domProps);
|
|
11
12
|
let element = React.createElement(Component, domProps);
|
|
12
|
-
|
|
13
|
+
const styleTags = useMemo(() => isHydrated || !styles ? null : getStyleTags(styles, element), [
|
|
14
|
+
// never changes
|
|
15
|
+
]);
|
|
16
|
+
return element = /* @__PURE__ */jsxs(Fragment, {
|
|
17
|
+
children: [element, styleTags]
|
|
18
|
+
}), useInsertionEffect(() => {
|
|
19
|
+
if (!styles) return;
|
|
20
|
+
const styleObj = {};
|
|
21
|
+
for (const style of styles) styleObj[style[0]] = style;
|
|
22
|
+
insertStyleRules(styleObj);
|
|
23
|
+
}, [styles]), domProps.dir ? /* @__PURE__ */jsx(LocaleProvider, {
|
|
13
24
|
direction: domProps.dir,
|
|
14
25
|
locale: domProps.lang,
|
|
15
26
|
children: element
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["AccessibilityUtil","LocaleProvider","createDOMProps","stylesFromProps","getStyleTags","insertStyleRules","useDidFinishSSR","React","useInsertionEffect","useMemo","Fragment","jsx","jsxs","createElement","component","props","options","isHydrated","accessibilityComponent","constructor","String","propsToAccessibilityComponent","Component","domProps","styles","get","element","styleTags","children","styleObj","style","dir","direction","locale","lang","createElement_default"],"sources":["../../../src/createElement/index.tsx"],"sourcesContent":[null],"mappings":"AASA,SACEA,iBAAA,EACAC,cAAA,EACAC,cAAA,EACAC,eAAA,QACK;AACP,SAEEC,YAAA,EACAC,gBAAA,EACAC,eAAA,QACK;AACP,OAAOC,KAAA,IAASC,kBAAA,EAAoBC,OAAA,QAAe;AA2B/C,SAAAC,QAAA,EAiBAC,GAAA,EAjBAC,IAAA;AAzBJ,MAAMC,aAAA,GAAgBA,CAACC,SAAA,EAAWC,KAAA,EAAOC,OAAA,KAAa;EACpD,MAAMC,UAAA,GAAaX,eAAA,CAAgB;EAGnC,IAAIY,sBAAA;EACAJ,SAAA,IAAaA,SAAA,CAAUK,WAAA,KAAgBC,MAAA,KACzCF,sBAAA,GAAyBlB,iBAAA,CAAkBqB,6BAAA,CAA8BN,KAAK;EAEhF,MAAMO,SAAA,GAAYJ,sBAAA,IAA0BJ,SAAA;IACtCS,QAAA,GAAWrB,cAAA,CAAeoB,SAAA,EAAWP,KAAA,EAAOC,OAAO;IAEnDQ,MAAA,GAASrB,eAAA,CAAgBsB,GAAA,CAAIF,QAAQ;EAE3C,IAAIG,OAAA,GAAUnB,KAAA,CAAMM,aAAA,CAAcS,SAAA,EAAWC,QAAQ;EAErD,MAAMI,SAAA,GAAYlB,OAAA,CAChB,MACSQ,UAAA,IAAc,CAACO,MAAA,GAAS,OAAOpB,YAAA,CAAaoB,MAAA,EAAQE,OAAO,GAEpE;IAAA;EAAA,CAGF;EAEA,OAAAA,OAAA,GACE,eAAAd,IAAA,CAAAF,QAAA;IACGkB,QAAA,GAAAF,OAAA,EACAC,SAAA;EAAA,CACH,GAGFnB,kBAAA,CAAmB,MAAM;IACvB,IAAI,CAACgB,MAAA,EAAQ;IACb,MAAMK,QAAA,GAAwC,CAAC;IAC/C,WAAWC,KAAA,IAASN,MAAA,EAClBK,QAAA,CAASC,KAAA,CAAM,CAAC,CAAC,IAAIA,KAAA;IAEvBzB,gBAAA,CAAiBwB,QAAQ;EAC3B,GAAG,CAACL,MAAM,CAAC,GAGuBD,QAAA,CAASQ,GAAA,GACzC,eAAApB,GAAA,CAACV,cAAA;IAAe+B,SAAA,EAAWT,QAAA,CAASQ,GAAA;IAAKE,MAAA,EAAQV,QAAA,CAASW,IAAA;IACvDN,QAAA,EAAAF;EAAA,CACH,IAEAA,OAAA;AAIJ;AAEA,IAAOS,qBAAA,GAAQtB,aAAA","ignoreList":[]}
|
|
@@ -1,15 +1,43 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import React from "react";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
2
|
import { AccessibilityUtil, LocaleProvider, createDOMProps, stylesFromProps } from "@tamagui/react-native-web-internals";
|
|
4
|
-
import {
|
|
3
|
+
import { getStyleTags, insertStyleRules, useDidFinishSSR } from "@tamagui/web";
|
|
4
|
+
import React, { useInsertionEffect, useMemo } from "react";
|
|
5
5
|
var createElement = function (component, props, options) {
|
|
6
|
-
var
|
|
6
|
+
var isHydrated = useDidFinishSSR(),
|
|
7
|
+
accessibilityComponent;
|
|
7
8
|
component && component.constructor === String && (accessibilityComponent = AccessibilityUtil.propsToAccessibilityComponent(props));
|
|
8
9
|
var Component = accessibilityComponent || component,
|
|
9
10
|
domProps = createDOMProps(Component, props, options),
|
|
10
11
|
styles = stylesFromProps.get(domProps),
|
|
11
|
-
element = /* @__PURE__ */React.createElement(Component, domProps)
|
|
12
|
-
|
|
12
|
+
element = /* @__PURE__ */React.createElement(Component, domProps),
|
|
13
|
+
styleTags = useMemo(function () {
|
|
14
|
+
return isHydrated || !styles ? null : getStyleTags(styles, element);
|
|
15
|
+
}, []);
|
|
16
|
+
element = /* @__PURE__ */_jsxs(_Fragment, {
|
|
17
|
+
children: [element, styleTags]
|
|
18
|
+
}), useInsertionEffect(function () {
|
|
19
|
+
if (styles) {
|
|
20
|
+
var styleObj = {},
|
|
21
|
+
_iteratorNormalCompletion = !0,
|
|
22
|
+
_didIteratorError = !1,
|
|
23
|
+
_iteratorError = void 0;
|
|
24
|
+
try {
|
|
25
|
+
for (var _iterator = styles[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
|
26
|
+
var style = _step.value;
|
|
27
|
+
styleObj[style[0]] = style;
|
|
28
|
+
}
|
|
29
|
+
} catch (err) {
|
|
30
|
+
_didIteratorError = !0, _iteratorError = err;
|
|
31
|
+
} finally {
|
|
32
|
+
try {
|
|
33
|
+
!_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
|
|
34
|
+
} finally {
|
|
35
|
+
if (_didIteratorError) throw _iteratorError;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
insertStyleRules(styleObj);
|
|
39
|
+
}
|
|
40
|
+
}, [styles]);
|
|
13
41
|
var elementWithLocaleProvider = domProps.dir ? /* @__PURE__ */_jsx(LocaleProvider, {
|
|
14
42
|
direction: domProps.dir,
|
|
15
43
|
locale: domProps.lang,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["jsx","_jsx","
|
|
1
|
+
{"version":3,"names":["jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","AccessibilityUtil","LocaleProvider","createDOMProps","stylesFromProps","getStyleTags","insertStyleRules","useDidFinishSSR","React","useInsertionEffect","useMemo","createElement","component","props","options","isHydrated","accessibilityComponent","constructor","String","propsToAccessibilityComponent","Component","domProps","styles","get","element","styleTags","children","styleObj","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_iterator","Symbol","iterator","_step","next","done","style","value","err","return"],"sources":["../../../src/createElement/index.tsx"],"sourcesContent":[null],"mappings":"AASA,SAAAA,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAAA,SACEC,iBAAA,EAAAC,cAAA,EAAAC,cAAA,EAAAC,eAAA;AAAA,SACAC,YAAA,EAAAC,gBAAA,EAAAC,eAAA;AAAA,OACAC,KAAA,IAAAC,kBAAA,EAAAC,OAAA;AAAA,IACAC,aAAA,YAAAA,CAAAC,SAAA,EAAAC,KAAA,EAAAC,OAAA;IAAA,IAAAC,UACK,GAAAR,eAAA;MAAAS,sBAAA;IACPJ,SAAA,IAAAA,SAAA,CAAAK,WAAA,KAAAC,MAAA,KAAAF,sBAAA,GAAAf,iBAAA,CAAAkB,6BAAA,CAAAN,KAAA;IAEE,IAAAO,SAAA,GAAAJ,sBAAA,IAAAJ,SAAA;MAAAS,QAAA,GAAAlB,cAAA,CAAAiB,SAAA,EAAAP,KAAA,EAAAC,OAAA;MAAAQ,MAAA,GAAAlB,eAAA,CAAAmB,GAAA,CAAAF,QAAA;MAAAG,OAAA,kBAAAhB,KAAA,CAAAG,aAAA,CAAAS,SAAA,EAAAC,QAAA;MAAAI,SAAA,GAAAf,OAAA;QACA,OAAAK,UAAA,KAAAO,MAAA,UAAAjB,YAAA,CAAAiB,MAAA,EAAAE,OAAA;MACA;IAAAA,OACK,kBAAA1B,KAAA,CAAAE,SAAA;MACP0B,QAAO,GA2BHF,OAAA,EAzBEC,SAAA;IAIJ,IAAIhB,kBAAA;MACA,IAAAa,MAAA,EAAa;QAGjB,IAAMK,QAAA,GAAY;UAAAC,yBAA0B;UACtCC,iBAAW;UAAAC,cAA0B,QAAO;QAI9C;UAEE,SAAAC,SAAY,GAAAT,MAAA,CAAAU,MAAA,CAAAC,QAAA,KAAAC,KAAA,IAAAN,yBAAA,IAAAM,KAAA,GAAAH,SAAA,CAAAI,IAAA,IAAAC,IAAA,GAAAR,yBAAA;YAEP,IAAAS,KAAA,GAAAH,KAAe,CAAAI,KAAA;YAExBX,QAAA,CAAAU,KAAA,OAAAA,KAAA;UAAA;QAEA,SAAAE,GAAA;UACFV,iBAAA,OAAAC,cAAA,GAAAS,GAAA;QAEA;UAEK;YACA,CAAAX,yBAAA,IAAAG,SAAA,CAAAS,MAAA,YAAAT,SAAA,CAAAS,MAAA;UAIL;YACO,IAAAX,iBAAQ,EACP,MAAAC,cAAyC;UAC/C;QACE;QAEFxB,gBAAiB,CAAAqB,QAAQ;MAC3B;IAYF,IAEOL,MAAA,C","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/react-native-web-lite",
|
|
3
|
-
"version": "1.129.
|
|
3
|
+
"version": "1.129.7",
|
|
4
4
|
"description": "React Native for Web",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/cjs",
|
|
@@ -41,14 +41,14 @@
|
|
|
41
41
|
"./dist/*": "./dist/cjs/*/index.mjs"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@tamagui/normalize-css-color": "1.129.
|
|
45
|
-
"@tamagui/react-native-use-pressable": "1.129.
|
|
46
|
-
"@tamagui/react-native-use-responder-events": "1.129.
|
|
47
|
-
"@tamagui/react-native-web-internals": "1.129.
|
|
44
|
+
"@tamagui/normalize-css-color": "1.129.7",
|
|
45
|
+
"@tamagui/react-native-use-pressable": "1.129.7",
|
|
46
|
+
"@tamagui/react-native-use-responder-events": "1.129.7",
|
|
47
|
+
"@tamagui/react-native-web-internals": "1.129.7",
|
|
48
48
|
"invariant": "^2.2.4"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@tamagui/build": "1.129.
|
|
51
|
+
"@tamagui/build": "1.129.7",
|
|
52
52
|
"react": "*"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
@@ -7,16 +7,23 @@
|
|
|
7
7
|
* @noflow
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import React from 'react'
|
|
11
10
|
import {
|
|
12
11
|
AccessibilityUtil,
|
|
13
12
|
LocaleProvider,
|
|
14
13
|
createDOMProps,
|
|
15
14
|
stylesFromProps,
|
|
16
15
|
} from '@tamagui/react-native-web-internals'
|
|
17
|
-
import {
|
|
16
|
+
import {
|
|
17
|
+
type StyleObject,
|
|
18
|
+
getStyleTags,
|
|
19
|
+
insertStyleRules,
|
|
20
|
+
useDidFinishSSR,
|
|
21
|
+
} from '@tamagui/web'
|
|
22
|
+
import React, { useInsertionEffect, useMemo } from 'react'
|
|
18
23
|
|
|
19
24
|
const createElement = (component, props, options?) => {
|
|
25
|
+
const isHydrated = useDidFinishSSR()
|
|
26
|
+
|
|
20
27
|
// Use equivalent platform elements where possible.
|
|
21
28
|
let accessibilityComponent
|
|
22
29
|
if (component && component.constructor === String) {
|
|
@@ -29,9 +36,30 @@ const createElement = (component, props, options?) => {
|
|
|
29
36
|
|
|
30
37
|
let element = React.createElement(Component, domProps)
|
|
31
38
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
39
|
+
const styleTags = useMemo(
|
|
40
|
+
() => {
|
|
41
|
+
return isHydrated || !styles ? null : getStyleTags(styles, element)
|
|
42
|
+
},
|
|
43
|
+
[
|
|
44
|
+
// never changes
|
|
45
|
+
]
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
element = (
|
|
49
|
+
<>
|
|
50
|
+
{element}
|
|
51
|
+
{styleTags}
|
|
52
|
+
</>
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
useInsertionEffect(() => {
|
|
56
|
+
if (!styles) return
|
|
57
|
+
const styleObj: Record<string, StyleObject> = {}
|
|
58
|
+
for (const style of styles) {
|
|
59
|
+
styleObj[style[0]] = style
|
|
60
|
+
}
|
|
61
|
+
insertStyleRules(styleObj)
|
|
62
|
+
}, [styles])
|
|
35
63
|
|
|
36
64
|
// Update locale context if element's writing direction prop changes
|
|
37
65
|
const elementWithLocaleProvider = domProps.dir ? (
|