@tamagui/vite-plugin 1.13.2 → 1.13.4
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/extensions.js +1 -39
- package/dist/cjs/extensions.js.map +2 -2
- package/dist/cjs/extract.js +6 -185
- package/dist/cjs/extract.js.map +2 -2
- package/dist/cjs/index.js +1 -21
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/native.js +5 -228
- package/dist/cjs/native.js.map +2 -2
- package/dist/cjs/nativePrebuild.js +1 -133
- package/dist/cjs/nativePrebuild.js.map +2 -2
- package/dist/cjs/plugin.js +1 -125
- package/dist/cjs/plugin.js.map +2 -2
- package/dist/esm/extensions.js +1 -15
- package/dist/esm/extensions.js.map +2 -2
- package/dist/esm/extensions.mjs +1 -15
- package/dist/esm/extensions.mjs.map +2 -2
- package/dist/esm/extract.js +6 -151
- package/dist/esm/extract.js.map +2 -2
- package/dist/esm/extract.mjs +6 -151
- package/dist/esm/extract.mjs.map +2 -2
- package/dist/esm/index.js +1 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +1 -4
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/native.js +5 -203
- package/dist/esm/native.js.map +2 -2
- package/dist/esm/native.mjs +5 -203
- package/dist/esm/native.mjs.map +2 -2
- package/dist/esm/nativePrebuild.js +1 -99
- package/dist/esm/nativePrebuild.js.map +2 -2
- package/dist/esm/nativePrebuild.mjs +1 -99
- package/dist/esm/nativePrebuild.mjs.map +2 -2
- package/dist/esm/plugin.js +1 -101
- package/dist/esm/plugin.js.map +2 -2
- package/dist/esm/plugin.mjs +1 -101
- package/dist/esm/plugin.mjs.map +2 -2
- package/package.json +6 -6
package/dist/cjs/extensions.js
CHANGED
|
@@ -1,40 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var extensions_exports = {};
|
|
20
|
-
__export(extensions_exports, {
|
|
21
|
-
extensions: () => extensions
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(extensions_exports);
|
|
24
|
-
const extensions = [
|
|
25
|
-
".ios.js",
|
|
26
|
-
".native.js",
|
|
27
|
-
".native.ts",
|
|
28
|
-
".native.tsx",
|
|
29
|
-
".js",
|
|
30
|
-
".jsx",
|
|
31
|
-
".json",
|
|
32
|
-
".ts",
|
|
33
|
-
".tsx",
|
|
34
|
-
".mjs"
|
|
35
|
-
];
|
|
36
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
37
|
-
0 && (module.exports = {
|
|
38
|
-
extensions
|
|
39
|
-
});
|
|
1
|
+
"use strict";var j=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var v=(t,s)=>{for(var e in s)j(t,e,{get:s[e],enumerable:!0})},c=(t,s,e,i)=>{if(s&&typeof s=="object"||typeof s=="function")for(let n of x(s))!a.call(t,n)&&n!==e&&j(t,n,{get:()=>s[n],enumerable:!(i=o(s,n))||i.enumerable});return t};var m=t=>c(j({},"__esModule",{value:!0}),t);var r={};v(r,{extensions:()=>p});module.exports=m(r);const p=[".ios.js",".native.js",".native.ts",".native.tsx",".js",".jsx",".json",".ts",".tsx",".mjs"];0&&(module.exports={extensions});
|
|
40
2
|
//# sourceMappingURL=extensions.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/extensions.ts"],
|
|
4
4
|
"sourcesContent": ["export const extensions = [\n '.ios.js',\n '.native.js',\n '.native.ts',\n '.native.tsx',\n '.js',\n '.jsx',\n '.json',\n '.ts',\n '.tsx',\n '.mjs',\n]\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gBAAAE,IAAA,eAAAC,EAAAH,GAAO,MAAME,EAAa,CACxB,UACA,aACA,aACA,cACA,MACA,OACA,QACA,MACA,OACA,MACF",
|
|
6
|
+
"names": ["extensions_exports", "__export", "extensions", "__toCommonJS"]
|
|
7
7
|
}
|
package/dist/cjs/extract.js
CHANGED
|
@@ -1,197 +1,18 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var extract_exports = {};
|
|
30
|
-
__export(extract_exports, {
|
|
31
|
-
tamaguiExtractPlugin: () => tamaguiExtractPlugin
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(extract_exports);
|
|
34
|
-
var import_path = __toESM(require("path"));
|
|
35
|
-
var Static = __toESM(require("@tamagui/static"));
|
|
36
|
-
var import_outdent = __toESM(require("outdent"));
|
|
37
|
-
var import_vite = require("vite");
|
|
38
|
-
const { createExtractor, extractToClassNames, getPragmaOptions } = Static["default"] || Static;
|
|
39
|
-
const styleUpdateEvent = (fileId) => `tamagui-style-update:${fileId}`;
|
|
40
|
-
const GLOBAL_CSS_VIRTUAL_PATH = "__tamagui_global_css__.css";
|
|
41
|
-
function tamaguiExtractPlugin(options) {
|
|
42
|
-
const disableStatic = options.disable || options.disableDebugAttr && options.disableExtraction;
|
|
43
|
-
if (disableStatic) {
|
|
44
|
-
return {
|
|
45
|
-
name: "tamagui-extract"
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
let extractor = null;
|
|
49
|
-
const cssMap = /* @__PURE__ */ new Map();
|
|
50
|
-
let config;
|
|
51
|
-
let server;
|
|
52
|
-
let shouldReturnCSS = true;
|
|
53
|
-
let virtualExt;
|
|
54
|
-
const getAbsoluteVirtualFileId = (filePath) => {
|
|
55
|
-
if (filePath.startsWith(config.root)) {
|
|
56
|
-
return filePath;
|
|
57
|
-
}
|
|
58
|
-
return (0, import_vite.normalizePath)(import_path.default.join(config.root, filePath));
|
|
59
|
-
};
|
|
60
|
-
return {
|
|
61
|
-
name: "tamagui-extract",
|
|
62
|
-
enforce: "pre",
|
|
63
|
-
configureServer(_server) {
|
|
64
|
-
server = _server;
|
|
65
|
-
},
|
|
66
|
-
buildEnd() {
|
|
67
|
-
extractor.cleanupBeforeExit();
|
|
68
|
-
},
|
|
69
|
-
writeBundle(options2, bundle) {
|
|
70
|
-
setTimeout(() => {
|
|
71
|
-
console.warn("some sort of dangling process or osmethign, exit for now...");
|
|
72
|
-
process.exit(0);
|
|
73
|
-
}, 100);
|
|
74
|
-
},
|
|
75
|
-
config(_userConfig, env) {
|
|
76
|
-
const include = env.command === "serve" ? ["@tamagui/core/inject-styles"] : [];
|
|
77
|
-
return {
|
|
78
|
-
optimizeDeps: { include }
|
|
79
|
-
};
|
|
80
|
-
},
|
|
81
|
-
async configResolved(resolvedConfig) {
|
|
82
|
-
config = resolvedConfig;
|
|
83
|
-
extractor = createExtractor({
|
|
84
|
-
logger: resolvedConfig.logger
|
|
85
|
-
});
|
|
86
|
-
shouldReturnCSS = true;
|
|
87
|
-
virtualExt = `.tamagui.${shouldReturnCSS ? "css" : "js"}`;
|
|
88
|
-
},
|
|
89
|
-
async resolveId(source) {
|
|
90
|
-
if (source === "tamagui.css") {
|
|
91
|
-
await extractor.loadTamagui(options);
|
|
92
|
-
return GLOBAL_CSS_VIRTUAL_PATH;
|
|
93
|
-
}
|
|
94
|
-
const [validId, query] = source.split("?");
|
|
95
|
-
if (!validId.endsWith(virtualExt)) {
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
const absoluteId = source.startsWith(config.root) ? source : getAbsoluteVirtualFileId(validId);
|
|
99
|
-
if (cssMap.has(absoluteId)) {
|
|
100
|
-
return absoluteId + (query ? `?${query}` : "");
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
|
-
/**
|
|
104
|
-
* TODO
|
|
105
|
-
*
|
|
106
|
-
* mainFields module:jsx breaks, so lets just have a mapping here
|
|
107
|
-
* where we load() and map it to the jsx path before transform
|
|
108
|
-
*
|
|
109
|
-
*/
|
|
110
|
-
load(id, options2) {
|
|
111
|
-
const [validId] = id.split("?");
|
|
112
|
-
if (validId === GLOBAL_CSS_VIRTUAL_PATH) {
|
|
113
|
-
return extractor.getTamagui().getCSS();
|
|
114
|
-
}
|
|
115
|
-
if (!cssMap.has(validId)) {
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
const css = cssMap.get(validId);
|
|
119
|
-
if (typeof css !== "string") {
|
|
120
|
-
return;
|
|
121
|
-
}
|
|
122
|
-
if (shouldReturnCSS || !server || server.config.isProduction) {
|
|
123
|
-
return css;
|
|
124
|
-
}
|
|
125
|
-
return import_outdent.default`
|
|
1
|
+
"use strict";var C=Object.create;var d=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var O=Object.getPrototypeOf,M=Object.prototype.hasOwnProperty;var B=(t,r)=>{for(var s in r)d(t,s,{get:r[s],enumerable:!0})},I=(t,r,s,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let a of A(r))!M.call(t,a)&&a!==s&&d(t,a,{get:()=>r[a],enumerable:!(n=D(r,a))||n.enumerable});return t};var v=(t,r,s)=>(s=t!=null?C(O(t)):{},I(r||!t||!t.__esModule?d(s,"default",{value:t,enumerable:!0}):s,t)),V=t=>I(d({},"__esModule",{value:!0}),t);var G={};B(G,{tamaguiExtractPlugin:()=>F});module.exports=V(G);var $=v(require("path")),T=v(require("@tamagui/static")),P=v(require("outdent")),w=require("vite");const{createExtractor:W,extractToClassNames:L,getPragmaOptions:z}=T.default||T,j=t=>`tamagui-style-update:${t}`,_="__tamagui_global_css__.css";function F(t){if(t.disable||t.disableDebugAttr&&t.disableExtraction)return{name:"tamagui-extract"};let s=null;const n=new Map;let a,u,f=!0,p;const h=e=>e.startsWith(a.root)?e:(0,w.normalizePath)($.default.join(a.root,e));return{name:"tamagui-extract",enforce:"pre",configureServer(e){u=e},buildEnd(){s.cleanupBeforeExit()},writeBundle(e,c){setTimeout(()=>{console.warn("some sort of dangling process or osmethign, exit for now..."),process.exit(0)},100)},config(e,c){return{optimizeDeps:{include:c.command==="serve"?["@tamagui/core/inject-styles"]:[]}}},async configResolved(e){a=e,s=W({logger:e.logger}),f=!0,p=`.tamagui.${f?"css":"js"}`},async resolveId(e){if(e==="tamagui.css")return await s.loadTamagui(t),_;const[c,o]=e.split("?");if(!c.endsWith(p))return;const i=e.startsWith(a.root)?e:h(c);if(n.has(i))return i+(o?`?${o}`:"")},load(e,c){const[o]=e.split("?");if(o===_)return s.getTamagui().getCSS();if(!n.has(o))return;const i=n.get(o);if(typeof i=="string")return f||!u||u.config.isProduction?i:P.default`
|
|
126
2
|
import { injectStyles } from '@tamagui/core/inject-styles';
|
|
127
3
|
|
|
128
4
|
const inject = (css) => injectStyles({
|
|
129
|
-
filePath: "${
|
|
5
|
+
filePath: "${o}",
|
|
130
6
|
css
|
|
131
7
|
});
|
|
132
8
|
|
|
133
|
-
inject(${JSON.stringify(
|
|
9
|
+
inject(${JSON.stringify(i)});
|
|
134
10
|
|
|
135
11
|
if (import.meta.hot) {
|
|
136
|
-
import.meta.hot.on('${
|
|
12
|
+
import.meta.hot.on('${j(o)}', (css) => {
|
|
137
13
|
inject(css);
|
|
138
14
|
});
|
|
139
15
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
async transform(code, id, ssrParam) {
|
|
143
|
-
const [validId] = id.split("?");
|
|
144
|
-
if (!validId.endsWith(".tsx")) {
|
|
145
|
-
return;
|
|
146
|
-
}
|
|
147
|
-
const firstCommentIndex = code.indexOf("// ");
|
|
148
|
-
const { shouldDisable, shouldPrintDebug } = getPragmaOptions({
|
|
149
|
-
source: firstCommentIndex >= 0 ? code.slice(firstCommentIndex) : "",
|
|
150
|
-
path: validId
|
|
151
|
-
});
|
|
152
|
-
if (shouldDisable) {
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
const extracted = await extractToClassNames({
|
|
156
|
-
extractor,
|
|
157
|
-
source: code,
|
|
158
|
-
sourcePath: validId,
|
|
159
|
-
options,
|
|
160
|
-
shouldPrintDebug
|
|
161
|
-
});
|
|
162
|
-
if (!extracted) {
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
const rootRelativeId = `${validId}${virtualExt}`;
|
|
166
|
-
const absoluteId = getAbsoluteVirtualFileId(rootRelativeId);
|
|
167
|
-
let source = extracted.js;
|
|
168
|
-
if (extracted.styles) {
|
|
169
|
-
if (server && cssMap.has(absoluteId) && cssMap.get(absoluteId) !== extracted.styles) {
|
|
170
|
-
const { moduleGraph } = server;
|
|
171
|
-
const [module2] = Array.from(moduleGraph.getModulesByFile(absoluteId) || []);
|
|
172
|
-
if (module2) {
|
|
173
|
-
moduleGraph.invalidateModule(module2);
|
|
174
|
-
module2.lastHMRTimestamp = module2.lastInvalidationTimestamp || Date.now();
|
|
175
|
-
}
|
|
176
|
-
server.ws.send({
|
|
177
|
-
type: "custom",
|
|
178
|
-
event: styleUpdateEvent(absoluteId),
|
|
179
|
-
data: extracted.styles
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
source = `${source}
|
|
183
|
-
import "${rootRelativeId}";`;
|
|
184
|
-
cssMap.set(absoluteId, extracted.styles);
|
|
185
|
-
}
|
|
186
|
-
return {
|
|
187
|
-
code: source.toString(),
|
|
188
|
-
map: extracted.map
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
};
|
|
192
|
-
}
|
|
193
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
194
|
-
0 && (module.exports = {
|
|
195
|
-
tamaguiExtractPlugin
|
|
196
|
-
});
|
|
16
|
+
`},async transform(e,c,o){const[i]=c.split("?");if(!i.endsWith(".tsx"))return;const x=e.indexOf("// "),{shouldDisable:E,shouldPrintDebug:R}=z({source:x>=0?e.slice(x):"",path:i});if(E)return;const l=await L({extractor:s,source:e,sourcePath:i,options:t,shouldPrintDebug:R});if(!l)return;const S=`${i}${p}`,m=h(S);let y=l.js;if(l.styles){if(u&&n.has(m)&&n.get(m)!==l.styles){const{moduleGraph:b}=u,[g]=Array.from(b.getModulesByFile(m)||[]);g&&(b.invalidateModule(g),g.lastHMRTimestamp=g.lastInvalidationTimestamp||Date.now()),u.ws.send({type:"custom",event:j(m),data:l.styles})}y=`${y}
|
|
17
|
+
import "${S}";`,n.set(m,l.styles)}return{code:y.toString(),map:l.map}}}}0&&(module.exports={tamaguiExtractPlugin});
|
|
197
18
|
//# sourceMappingURL=extract.js.map
|
package/dist/cjs/extract.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/extract.ts"],
|
|
4
4
|
"sourcesContent": ["// fork from https://github.com/seek-oss/vanilla-extract\n\nimport path from 'path'\n\nimport { TamaguiOptions } from '@tamagui/static'\nimport * as Static from '@tamagui/static'\nimport outdent from 'outdent'\nimport type { Plugin, ResolvedConfig, ViteDevServer } from 'vite'\nimport { normalizePath } from 'vite'\n\nconst { createExtractor, extractToClassNames, getPragmaOptions } =\n Static['default'] || Static\n\nconst styleUpdateEvent = (fileId: string) => `tamagui-style-update:${fileId}`\nconst GLOBAL_CSS_VIRTUAL_PATH = '__tamagui_global_css__.css'\n\nexport function tamaguiExtractPlugin(options: TamaguiOptions): Plugin {\n const disableStatic =\n options.disable || (options.disableDebugAttr && options.disableExtraction)\n\n if (disableStatic) {\n return {\n name: 'tamagui-extract',\n }\n }\n\n let extractor: ReturnType<typeof createExtractor> | null = null\n const cssMap = new Map<string, string>()\n\n let config: ResolvedConfig\n let server: ViteDevServer\n let shouldReturnCSS = true //config.command === 'serve'\n let virtualExt: string\n\n const getAbsoluteVirtualFileId = (filePath: string) => {\n if (filePath.startsWith(config.root)) {\n return filePath\n }\n return normalizePath(path.join(config.root, filePath))\n }\n\n return {\n name: 'tamagui-extract',\n enforce: 'pre',\n\n configureServer(_server) {\n server = _server\n },\n\n buildEnd() {\n extractor!.cleanupBeforeExit()\n },\n\n writeBundle(this, options, bundle) {\n setTimeout(() => {\n // eslint-disable-next-line no-console\n console.warn('some sort of dangling process or osmethign, exit for now...')\n process.exit(0)\n }, 100)\n },\n\n config(_userConfig, env) {\n const include = env.command === 'serve' ? ['@tamagui/core/inject-styles'] : []\n return {\n optimizeDeps: { include },\n }\n },\n\n async configResolved(resolvedConfig) {\n config = resolvedConfig\n extractor = createExtractor({\n logger: resolvedConfig.logger,\n })\n shouldReturnCSS = true\n // TODO postcss work with postcss.config.js\n // packageName = getPackageInfo(config.root).name;\n // if (config.command === 'serve') {\n // postCssConfig = await resolvePostcssConfig(config);\n // }\n virtualExt = `.tamagui.${shouldReturnCSS ? 'css' : 'js'}`\n },\n\n async resolveId(source) {\n if (source === 'tamagui.css') {\n await extractor!.loadTamagui(options)\n return GLOBAL_CSS_VIRTUAL_PATH\n }\n\n const [validId, query] = source.split('?')\n\n if (!validId.endsWith(virtualExt)) {\n return\n }\n\n // Absolute paths seem to occur often in monorepos, where files are\n // imported from outside the config root.\n const absoluteId = source.startsWith(config.root)\n ? source\n : getAbsoluteVirtualFileId(validId)\n\n // There should always be an entry in the `cssMap` here.\n // The only valid scenario for a missing one is if someone had written\n // a file in their app using the .tamagui.js/.tamagui.css extension\n if (cssMap.has(absoluteId)) {\n // Keep the original query string for HMR.\n return absoluteId + (query ? `?${query}` : '')\n }\n },\n\n /**\n * TODO\n *\n * mainFields module:jsx breaks, so lets just have a mapping here\n * where we load() and map it to the jsx path before transform\n *\n */\n\n load(id, options) {\n const [validId] = id.split('?')\n\n if (validId === GLOBAL_CSS_VIRTUAL_PATH) {\n return extractor!.getTamagui()!.getCSS()\n }\n\n if (!cssMap.has(validId)) {\n return\n }\n\n const css = cssMap.get(validId)\n\n if (typeof css !== 'string') {\n return\n }\n\n if (shouldReturnCSS || !server || server.config.isProduction) {\n return css\n }\n\n return outdent`\n import { injectStyles } from '@tamagui/core/inject-styles';\n\n const inject = (css) => injectStyles({\n filePath: \"${validId}\",\n css\n });\n\n inject(${JSON.stringify(css)});\n\n if (import.meta.hot) {\n import.meta.hot.on('${styleUpdateEvent(validId)}', (css) => {\n inject(css);\n });\n }\n `\n },\n\n async transform(code, id, ssrParam) {\n const [validId] = id.split('?')\n\n if (!validId.endsWith('.tsx')) {\n return\n }\n\n // let ssr: boolean | undefined\n // if (typeof ssrParam === 'boolean') {\n // ssr = ssrParam\n // } else {\n // ssr = ssrParam?.ssr\n // }\n\n const firstCommentIndex = code.indexOf('// ')\n const { shouldDisable, shouldPrintDebug } = getPragmaOptions({\n source: firstCommentIndex >= 0 ? code.slice(firstCommentIndex) : '',\n path: validId,\n })\n\n if (shouldDisable) {\n return\n }\n\n const extracted = await extractToClassNames({\n extractor: extractor!,\n source: code,\n sourcePath: validId,\n options,\n shouldPrintDebug,\n })\n\n if (!extracted) {\n return\n }\n\n const rootRelativeId = `${validId}${virtualExt}`\n const absoluteId = getAbsoluteVirtualFileId(rootRelativeId)\n\n let source = extracted.js\n\n if (extracted.styles) {\n if (\n server &&\n cssMap.has(absoluteId) &&\n cssMap.get(absoluteId) !== extracted.styles\n ) {\n const { moduleGraph } = server\n const [module] = Array.from(moduleGraph.getModulesByFile(absoluteId) || [])\n\n if (module) {\n moduleGraph.invalidateModule(module)\n\n // Vite uses this timestamp to add `?t=` query string automatically for HMR.\n module.lastHMRTimestamp =\n (module as any).lastInvalidationTimestamp || Date.now()\n }\n\n server.ws.send({\n type: 'custom',\n event: styleUpdateEvent(absoluteId),\n data: extracted.styles,\n })\n }\n\n source = `${source}\\nimport \"${rootRelativeId}\";`\n cssMap.set(absoluteId, extracted.styles)\n }\n\n return {\n code: source.toString(),\n map: extracted.map,\n }\n\n // if (ssr && !process.env.VITE_RSC_BUILD) {\n // return addFileScope({\n // source: code,\n // filePath: normalizePath(validId),\n // rootPath: config.root,\n // packageName,\n // })\n // }\n\n // const { source, watchFiles } = await compile({\n // filePath: validId,\n // cwd: config.root,\n // esbuildOptions,\n // })\n\n // for (const file of watchFiles) {\n // // In start mode, we need to prevent the file from rewatching itself.\n // // If it's a `build --watch`, it needs to watch everything.\n // if (config.command === 'build' || file !== validId) {\n // this.addWatchFile(file)\n // }\n // }\n },\n }\n}\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["extract_exports", "__export", "tamaguiExtractPlugin", "__toCommonJS", "import_path", "Static", "import_outdent", "import_vite", "createExtractor", "extractToClassNames", "getPragmaOptions", "styleUpdateEvent", "fileId", "GLOBAL_CSS_VIRTUAL_PATH", "options", "extractor", "cssMap", "config", "server", "shouldReturnCSS", "virtualExt", "getAbsoluteVirtualFileId", "filePath", "path", "_server", "bundle", "_userConfig", "env", "resolvedConfig", "source", "validId", "query", "absoluteId", "id", "css", "outdent", "code", "ssrParam", "firstCommentIndex", "shouldDisable", "shouldPrintDebug", "extracted", "rootRelativeId", "moduleGraph", "module"]
|
|
7
7
|
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,22 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
-
var src_exports = {};
|
|
17
|
-
module.exports = __toCommonJS(src_exports);
|
|
18
|
-
__reExport(src_exports, require("./plugin.js"), module.exports);
|
|
19
|
-
__reExport(src_exports, require("./extract.js"), module.exports);
|
|
20
|
-
__reExport(src_exports, require("./native.js"), module.exports);
|
|
21
|
-
__reExport(src_exports, require("./nativePrebuild.js"), module.exports);
|
|
1
|
+
"use strict";var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var t=(f,e,p,x)=>{if(e&&typeof e=="object"||typeof e=="function")for(let m of c(e))!d.call(f,m)&&m!==p&&a(f,m,{get:()=>e[m],enumerable:!(x=b(e,m))||x.enumerable});return f},r=(f,e,p)=>(t(f,e,"default"),p&&t(p,e,"default"));var g=f=>t(a({},"__esModule",{value:!0}),f);var o={};module.exports=g(o);r(o,require("./plugin.js"),module.exports);r(o,require("./extract.js"),module.exports);r(o,require("./native.js"),module.exports);r(o,require("./nativePrebuild.js"),module.exports);
|
|
22
2
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
4
|
"sourcesContent": ["export * from './plugin.js'\nexport * from './extract.js'\nexport * from './native.js'\nexport * from './nativePrebuild.js'\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "iaAAA,IAAAA,EAAA,kBAAAC,EAAAD,GAAAE,EAAAF,EAAc,uBAAd,gBACAE,EAAAF,EAAc,wBADd,gBAEAE,EAAAF,EAAc,uBAFd,gBAGAE,EAAAF,EAAc,+BAHd",
|
|
6
|
+
"names": ["src_exports", "__toCommonJS", "__reExport"]
|
|
7
7
|
}
|
package/dist/cjs/native.js
CHANGED
|
@@ -1,235 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var native_exports = {};
|
|
20
|
-
__export(native_exports, {
|
|
21
|
-
nativePlugin: () => nativePlugin
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(native_exports);
|
|
24
|
-
var import_promises = require("fs/promises");
|
|
25
|
-
var import_path = require("path");
|
|
26
|
-
var import_vite_plugin_flow = require("@bunchtogether/vite-plugin-flow");
|
|
27
|
-
var import_extensions = require("./extensions.js");
|
|
28
|
-
function nativePlugin() {
|
|
29
|
-
return {
|
|
30
|
-
name: "tamagui-native",
|
|
31
|
-
enforce: "post",
|
|
32
|
-
config: (config) => {
|
|
33
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
34
|
-
if (!config.build)
|
|
35
|
-
config.build = {};
|
|
36
|
-
config.build.modulePreload = { polyfill: false };
|
|
37
|
-
config.build.assetsInlineLimit = 1e8;
|
|
38
|
-
config.build.chunkSizeWarningLimit = 1e8;
|
|
39
|
-
config.build.cssCodeSplit = false;
|
|
40
|
-
config.build.reportCompressedSize = false;
|
|
41
|
-
config.base = void 0;
|
|
42
|
-
config.resolve ?? (config.resolve = {});
|
|
43
|
-
config.resolve.extensions = import_extensions.extensions;
|
|
44
|
-
(_a = config.resolve).alias ?? (_a.alias = {});
|
|
45
|
-
config.resolve.alias = {
|
|
46
|
-
...config.resolve.alias,
|
|
47
|
-
"react-native/Libraries/Renderer/shims/ReactFabric": "react-native/Libraries/Renderer/shims/ReactFabric",
|
|
48
|
-
"react-native/Libraries/Utilities/codegenNativeComponent": "react-native/Libraries/Utilities/codegenNativeComponent",
|
|
49
|
-
"react-native-svg": "react-native-svg",
|
|
50
|
-
"react-native-web": "react-native",
|
|
51
|
-
"react-native": "react-native"
|
|
52
|
-
};
|
|
53
|
-
config.optimizeDeps ?? (config.optimizeDeps = {});
|
|
54
|
-
(_b = config.optimizeDeps).esbuildOptions ?? (_b.esbuildOptions = {});
|
|
55
|
-
config.optimizeDeps.esbuildOptions.resolveExtensions = import_extensions.extensions;
|
|
56
|
-
(_c = config.optimizeDeps.esbuildOptions).plugins ?? (_c.plugins = []);
|
|
57
|
-
config.optimizeDeps.esbuildOptions.plugins.push(
|
|
58
|
-
(0, import_vite_plugin_flow.esbuildFlowPlugin)(
|
|
59
|
-
/node_modules\/(react-native\/|@react-native\/assets)/,
|
|
60
|
-
(_) => "jsx"
|
|
61
|
-
)
|
|
62
|
-
);
|
|
63
|
-
(_d = config.optimizeDeps).include ?? (_d.include = []);
|
|
64
|
-
config.optimizeDeps.include.push("react-native");
|
|
65
|
-
(_e = config.optimizeDeps.esbuildOptions).loader ?? (_e.loader = {});
|
|
66
|
-
config.optimizeDeps.esbuildOptions.loader[".js"] = "jsx";
|
|
67
|
-
config.optimizeDeps.esbuildOptions.plugins.push({
|
|
68
|
-
name: "react-native-assets",
|
|
69
|
-
setup(build) {
|
|
70
|
-
build.onResolve(
|
|
71
|
-
{
|
|
72
|
-
filter: /\.(png|jpg|gif|webp)$/
|
|
73
|
-
},
|
|
74
|
-
async ({ path, namespace }) => {
|
|
75
|
-
return {
|
|
76
|
-
path: "",
|
|
77
|
-
external: true
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
(_f = config.build).rollupOptions ?? (_f.rollupOptions = {});
|
|
84
|
-
config.build.rollupOptions.input = "/Users/n8/tamagui/apps/kitchen-sink/src/index.tsx";
|
|
85
|
-
(_g = config.build.rollupOptions).output ?? (_g.output = {});
|
|
86
|
-
(_h = config.build.rollupOptions).plugins ?? (_h.plugins = []);
|
|
87
|
-
config.build.rollupOptions.external = ["react-native", "react", "react/jsx-runtime"];
|
|
88
|
-
if (!Array.isArray(config.build.rollupOptions.plugins)) {
|
|
89
|
-
throw `x`;
|
|
90
|
-
}
|
|
91
|
-
if (process.env.DEBUG) {
|
|
92
|
-
console.log("config..", config);
|
|
93
|
-
}
|
|
94
|
-
config.build.commonjsOptions = {
|
|
95
|
-
include: /node_modules\/react\//
|
|
96
|
-
};
|
|
97
|
-
config.build.rollupOptions.plugins.push({
|
|
98
|
-
name: `swap-react-native`,
|
|
99
|
-
async load(id) {
|
|
100
|
-
if (id.endsWith("react-native/index.js")) {
|
|
101
|
-
const bundled = await (0, import_promises.readFile)(
|
|
102
|
-
(0, import_path.join)(process.cwd(), "react-native.js"),
|
|
103
|
-
"utf-8"
|
|
104
|
-
);
|
|
105
|
-
const code = bundled;
|
|
106
|
-
return {
|
|
107
|
-
code: `
|
|
1
|
+
"use strict";var n=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var D=(e,t)=>{for(var a in t)n(e,a,{get:t[a],enumerable:!0})},w=(e,t,a,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of A(t))!x.call(e,s)&&s!==a&&n(e,s,{get:()=>t[s],enumerable:!(r=y(t,s))||r.enumerable});return e};var I=e=>w(n({},"__esModule",{value:!0}),e);var L={};D(L,{nativePlugin:()=>P});module.exports=I(L);var v=require("fs/promises"),O=require("path"),h=require("@bunchtogether/vite-plugin-flow"),l=require("./extensions.js");function P(){return{name:"tamagui-native",enforce:"post",config:e=>{var a,r,s,p,u,d,m,b;if(e.build||(e.build={}),e.build.modulePreload={polyfill:!1},e.build.assetsInlineLimit=1e8,e.build.chunkSizeWarningLimit=1e8,e.build.cssCodeSplit=!1,e.build.reportCompressedSize=!1,e.base=void 0,e.resolve??(e.resolve={}),e.resolve.extensions=l.extensions,(a=e.resolve).alias??(a.alias={}),e.resolve.alias={...e.resolve.alias,"react-native/Libraries/Renderer/shims/ReactFabric":"react-native/Libraries/Renderer/shims/ReactFabric","react-native/Libraries/Utilities/codegenNativeComponent":"react-native/Libraries/Utilities/codegenNativeComponent","react-native-svg":"react-native-svg","react-native-web":"react-native","react-native":"react-native"},e.optimizeDeps??(e.optimizeDeps={}),(r=e.optimizeDeps).esbuildOptions??(r.esbuildOptions={}),e.optimizeDeps.esbuildOptions.resolveExtensions=l.extensions,(s=e.optimizeDeps.esbuildOptions).plugins??(s.plugins=[]),e.optimizeDeps.esbuildOptions.plugins.push((0,h.esbuildFlowPlugin)(/node_modules\/(react-native\/|@react-native\/assets)/,i=>"jsx")),(p=e.optimizeDeps).include??(p.include=[]),e.optimizeDeps.include.push("react-native"),(u=e.optimizeDeps.esbuildOptions).loader??(u.loader={}),e.optimizeDeps.esbuildOptions.loader[".js"]="jsx",e.optimizeDeps.esbuildOptions.plugins.push({name:"react-native-assets",setup(i){i.onResolve({filter:/\.(png|jpg|gif|webp)$/},async({path:o,namespace:S})=>({path:"",external:!0}))}}),(d=e.build).rollupOptions??(d.rollupOptions={}),e.build.rollupOptions.input="/Users/n8/tamagui/apps/kitchen-sink/src/index.tsx",(m=e.build.rollupOptions).output??(m.output={}),(b=e.build.rollupOptions).plugins??(b.plugins=[]),e.build.rollupOptions.external=["react-native","react","react/jsx-runtime"],!Array.isArray(e.build.rollupOptions.plugins))throw"x";process.env.DEBUG&&console.log("config..",e),e.build.commonjsOptions={include:/node_modules\/react\//},e.build.rollupOptions.plugins.push({name:"swap-react-native",async load(i){if(i.endsWith("react-native/index.js")){const o=await(0,v.readFile)((0,O.join)(process.cwd(),"react-native.js"),"utf-8"),S=o;return{code:`
|
|
108
2
|
const run = () => {
|
|
109
|
-
${
|
|
110
|
-
`module.exports = require_react_native();`,
|
|
111
|
-
`return require_react_native();`
|
|
112
|
-
)}
|
|
3
|
+
${o.replace("module.exports = require_react_native();","return require_react_native();")}
|
|
113
4
|
}
|
|
114
5
|
|
|
115
6
|
const RN = run()
|
|
116
7
|
|
|
117
|
-
${
|
|
118
|
-
|
|
119
|
-
// adding exports
|
|
120
|
-
`export const ${name} = RN.${name}`
|
|
121
|
-
)
|
|
122
|
-
).join("\n")}
|
|
8
|
+
${z.map(c=>`export const ${c} = RN.${c}`).join(`
|
|
9
|
+
`)}
|
|
123
10
|
|
|
124
|
-
`
|
|
125
|
-
};
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
const updateOutputOptions = (out) => {
|
|
130
|
-
out.inlineDynamicImports = true;
|
|
131
|
-
out.manualChunks = void 0;
|
|
132
|
-
};
|
|
133
|
-
if (Array.isArray(config.build.rollupOptions.output)) {
|
|
134
|
-
for (const o in config.build.rollupOptions.output)
|
|
135
|
-
updateOutputOptions(o);
|
|
136
|
-
} else {
|
|
137
|
-
updateOutputOptions(config.build.rollupOptions.output);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
const RNExportNames = [
|
|
143
|
-
"AccessibilityInfo",
|
|
144
|
-
"ActivityIndicator",
|
|
145
|
-
"Button",
|
|
146
|
-
"DatePickerIOS",
|
|
147
|
-
"DrawerLayoutAndroid",
|
|
148
|
-
"FlatList",
|
|
149
|
-
"Image",
|
|
150
|
-
"ImageBackground",
|
|
151
|
-
"InputAccessoryView",
|
|
152
|
-
"KeyboardAvoidingView",
|
|
153
|
-
"MaskedViewIOS",
|
|
154
|
-
"Modal",
|
|
155
|
-
"Pressable",
|
|
156
|
-
"ProgressBarAndroid",
|
|
157
|
-
"ProgressViewIOS",
|
|
158
|
-
"RefreshControl",
|
|
159
|
-
"SafeAreaView",
|
|
160
|
-
"ScrollView",
|
|
161
|
-
"SectionList",
|
|
162
|
-
"Slider",
|
|
163
|
-
"StatusBar",
|
|
164
|
-
"Switch",
|
|
165
|
-
"Text",
|
|
166
|
-
"TextInput",
|
|
167
|
-
"Touchable",
|
|
168
|
-
"TouchableHighlight",
|
|
169
|
-
"TouchableNativeFeedback",
|
|
170
|
-
"TouchableOpacity",
|
|
171
|
-
"TouchableWithoutFeedback",
|
|
172
|
-
"View",
|
|
173
|
-
"VirtualizedList",
|
|
174
|
-
"VirtualizedSectionList",
|
|
175
|
-
"ActionSheetIOS",
|
|
176
|
-
"Alert",
|
|
177
|
-
"Animated",
|
|
178
|
-
"Appearance",
|
|
179
|
-
"AppRegistry",
|
|
180
|
-
"AppState",
|
|
181
|
-
"AsyncStorage",
|
|
182
|
-
"BackHandler",
|
|
183
|
-
"Clipboard",
|
|
184
|
-
"DeviceInfo",
|
|
185
|
-
"DevSettings",
|
|
186
|
-
"Dimensions",
|
|
187
|
-
"Easing",
|
|
188
|
-
"findNodeHandle",
|
|
189
|
-
"I18nManager",
|
|
190
|
-
"ImagePickerIOS",
|
|
191
|
-
"InteractionManager",
|
|
192
|
-
"Keyboard",
|
|
193
|
-
"LayoutAnimation",
|
|
194
|
-
"Linking",
|
|
195
|
-
"LogBox",
|
|
196
|
-
"NativeDialogManagerAndroid",
|
|
197
|
-
"NativeEventEmitter",
|
|
198
|
-
"Networking",
|
|
199
|
-
"PanResponder",
|
|
200
|
-
"PermissionsAndroid",
|
|
201
|
-
"PixelRatio",
|
|
202
|
-
// 'PushNotificationIOS',
|
|
203
|
-
"Settings",
|
|
204
|
-
"Share",
|
|
205
|
-
"StyleSheet",
|
|
206
|
-
"Systrace",
|
|
207
|
-
"ToastAndroid",
|
|
208
|
-
"TurboModuleRegistry",
|
|
209
|
-
"UIManager",
|
|
210
|
-
"unstable_batchedUpdates",
|
|
211
|
-
"useColorScheme",
|
|
212
|
-
"useWindowDimensions",
|
|
213
|
-
"UTFSequence",
|
|
214
|
-
"Vibration",
|
|
215
|
-
"YellowBox",
|
|
216
|
-
"DeviceEventEmitter",
|
|
217
|
-
"DynamicColorIOS",
|
|
218
|
-
"NativeAppEventEmitter",
|
|
219
|
-
"NativeModules",
|
|
220
|
-
"Platform",
|
|
221
|
-
"PlatformColor",
|
|
222
|
-
"processColor",
|
|
223
|
-
"requireNativeComponent",
|
|
224
|
-
"RootTagContext"
|
|
225
|
-
// 'unstable_enableLogBox',
|
|
226
|
-
// 'ColorPropType',
|
|
227
|
-
// 'EdgeInsetsPropType',
|
|
228
|
-
// 'PointPropType',
|
|
229
|
-
// 'ViewPropTypes',
|
|
230
|
-
];
|
|
231
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
232
|
-
0 && (module.exports = {
|
|
233
|
-
nativePlugin
|
|
234
|
-
});
|
|
11
|
+
`}}}});const t=i=>{i.inlineDynamicImports=!0,i.manualChunks=void 0};if(Array.isArray(e.build.rollupOptions.output))for(const i in e.build.rollupOptions.output)t(i);else t(e.build.rollupOptions.output)}}}const z=["AccessibilityInfo","ActivityIndicator","Button","DatePickerIOS","DrawerLayoutAndroid","FlatList","Image","ImageBackground","InputAccessoryView","KeyboardAvoidingView","MaskedViewIOS","Modal","Pressable","ProgressBarAndroid","ProgressViewIOS","RefreshControl","SafeAreaView","ScrollView","SectionList","Slider","StatusBar","Switch","Text","TextInput","Touchable","TouchableHighlight","TouchableNativeFeedback","TouchableOpacity","TouchableWithoutFeedback","View","VirtualizedList","VirtualizedSectionList","ActionSheetIOS","Alert","Animated","Appearance","AppRegistry","AppState","AsyncStorage","BackHandler","Clipboard","DeviceInfo","DevSettings","Dimensions","Easing","findNodeHandle","I18nManager","ImagePickerIOS","InteractionManager","Keyboard","LayoutAnimation","Linking","LogBox","NativeDialogManagerAndroid","NativeEventEmitter","Networking","PanResponder","PermissionsAndroid","PixelRatio","Settings","Share","StyleSheet","Systrace","ToastAndroid","TurboModuleRegistry","UIManager","unstable_batchedUpdates","useColorScheme","useWindowDimensions","UTFSequence","Vibration","YellowBox","DeviceEventEmitter","DynamicColorIOS","NativeAppEventEmitter","NativeModules","Platform","PlatformColor","processColor","requireNativeComponent","RootTagContext"];0&&(module.exports={nativePlugin});
|
|
235
12
|
//# sourceMappingURL=native.js.map
|