@tamagui/static 1.61.2 → 1.62.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/constants.js +8 -19
- package/dist/cjs/constants.js.map +1 -1
- package/dist/cjs/constants.native.js +43 -0
- package/dist/cjs/constants.native.js.map +6 -0
- package/dist/cjs/extractor/accessSafe.js +8 -14
- package/dist/cjs/extractor/accessSafe.js.map +1 -1
- package/dist/cjs/extractor/accessSafe.native.js +52 -0
- package/dist/cjs/extractor/accessSafe.native.js.map +6 -0
- package/dist/cjs/extractor/babelParse.js +9 -17
- package/dist/cjs/extractor/babelParse.js.map +1 -1
- package/dist/cjs/extractor/babelParse.native.js +65 -0
- package/dist/cjs/extractor/babelParse.native.js.map +6 -0
- package/dist/cjs/extractor/buildClassName.js +44 -67
- package/dist/cjs/extractor/buildClassName.js.map +1 -1
- package/dist/cjs/extractor/buildClassName.native.js +78 -0
- package/dist/cjs/extractor/buildClassName.native.js.map +6 -0
- package/dist/cjs/extractor/bundle.js +44 -79
- package/dist/cjs/extractor/bundle.js.map +1 -1
- package/dist/cjs/extractor/bundle.native.js +118 -0
- package/dist/cjs/extractor/bundle.native.js.map +6 -0
- package/dist/cjs/extractor/bundleConfig.js +107 -204
- package/dist/cjs/extractor/bundleConfig.js.map +1 -1
- package/dist/cjs/extractor/bundleConfig.native.js +316 -0
- package/dist/cjs/extractor/bundleConfig.native.js.map +6 -0
- package/dist/cjs/extractor/createEvaluator.js +13 -41
- package/dist/cjs/extractor/createEvaluator.js.map +1 -1
- package/dist/cjs/extractor/createEvaluator.native.js +60 -0
- package/dist/cjs/extractor/createEvaluator.native.js.map +6 -0
- package/dist/cjs/extractor/createExtractor.js +497 -1128
- package/dist/cjs/extractor/createExtractor.js.map +2 -2
- package/dist/cjs/extractor/createExtractor.native.js +1067 -0
- package/dist/cjs/extractor/createExtractor.native.js.map +6 -0
- package/dist/cjs/extractor/ensureImportingConcat.js +12 -23
- package/dist/cjs/extractor/ensureImportingConcat.js.map +1 -1
- package/dist/cjs/extractor/ensureImportingConcat.native.js +55 -0
- package/dist/cjs/extractor/ensureImportingConcat.native.js.map +6 -0
- package/dist/cjs/extractor/esbuildAliasPlugin.js +40 -0
- package/dist/cjs/extractor/esbuildAliasPlugin.js.map +6 -0
- package/dist/cjs/extractor/esbuildAliasPlugin.native.js +41 -0
- package/dist/cjs/extractor/esbuildAliasPlugin.native.js.map +6 -0
- package/dist/cjs/extractor/evaluateAstNode.js +67 -95
- package/dist/cjs/extractor/evaluateAstNode.js.map +1 -1
- package/dist/cjs/extractor/evaluateAstNode.native.js +104 -0
- package/dist/cjs/extractor/evaluateAstNode.native.js.map +6 -0
- package/dist/cjs/extractor/extractHelpers.js +43 -123
- package/dist/cjs/extractor/extractHelpers.js.map +1 -1
- package/dist/cjs/extractor/extractHelpers.native.js +131 -0
- package/dist/cjs/extractor/extractHelpers.native.js.map +6 -0
- package/dist/cjs/extractor/extractMediaStyle.js +42 -110
- package/dist/cjs/extractor/extractMediaStyle.js.map +1 -1
- package/dist/cjs/extractor/extractMediaStyle.native.js +127 -0
- package/dist/cjs/extractor/extractMediaStyle.native.js.map +6 -0
- package/dist/cjs/extractor/extractToClassNames.js +134 -254
- package/dist/cjs/extractor/extractToClassNames.js.map +1 -1
- package/dist/cjs/extractor/extractToClassNames.native.js +304 -0
- package/dist/cjs/extractor/extractToClassNames.native.js.map +6 -0
- package/dist/cjs/extractor/findTopmostFunction.js +9 -17
- package/dist/cjs/extractor/findTopmostFunction.js.map +1 -1
- package/dist/cjs/extractor/findTopmostFunction.native.js +37 -0
- package/dist/cjs/extractor/findTopmostFunction.native.js.map +6 -0
- package/dist/cjs/extractor/generateTamaguiStudioConfig.js +34 -78
- package/dist/cjs/extractor/generateTamaguiStudioConfig.js.map +1 -1
- package/dist/cjs/extractor/generateTamaguiStudioConfig.native.js +120 -0
- package/dist/cjs/extractor/generateTamaguiStudioConfig.native.js.map +6 -0
- package/dist/cjs/extractor/generatedUid.js +14 -28
- package/dist/cjs/extractor/generatedUid.js.map +1 -1
- package/dist/cjs/extractor/generatedUid.native.js +47 -0
- package/dist/cjs/extractor/generatedUid.native.js.map +6 -0
- package/dist/cjs/extractor/getPrefixLogs.js +6 -10
- package/dist/cjs/extractor/getPrefixLogs.js.map +1 -1
- package/dist/cjs/extractor/getPrefixLogs.native.js +29 -0
- package/dist/cjs/extractor/getPrefixLogs.native.js.map +6 -0
- package/dist/cjs/extractor/getPropValueFromAttributes.js +21 -42
- package/dist/cjs/extractor/getPropValueFromAttributes.js.map +1 -1
- package/dist/cjs/extractor/getPropValueFromAttributes.native.js +70 -0
- package/dist/cjs/extractor/getPropValueFromAttributes.native.js.map +6 -0
- package/dist/cjs/extractor/getSourceModule.js +23 -57
- package/dist/cjs/extractor/getSourceModule.js.map +1 -1
- package/dist/cjs/extractor/getSourceModule.native.js +71 -0
- package/dist/cjs/extractor/getSourceModule.native.js.map +6 -0
- package/dist/cjs/extractor/getStaticBindingsForScope.js +42 -116
- package/dist/cjs/extractor/getStaticBindingsForScope.js.map +1 -1
- package/dist/cjs/extractor/getStaticBindingsForScope.native.js +153 -0
- package/dist/cjs/extractor/getStaticBindingsForScope.native.js.map +6 -0
- package/dist/cjs/extractor/getTamaguiConfigPathFromOptionsConfig.js +6 -13
- package/dist/cjs/extractor/getTamaguiConfigPathFromOptionsConfig.js.map +1 -1
- package/dist/cjs/extractor/getTamaguiConfigPathFromOptionsConfig.native.js +29 -0
- package/dist/cjs/extractor/getTamaguiConfigPathFromOptionsConfig.native.js.map +6 -0
- package/dist/cjs/extractor/hoistClassNames.js +16 -30
- package/dist/cjs/extractor/hoistClassNames.js.map +1 -1
- package/dist/cjs/extractor/hoistClassNames.native.js +66 -0
- package/dist/cjs/extractor/hoistClassNames.native.js.map +6 -0
- package/dist/cjs/extractor/literalToAst.js +32 -53
- package/dist/cjs/extractor/literalToAst.js.map +1 -1
- package/dist/cjs/extractor/literalToAst.native.js +96 -0
- package/dist/cjs/extractor/literalToAst.native.js.map +6 -0
- package/dist/cjs/extractor/loadFile.js +4 -11
- package/dist/cjs/extractor/loadFile.js.map +1 -1
- package/dist/cjs/extractor/loadFile.native.js +15 -0
- package/dist/cjs/extractor/loadFile.native.js.map +6 -0
- package/dist/cjs/extractor/loadTamagui.js +76 -147
- package/dist/cjs/extractor/loadTamagui.js.map +1 -1
- package/dist/cjs/extractor/loadTamagui.native.js +240 -0
- package/dist/cjs/extractor/loadTamagui.native.js.map +6 -0
- package/dist/cjs/extractor/logLines.js +12 -22
- package/dist/cjs/extractor/logLines.js.map +1 -1
- package/dist/cjs/extractor/logLines.native.js +35 -0
- package/dist/cjs/extractor/logLines.native.js.map +6 -0
- package/dist/cjs/extractor/normalizeTernaries.js +27 -54
- package/dist/cjs/extractor/normalizeTernaries.js.map +1 -1
- package/dist/cjs/extractor/normalizeTernaries.native.js +64 -0
- package/dist/cjs/extractor/normalizeTernaries.native.js.map +6 -0
- package/dist/cjs/extractor/propsToFontFamilyCache.js +6 -11
- package/dist/cjs/extractor/propsToFontFamilyCache.js.map +1 -1
- package/dist/cjs/extractor/propsToFontFamilyCache.native.js +41 -0
- package/dist/cjs/extractor/propsToFontFamilyCache.native.js.map +6 -0
- package/dist/cjs/extractor/removeUnusedHooks.js +25 -56
- package/dist/cjs/extractor/removeUnusedHooks.js.map +1 -1
- package/dist/cjs/extractor/removeUnusedHooks.native.js +80 -0
- package/dist/cjs/extractor/removeUnusedHooks.native.js.map +6 -0
- package/dist/cjs/extractor/timer.js +9 -20
- package/dist/cjs/extractor/timer.js.map +1 -1
- package/dist/cjs/extractor/timer.native.js +43 -0
- package/dist/cjs/extractor/timer.native.js.map +6 -0
- package/dist/cjs/extractor/validHTMLAttributes.js +51 -55
- package/dist/cjs/extractor/validHTMLAttributes.js.map +1 -1
- package/dist/cjs/extractor/validHTMLAttributes.native.js +73 -0
- package/dist/cjs/extractor/validHTMLAttributes.native.js.map +6 -0
- package/dist/cjs/getPragmaOptions.js +12 -38
- package/dist/cjs/getPragmaOptions.js.map +1 -1
- package/dist/cjs/getPragmaOptions.native.js +43 -0
- package/dist/cjs/getPragmaOptions.native.js.map +6 -0
- package/dist/cjs/helpers/memoize.js +10 -19
- package/dist/cjs/helpers/memoize.js.map +1 -1
- package/dist/cjs/helpers/memoize.native.js +38 -0
- package/dist/cjs/helpers/memoize.native.js.map +6 -0
- package/dist/cjs/helpers/requireTamaguiCore.js +29 -0
- package/dist/cjs/helpers/requireTamaguiCore.js.map +6 -0
- package/dist/cjs/helpers/requireTamaguiCore.native.js +30 -0
- package/dist/cjs/helpers/requireTamaguiCore.native.js.map +6 -0
- package/dist/cjs/index.js +7 -35
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.native.js +21 -0
- package/dist/cjs/index.native.js.map +6 -0
- package/dist/cjs/registerRequire.js +93 -0
- package/dist/cjs/registerRequire.js.map +6 -0
- package/dist/cjs/registerRequire.native.js +94 -0
- package/dist/cjs/registerRequire.native.js.map +6 -0
- package/dist/cjs/setup.js +2 -0
- package/dist/cjs/setup.js.map +6 -0
- package/dist/cjs/setup.native.js +3 -0
- package/dist/cjs/setup.native.js.map +6 -0
- package/dist/cjs/static.js +41 -0
- package/dist/cjs/static.js.map +6 -0
- package/dist/cjs/static.native.js +42 -0
- package/dist/cjs/static.native.js.map +6 -0
- package/dist/cjs/types.js +3 -6
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/types.native.js +15 -0
- package/dist/cjs/types.native.js.map +6 -0
- package/dist/cjs/webpackPlugin.js +5 -9
- package/dist/cjs/webpackPlugin.js.map +1 -1
- package/dist/cjs/webpackPlugin.native.js +32 -0
- package/dist/cjs/webpackPlugin.native.js.map +6 -0
- package/dist/esm/constants.js +1 -6
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/extractor/accessSafe.js +1 -1
- package/dist/esm/extractor/accessSafe.js.map +1 -1
- package/dist/esm/extractor/babelParse.js +2 -4
- package/dist/esm/extractor/babelParse.js.map +1 -1
- package/dist/esm/extractor/buildClassName.js +37 -54
- package/dist/esm/extractor/buildClassName.js.map +1 -1
- package/dist/esm/extractor/bundle.js +36 -60
- package/dist/esm/extractor/bundle.js.map +1 -1
- package/dist/esm/extractor/bundleConfig.js +100 -180
- package/dist/esm/extractor/bundleConfig.js.map +1 -1
- package/dist/esm/extractor/createEvaluator.js +5 -22
- package/dist/esm/extractor/createEvaluator.js.map +1 -1
- package/dist/esm/extractor/createExtractor.js +484 -1098
- package/dist/esm/extractor/createExtractor.js.map +2 -2
- package/dist/esm/extractor/ensureImportingConcat.js +5 -10
- package/dist/esm/extractor/ensureImportingConcat.js.map +1 -1
- package/dist/esm/extractor/esbuildAliasPlugin.js +20 -0
- package/dist/esm/extractor/esbuildAliasPlugin.js.map +6 -0
- package/dist/esm/extractor/evaluateAstNode.js +60 -82
- package/dist/esm/extractor/evaluateAstNode.js.map +1 -1
- package/dist/esm/extractor/extractHelpers.js +35 -105
- package/dist/esm/extractor/extractHelpers.js.map +1 -1
- package/dist/esm/extractor/extractMediaStyle.js +35 -97
- package/dist/esm/extractor/extractMediaStyle.js.map +1 -1
- package/dist/esm/extractor/extractToClassNames.js +126 -224
- package/dist/esm/extractor/extractToClassNames.js.map +1 -1
- package/dist/esm/extractor/findTopmostFunction.js +4 -8
- package/dist/esm/extractor/findTopmostFunction.js.map +1 -1
- package/dist/esm/extractor/generateTamaguiStudioConfig.js +25 -59
- package/dist/esm/extractor/generateTamaguiStudioConfig.js.map +1 -1
- package/dist/esm/extractor/generatedUid.js +7 -15
- package/dist/esm/extractor/generatedUid.js.map +1 -1
- package/dist/esm/extractor/getPrefixLogs.js +1 -1
- package/dist/esm/extractor/getPrefixLogs.js.map +1 -1
- package/dist/esm/extractor/getPropValueFromAttributes.js +13 -26
- package/dist/esm/extractor/getPropValueFromAttributes.js.map +1 -1
- package/dist/esm/extractor/getSourceModule.js +16 -44
- package/dist/esm/extractor/getSourceModule.js.map +1 -1
- package/dist/esm/extractor/getStaticBindingsForScope.js +34 -98
- package/dist/esm/extractor/getStaticBindingsForScope.js.map +1 -1
- package/dist/esm/extractor/getTamaguiConfigPathFromOptionsConfig.js +1 -4
- package/dist/esm/extractor/getTamaguiConfigPathFromOptionsConfig.js.map +1 -1
- package/dist/esm/extractor/hoistClassNames.js +9 -17
- package/dist/esm/extractor/hoistClassNames.js.map +1 -1
- package/dist/esm/extractor/literalToAst.js +25 -40
- package/dist/esm/extractor/literalToAst.js.map +1 -1
- package/dist/esm/extractor/loadFile.js +4 -10
- package/dist/esm/extractor/loadFile.js.map +1 -1
- package/dist/esm/extractor/loadTamagui.js +69 -124
- package/dist/esm/extractor/loadTamagui.js.map +1 -1
- package/dist/esm/extractor/logLines.js +7 -13
- package/dist/esm/extractor/logLines.js.map +1 -1
- package/dist/esm/extractor/normalizeTernaries.js +19 -38
- package/dist/esm/extractor/normalizeTernaries.js.map +1 -1
- package/dist/esm/extractor/propsToFontFamilyCache.js +1 -2
- package/dist/esm/extractor/propsToFontFamilyCache.js.map +1 -1
- package/dist/esm/extractor/removeUnusedHooks.js +18 -43
- package/dist/esm/extractor/removeUnusedHooks.js.map +1 -1
- package/dist/esm/extractor/timer.js +4 -11
- package/dist/esm/extractor/timer.js.map +1 -1
- package/dist/esm/extractor/validHTMLAttributes.js +46 -46
- package/dist/esm/getPragmaOptions.js +7 -29
- package/dist/esm/getPragmaOptions.js.map +1 -1
- package/dist/esm/helpers/memoize.js +5 -10
- package/dist/esm/helpers/memoize.js.map +1 -1
- package/dist/esm/helpers/requireTamaguiCore.js +9 -0
- package/dist/esm/helpers/requireTamaguiCore.js.map +6 -0
- package/dist/esm/index.js +2 -14
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/registerRequire.js +73 -0
- package/dist/esm/registerRequire.js.map +6 -0
- package/dist/esm/setup.js +2 -0
- package/dist/esm/setup.js.map +6 -0
- package/dist/esm/static.js +15 -0
- package/dist/esm/static.js.map +6 -0
- package/package.json +15 -15
- package/src/extractor/bundle.ts +12 -10
- package/src/extractor/bundleConfig.ts +25 -20
- package/src/extractor/createEvaluator.ts +0 -16
- package/src/extractor/createExtractor.ts +12 -9
- package/src/extractor/esbuildAliasPlugin.ts +40 -0
- package/src/extractor/extractMediaStyle.ts +3 -5
- package/src/extractor/extractToClassNames.ts +2 -1
- package/src/extractor/generateTamaguiStudioConfig.ts +3 -1
- package/src/extractor/loadTamagui.ts +26 -22
- package/src/helpers/requireTamaguiCore.ts +13 -0
- package/src/index.ts +2 -9
- package/src/registerRequire.ts +156 -0
- package/src/setup.ts +1 -0
- package/src/static.ts +9 -0
- package/src/types.ts +3 -1
- package/types/extractor/bundle.d.ts +2 -2
- package/types/extractor/bundle.d.ts.map +1 -1
- package/types/extractor/bundleConfig.d.ts.map +1 -1
- package/types/extractor/createEvaluator.d.ts.map +1 -1
- package/types/extractor/createExtractor.d.ts +1 -1
- package/types/extractor/createExtractor.d.ts.map +1 -1
- package/types/extractor/esbuildAliasPlugin.d.ts +18 -0
- package/types/extractor/esbuildAliasPlugin.d.ts.map +1 -0
- package/types/extractor/extractMediaStyle.d.ts +1 -1
- package/types/extractor/extractMediaStyle.d.ts.map +1 -1
- package/types/extractor/extractToClassNames.d.ts.map +1 -1
- package/types/extractor/generateTamaguiStudioConfig.d.ts.map +1 -1
- package/types/extractor/loadTamagui.d.ts +2 -2
- package/types/extractor/loadTamagui.d.ts.map +1 -1
- package/types/helpers/requireTamaguiCore.d.ts +3 -0
- package/types/helpers/requireTamaguiCore.d.ts.map +1 -0
- package/types/index.d.ts +2 -9
- package/types/index.d.ts.map +1 -1
- package/types/registerRequire.d.ts +7 -0
- package/types/registerRequire.d.ts.map +1 -0
- package/types/setup.d.ts +2 -0
- package/types/setup.d.ts.map +1 -0
- package/types/static.d.ts +10 -0
- package/types/static.d.ts.map +1 -0
- package/types/types.d.ts +2 -1
- package/types/types.d.ts.map +1 -1
- package/dist/cjs/require.js +0 -125
- package/dist/cjs/require.js.map +0 -6
- package/dist/esm/require.js +0 -100
- package/dist/esm/require.js.map +0 -6
- package/src/require.ts +0 -150
- package/types/require.d.ts +0 -3
- package/types/require.d.ts.map +0 -1
|
@@ -0,0 +1,120 @@
|
|
|
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, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
10
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
22
|
+
mod
|
|
23
|
+
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
24
|
+
var generateTamaguiStudioConfig_exports = {};
|
|
25
|
+
__export(generateTamaguiStudioConfig_exports, {
|
|
26
|
+
generateTamaguiStudioConfig: () => generateTamaguiStudioConfig,
|
|
27
|
+
generateTamaguiStudioConfigSync: () => generateTamaguiStudioConfigSync,
|
|
28
|
+
generateTamaguiThemes: () => generateTamaguiThemes
|
|
29
|
+
});
|
|
30
|
+
module.exports = __toCommonJS(generateTamaguiStudioConfig_exports);
|
|
31
|
+
var import_path = require("path"), import_generate_themes = require("@tamagui/generate-themes"), import_fs_extra = __toESM(require("fs-extra")), import_requireTamaguiCore = require("../helpers/requireTamaguiCore"), import_bundleConfig = require("./bundleConfig");
|
|
32
|
+
const tamaguiDir = (0, import_path.join)(process.cwd(), ".tamagui"), confFile = (0, import_path.join)(tamaguiDir, "tamagui.config.json");
|
|
33
|
+
async function generateTamaguiStudioConfig(tamaguiOptions, configIn, rebuild = !1) {
|
|
34
|
+
try {
|
|
35
|
+
const config = configIn ?? await (0, import_bundleConfig.getBundledConfig)(tamaguiOptions, rebuild);
|
|
36
|
+
if (!config)
|
|
37
|
+
return;
|
|
38
|
+
const out = transformConfig(config);
|
|
39
|
+
import_fs_extra.default.writeJSON(confFile, out, {
|
|
40
|
+
spaces: 2
|
|
41
|
+
});
|
|
42
|
+
} catch (err) {
|
|
43
|
+
(process.env.DEBUG?.includes("tamagui") || process.env.IS_TAMAGUI_DEV) && console.warn("generateTamaguiStudioConfig error", err);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
async function generateTamaguiThemes(tamaguiOptions) {
|
|
47
|
+
if (!tamaguiOptions.themeBuilder)
|
|
48
|
+
return;
|
|
49
|
+
const { input, output } = tamaguiOptions.themeBuilder, inPath = resolveRelativePath(input), outPath = resolveRelativePath(output), generatedOutput = await (0, import_generate_themes.generateThemes)(inPath), hasChanged = await (async () => {
|
|
50
|
+
try {
|
|
51
|
+
if (!await import_fs_extra.default.pathExists(
|
|
52
|
+
(0, import_path.join)(tamaguiDir, "theme-builder.json")
|
|
53
|
+
))
|
|
54
|
+
return !0;
|
|
55
|
+
if (!generatedOutput)
|
|
56
|
+
return !1;
|
|
57
|
+
const next = generatedOutput.generated, current = await (0, import_fs_extra.readFile)(outPath, "utf-8");
|
|
58
|
+
return next !== current;
|
|
59
|
+
} catch {
|
|
60
|
+
}
|
|
61
|
+
return !0;
|
|
62
|
+
})();
|
|
63
|
+
return hasChanged && await (0, import_generate_themes.writeGeneratedThemes)(tamaguiDir, outPath, generatedOutput), hasChanged;
|
|
64
|
+
}
|
|
65
|
+
const resolveRelativePath = (inputPath) => inputPath.startsWith(".") ? (0, import_path.join)(process.cwd(), inputPath) : require.resolve(inputPath);
|
|
66
|
+
function generateTamaguiStudioConfigSync(_tamaguiOptions, config) {
|
|
67
|
+
try {
|
|
68
|
+
import_fs_extra.default.writeJSONSync(confFile, transformConfig(config), {
|
|
69
|
+
spaces: 2
|
|
70
|
+
});
|
|
71
|
+
} catch (err) {
|
|
72
|
+
(process.env.DEBUG?.includes("tamagui") || process.env.IS_TAMAGUI_DEV) && console.warn("generateTamaguiStudioConfig error", err);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function cloneDeepSafe(x, excludeKeys = {}) {
|
|
76
|
+
return x && (Array.isArray(x) ? x.map((_) => cloneDeepSafe(_)) : typeof x == "function" ? "Function" : typeof x != "object" ? x : "$$typeof" in x ? "Component" : Object.fromEntries(
|
|
77
|
+
Object.entries(x).flatMap(([k, v]) => excludeKeys[k] ? [] : [[k, cloneDeepSafe(v)]])
|
|
78
|
+
));
|
|
79
|
+
}
|
|
80
|
+
function transformConfig(config) {
|
|
81
|
+
if (!config)
|
|
82
|
+
return null;
|
|
83
|
+
const { getVariableValue } = (0, import_requireTamaguiCore.requireTamaguiCore)("web"), next = cloneDeepSafe(config, {
|
|
84
|
+
validStyles: !0
|
|
85
|
+
}), { components, nameToPaths, tamaguiConfig } = next, { themes, tokens } = tamaguiConfig;
|
|
86
|
+
for (const key in themes) {
|
|
87
|
+
const theme = themes[key];
|
|
88
|
+
theme.id = key;
|
|
89
|
+
for (const tkey in theme)
|
|
90
|
+
theme[tkey] = getVariableValue(theme[tkey]);
|
|
91
|
+
}
|
|
92
|
+
for (const key in tokens) {
|
|
93
|
+
const token = { ...tokens[key] };
|
|
94
|
+
for (const tkey in token)
|
|
95
|
+
token[tkey] = getVariableValue(token[tkey]);
|
|
96
|
+
}
|
|
97
|
+
for (const component of components)
|
|
98
|
+
for (const _ in component.nameToInfo) {
|
|
99
|
+
const compDefinition = { ...component.nameToInfo[_] };
|
|
100
|
+
component.nameToInfo[_] = compDefinition;
|
|
101
|
+
const { parentStaticConfig, ...rest } = compDefinition.staticConfig;
|
|
102
|
+
compDefinition.staticConfig = rest;
|
|
103
|
+
}
|
|
104
|
+
next.nameToPaths = {};
|
|
105
|
+
for (const key in nameToPaths)
|
|
106
|
+
next.nameToPaths[key] = [...nameToPaths[key]];
|
|
107
|
+
const { fontsParsed, getCSS, tokensParsed, themeConfig, ...cleanedConfig } = next.tamaguiConfig;
|
|
108
|
+
return {
|
|
109
|
+
components,
|
|
110
|
+
nameToPaths,
|
|
111
|
+
tamaguiConfig: cleanedConfig
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
115
|
+
0 && (module.exports = {
|
|
116
|
+
generateTamaguiStudioConfig,
|
|
117
|
+
generateTamaguiStudioConfigSync,
|
|
118
|
+
generateTamaguiThemes
|
|
119
|
+
});
|
|
120
|
+
//# sourceMappingURL=generateTamaguiStudioConfig.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/extractor/generateTamaguiStudioConfig.ts"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAqB,iBAErB,yBAAqD,qCAErD,kBAA6B,8BAE7B,4BAAmC,0CACnC,sBAAgD;AAEhD,MAAM,iBAAa,kBAAK,QAAQ,IAAI,GAAG,UAAU,GAC3C,eAAW,kBAAK,YAAY,qBAAqB;AAMvD,eAAsB,4BACpB,gBACA,UACA,UAAU,IACV;AACA,MAA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AAChB,SAAK,YAAY,GAAG,IAAI,CAAC,GAAG,YAAY,GAAG,CAAC;AAI9C,QAAM,EAAE,aAAa,QAAQ,cAAc,aAAa,GAAG,cAAc,IACvE,KAAK;AAEP,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,eAAe;AAAA,EACjB;AACF;",
|
|
5
|
+
"names": ["fs"]
|
|
6
|
+
}
|
|
@@ -1,20 +1,15 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable:
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
14
11
|
for (let key of __getOwnPropNames(from))
|
|
15
|
-
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
12
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
13
|
return to;
|
|
19
14
|
};
|
|
20
15
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
@@ -22,10 +17,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
22
17
|
// file that has been converted to a CommonJS file using a Babel-
|
|
23
18
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
19
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable:
|
|
20
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
26
21
|
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
|
+
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
29
23
|
var generatedUid_exports = {};
|
|
30
24
|
__export(generatedUid_exports, {
|
|
31
25
|
generateUid: () => generateUid
|
|
@@ -33,25 +27,17 @@ __export(generatedUid_exports, {
|
|
|
33
27
|
module.exports = __toCommonJS(generatedUid_exports);
|
|
34
28
|
var t = __toESM(require("@babel/types"));
|
|
35
29
|
function generateUid(scope, name) {
|
|
36
|
-
if (
|
|
30
|
+
if (typeof scope != "object")
|
|
37
31
|
throw "generateUid expects a scope object as its first parameter";
|
|
38
|
-
if (!(typeof name
|
|
32
|
+
if (!(typeof name == "string" && name !== ""))
|
|
39
33
|
throw "generateUid expects a valid name as its second parameter";
|
|
40
34
|
name = t.toIdentifier(name).replace(/^_+/, "").replace(/[0-9]+$/g, "");
|
|
41
|
-
let uid;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
uid = name + i;
|
|
46
|
-
} else {
|
|
47
|
-
uid = name;
|
|
48
|
-
}
|
|
49
|
-
i++;
|
|
50
|
-
} while (scope.hasLabel(uid) || scope.hasBinding(uid) || scope.hasGlobal(uid) || scope.hasReference(uid));
|
|
35
|
+
let uid, i = 0;
|
|
36
|
+
do
|
|
37
|
+
i > 1 ? uid = name + i : uid = name, i++;
|
|
38
|
+
while (scope.hasLabel(uid) || scope.hasBinding(uid) || scope.hasGlobal(uid) || scope.hasReference(uid));
|
|
51
39
|
const program = scope.getProgramParent();
|
|
52
|
-
program.references[uid] =
|
|
53
|
-
program.uids[uid] = true;
|
|
54
|
-
return uid;
|
|
40
|
+
return program.references[uid] = !0, program.uids[uid] = !0, uid;
|
|
55
41
|
}
|
|
56
42
|
// Annotate the CommonJS export names for ESM import in node:
|
|
57
43
|
0 && (module.exports = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/extractor/generatedUid.ts"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAAmB;AASZ,SAAS,YAAY,OAAY,MAAsB;AAC5D,MAAM,OAAO,SAAU;AACrB,UAAM;AACR,MAAI,EAAE,OAAO,QAAS,YAAY,SAAS;AACzC,UAAM;AAER,SAAO,EACJ,aAAa,IAAI,EACjB,QAAQ,OAAO,EAAE,EACjB,QAAQ,YAAY,EAAE;AAEzB,MAAI,KACA,IAAI;AACR;AACE,IAAI,IAAI,IACN,MAAM,OAAO,IAEb,MAAM,MAER;AAAA,SAEA,MAAM,SAAS,GAAG,KAClB,MAAM,WAAW,GAAG,KACpB,MAAM,UAAU,GAAG,KACnB,MAAM,aAAa,GAAG;AAGxB,QAAM,UAAU,MAAM,iBAAiB;AACvC,iBAAQ,WAAW,GAAG,IAAI,IAC1B,QAAQ,KAAK,GAAG,IAAI,IAEb;AACT;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
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, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
10
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
22
|
+
mod
|
|
23
|
+
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
24
|
+
var generatedUid_exports = {};
|
|
25
|
+
__export(generatedUid_exports, {
|
|
26
|
+
generateUid: () => generateUid
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(generatedUid_exports);
|
|
29
|
+
var t = __toESM(require("@babel/types"));
|
|
30
|
+
function generateUid(scope, name) {
|
|
31
|
+
if (typeof scope != "object")
|
|
32
|
+
throw "generateUid expects a scope object as its first parameter";
|
|
33
|
+
if (!(typeof name == "string" && name !== ""))
|
|
34
|
+
throw "generateUid expects a valid name as its second parameter";
|
|
35
|
+
name = t.toIdentifier(name).replace(/^_+/, "").replace(/[0-9]+$/g, "");
|
|
36
|
+
let uid, i = 0;
|
|
37
|
+
do
|
|
38
|
+
i > 1 ? uid = name + i : uid = name, i++;
|
|
39
|
+
while (scope.hasLabel(uid) || scope.hasBinding(uid) || scope.hasGlobal(uid) || scope.hasReference(uid));
|
|
40
|
+
const program = scope.getProgramParent();
|
|
41
|
+
return program.references[uid] = !0, program.uids[uid] = !0, uid;
|
|
42
|
+
}
|
|
43
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
+
0 && (module.exports = {
|
|
45
|
+
generateUid
|
|
46
|
+
});
|
|
47
|
+
//# sourceMappingURL=generatedUid.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/extractor/generatedUid.ts"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAAmB;AASZ,SAAS,YAAY,OAAY,MAAsB;AAC5D,MAAM,OAAO,SAAU;AACrB,UAAM;AACR,MAAI,EAAE,OAAO,QAAS,YAAY,SAAS;AACzC,UAAM;AAER,SAAO,EACJ,aAAa,IAAI,EACjB,QAAQ,OAAO,EAAE,EACjB,QAAQ,YAAY,EAAE;AAEzB,MAAI,KACA,IAAI;AACR;AACE,IAAI,IAAI,IACN,MAAM,OAAO,IAEb,MAAM,MAER;AAAA,SAEA,MAAM,SAAS,GAAG,KAClB,MAAM,WAAW,GAAG,KACpB,MAAM,UAAU,GAAG,KACnB,MAAM,aAAa,GAAG;AAGxB,QAAM,UAAU,MAAM,iBAAiB;AACvC,iBAAQ,WAAW,GAAG,IAAI,IAC1B,QAAQ,KAAK,GAAG,IAAI,IAEb;AACT;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
5
|
var __export = (target, all) => {
|
|
7
6
|
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable:
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
8
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
12
10
|
for (let key of __getOwnPropNames(from))
|
|
13
|
-
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
11
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
12
|
return to;
|
|
17
13
|
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value:
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
19
15
|
var getPrefixLogs_exports = {};
|
|
20
16
|
__export(getPrefixLogs_exports, {
|
|
21
17
|
getPrefixLogs: () => getPrefixLogs
|
|
@@ -23,7 +19,7 @@ __export(getPrefixLogs_exports, {
|
|
|
23
19
|
module.exports = __toCommonJS(getPrefixLogs_exports);
|
|
24
20
|
function getPrefixLogs(options) {
|
|
25
21
|
const { TAMAGUI_TARGET } = process.env;
|
|
26
|
-
return
|
|
22
|
+
return options?.prefixLogs ?? ` ${TAMAGUI_TARGET} | `;
|
|
27
23
|
}
|
|
28
24
|
// Annotate the CommonJS export names for ESM import in node:
|
|
29
25
|
0 && (module.exports = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/extractor/getPrefixLogs.ts"],
|
|
4
|
-
"mappings": "
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,SAAS,cAAc,SAA0B;AACtD,QAAM,EAAE,eAAe,IAAI,QAAQ;AACnC,SAAO,SAAS,cAAc,IAAI,cAAc;AAClD;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
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: !0 });
|
|
9
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
return to;
|
|
14
|
+
};
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
|
+
var getPrefixLogs_exports = {};
|
|
17
|
+
__export(getPrefixLogs_exports, {
|
|
18
|
+
getPrefixLogs: () => getPrefixLogs
|
|
19
|
+
});
|
|
20
|
+
module.exports = __toCommonJS(getPrefixLogs_exports);
|
|
21
|
+
function getPrefixLogs(options) {
|
|
22
|
+
const { TAMAGUI_TARGET } = process.env;
|
|
23
|
+
return options?.prefixLogs ?? ` ${TAMAGUI_TARGET} | `;
|
|
24
|
+
}
|
|
25
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
26
|
+
0 && (module.exports = {
|
|
27
|
+
getPrefixLogs
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=getPrefixLogs.js.map
|
|
@@ -1,20 +1,15 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable:
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
14
11
|
for (let key of __getOwnPropNames(from))
|
|
15
|
-
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
12
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
13
|
return to;
|
|
19
14
|
};
|
|
20
15
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
@@ -22,66 +17,50 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
22
17
|
// file that has been converted to a CommonJS file using a Babel-
|
|
23
18
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
19
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable:
|
|
20
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
26
21
|
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
|
+
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
29
23
|
var getPropValueFromAttributes_exports = {};
|
|
30
24
|
__export(getPropValueFromAttributes_exports, {
|
|
31
25
|
getPropValueFromAttributes: () => getPropValueFromAttributes
|
|
32
26
|
});
|
|
33
27
|
module.exports = __toCommonJS(getPropValueFromAttributes_exports);
|
|
34
|
-
var import_generator = __toESM(require("@babel/generator"));
|
|
35
|
-
var t = __toESM(require("@babel/types"));
|
|
36
|
-
var import_accessSafe = require("./accessSafe");
|
|
28
|
+
var import_generator = __toESM(require("@babel/generator")), t = __toESM(require("@babel/types")), import_accessSafe = require("./accessSafe");
|
|
37
29
|
function getPropValueFromAttributes(propName, attrs) {
|
|
38
|
-
let propIndex = -1;
|
|
39
|
-
let jsxAttr = null;
|
|
30
|
+
let propIndex = -1, jsxAttr = null;
|
|
40
31
|
for (let idx = -1, len = attrs.length; ++idx < len; ) {
|
|
41
32
|
const attr = attrs[idx];
|
|
42
33
|
if (t.isJSXAttribute(attr) && attr.name && attr.name.name === propName) {
|
|
43
|
-
propIndex = idx;
|
|
44
|
-
jsxAttr = attr;
|
|
34
|
+
propIndex = idx, jsxAttr = attr;
|
|
45
35
|
break;
|
|
46
36
|
}
|
|
47
37
|
}
|
|
48
|
-
if (!jsxAttr || jsxAttr.value == null)
|
|
38
|
+
if (!jsxAttr || jsxAttr.value == null)
|
|
49
39
|
return null;
|
|
50
|
-
}
|
|
51
40
|
let propValue = jsxAttr.value;
|
|
52
|
-
if (t.isJSXExpressionContainer(propValue))
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
if (t.isJSXEmptyExpression(propValue)) {
|
|
56
|
-
console.error("encountered JSXEmptyExpression");
|
|
57
|
-
return null;
|
|
58
|
-
}
|
|
41
|
+
if (t.isJSXExpressionContainer(propValue) && (propValue = propValue.expression), t.isJSXEmptyExpression(propValue))
|
|
42
|
+
return console.error("encountered JSXEmptyExpression"), null;
|
|
59
43
|
const applicableSpreads = attrs.filter(
|
|
60
44
|
// 1. idx is greater than propValue prop index
|
|
61
45
|
// 2. attr is a spread operator
|
|
62
46
|
(attr, idx) => {
|
|
63
47
|
if (t.isJSXSpreadAttribute(attr)) {
|
|
64
|
-
if (t.isIdentifier(attr.argument) || t.isMemberExpression(attr.argument))
|
|
48
|
+
if (t.isIdentifier(attr.argument) || t.isMemberExpression(attr.argument))
|
|
65
49
|
return idx > propIndex;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
return false;
|
|
69
|
-
}
|
|
50
|
+
if (t.isLogicalExpression(attr.argument))
|
|
51
|
+
return !1;
|
|
70
52
|
throw new Error(
|
|
71
53
|
`unsupported spread of type "${attr.argument.type}": ${// @ts-ignore
|
|
72
54
|
(0, import_generator.default)(attr).code}`
|
|
73
55
|
);
|
|
74
56
|
}
|
|
75
|
-
return
|
|
57
|
+
return !1;
|
|
76
58
|
}
|
|
77
59
|
).map((attr) => attr.argument);
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
return propValue;
|
|
60
|
+
return applicableSpreads.length > 0 && (propValue = applicableSpreads.reduce(
|
|
61
|
+
(acc, val) => t.logicalExpression("||", (0, import_accessSafe.accessSafe)(val, propName), acc),
|
|
62
|
+
propValue
|
|
63
|
+
)), propValue;
|
|
85
64
|
}
|
|
86
65
|
// Annotate the CommonJS export names for ESM import in node:
|
|
87
66
|
0 && (module.exports = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/extractor/getPropValueFromAttributes.ts"],
|
|
4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": ["generate"]
|
|
6
6
|
}
|
|
@@ -0,0 +1,70 @@
|
|
|
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, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
10
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
22
|
+
mod
|
|
23
|
+
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
24
|
+
var getPropValueFromAttributes_exports = {};
|
|
25
|
+
__export(getPropValueFromAttributes_exports, {
|
|
26
|
+
getPropValueFromAttributes: () => getPropValueFromAttributes
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(getPropValueFromAttributes_exports);
|
|
29
|
+
var import_generator = __toESM(require("@babel/generator")), t = __toESM(require("@babel/types")), import_accessSafe = require("./accessSafe");
|
|
30
|
+
function getPropValueFromAttributes(propName, attrs) {
|
|
31
|
+
let propIndex = -1, jsxAttr = null;
|
|
32
|
+
for (let idx = -1, len = attrs.length; ++idx < len; ) {
|
|
33
|
+
const attr = attrs[idx];
|
|
34
|
+
if (t.isJSXAttribute(attr) && attr.name && attr.name.name === propName) {
|
|
35
|
+
propIndex = idx, jsxAttr = attr;
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
if (!jsxAttr || jsxAttr.value == null)
|
|
40
|
+
return null;
|
|
41
|
+
let propValue = jsxAttr.value;
|
|
42
|
+
if (t.isJSXExpressionContainer(propValue) && (propValue = propValue.expression), t.isJSXEmptyExpression(propValue))
|
|
43
|
+
return console.error("encountered JSXEmptyExpression"), null;
|
|
44
|
+
const applicableSpreads = attrs.filter(
|
|
45
|
+
// 1. idx is greater than propValue prop index
|
|
46
|
+
// 2. attr is a spread operator
|
|
47
|
+
(attr, idx) => {
|
|
48
|
+
if (t.isJSXSpreadAttribute(attr)) {
|
|
49
|
+
if (t.isIdentifier(attr.argument) || t.isMemberExpression(attr.argument))
|
|
50
|
+
return idx > propIndex;
|
|
51
|
+
if (t.isLogicalExpression(attr.argument))
|
|
52
|
+
return !1;
|
|
53
|
+
throw new Error(
|
|
54
|
+
`unsupported spread of type "${attr.argument.type}": ${// @ts-ignore
|
|
55
|
+
(0, import_generator.default)(attr).code}`
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
return !1;
|
|
59
|
+
}
|
|
60
|
+
).map((attr) => attr.argument);
|
|
61
|
+
return applicableSpreads.length > 0 && (propValue = applicableSpreads.reduce(
|
|
62
|
+
(acc, val) => t.logicalExpression("||", (0, import_accessSafe.accessSafe)(val, propName), acc),
|
|
63
|
+
propValue
|
|
64
|
+
)), propValue;
|
|
65
|
+
}
|
|
66
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
67
|
+
0 && (module.exports = {
|
|
68
|
+
getPropValueFromAttributes
|
|
69
|
+
});
|
|
70
|
+
//# sourceMappingURL=getPropValueFromAttributes.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/extractor/getPropValueFromAttributes.ts"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAqB,sCACrB,IAAmB,kCAEnB,oBAA2B;AAkBpB,SAAS,2BACd,UACA,OACqB;AACrB,MAAI,YAAY,IACZ,UAAiC;AACrC,WAAS,MAAM,IAAI,MAAM,MAAM,QAAQ,EAAE,MAAM,OAAO;AACpD,UAAM,OAAO,MAAM,GAAG;AACtB,QAAI,EAAE,eAAe,IAAI,KAAK,KAAK,QAAQ,KAAK,KAAK,SAAS,UAAU;AACtE,kBAAY,KACZ,UAAU;AACV;AAAA,IACF;AAAA,EACF;AAEA,MAAI,CAAC,WAAW,QAAQ,SAAS;AAC/B,WAAO;AAGT,MAAI,YAMe,QAAQ;AAO3B,MALI,EAAE,yBAAyB,SAAS,MACtC,YAAY,UAAU,aAIpB,EAAE,qBAAqB,SAAS;AAClC,mBAAQ,MAAM,gCAAgC,GACvC;AAIT,QAAM,oBAAoB,MACvB;AAAA;AAAA;AAAA,IAGC,CAAC,MAAM,QAAsC;AAC3C,UAAI,EAAE,qBAAqB,IAAI,GAAG;AAChC,YAAI,EAAE,aAAa,KAAK,QAAQ,KAAK,EAAE,mBAAmB,KAAK,QAAQ;AACrE,iBAAO,MAAM;AAEf,YAAI,EAAE,oBAAoB,KAAK,QAAQ;AACrC,iBAAO;AAET,cAAM,IAAI;AAAA,UACR,+BAA+B,KAAK,SAAS,IAAI;AAAA,cAE/C,iBAAAA,SAAS,IAAW,EAAE,IACxB;AAAA,QACF;AAAA,MACF;AACA,aAAO;AAAA,IACT;AAAA,EACF,EACC,IAAI,CAAC,SAAS,KAAK,QAAQ;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