@hanzogui/static 2.0.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.
Files changed (207) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -0
  3. package/dist/check-dep-versions.cjs +267 -0
  4. package/dist/checkDeps.cjs +200 -0
  5. package/dist/constants.cjs +49 -0
  6. package/dist/exports.cjs +44 -0
  7. package/dist/extractor/accessSafe.cjs +46 -0
  8. package/dist/extractor/babelParse.cjs +54 -0
  9. package/dist/extractor/buildClassName.cjs +62 -0
  10. package/dist/extractor/bundle.cjs +185 -0
  11. package/dist/extractor/bundleConfig.cjs +513 -0
  12. package/dist/extractor/concatClassName.cjs +80 -0
  13. package/dist/extractor/createEvaluator.cjs +75 -0
  14. package/dist/extractor/createExtractor.cjs +1150 -0
  15. package/dist/extractor/createLogger.cjs +45 -0
  16. package/dist/extractor/detectModuleFormat.cjs +49 -0
  17. package/dist/extractor/ensureImportingConcat.cjs +48 -0
  18. package/dist/extractor/errors.cjs +26 -0
  19. package/dist/extractor/esbuildAliasPlugin.cjs +44 -0
  20. package/dist/extractor/esbuildTsconfigPaths.cjs +86 -0
  21. package/dist/extractor/evaluateAstNode.cjs +83 -0
  22. package/dist/extractor/extractHelpers.cjs +119 -0
  23. package/dist/extractor/extractMediaStyle.cjs +128 -0
  24. package/dist/extractor/extractToClassNames.cjs +321 -0
  25. package/dist/extractor/extractToNative.cjs +266 -0
  26. package/dist/extractor/findTopmostFunction.cjs +34 -0
  27. package/dist/extractor/generatedUid.cjs +47 -0
  28. package/dist/extractor/getGuiConfigPathFromOptionsConfig.cjs +35 -0
  29. package/dist/extractor/getPrefixLogs.cjs +29 -0
  30. package/dist/extractor/getPropValueFromAttributes.cjs +67 -0
  31. package/dist/extractor/getSourceModule.cjs +64 -0
  32. package/dist/extractor/getStaticBindingsForScope.cjs +150 -0
  33. package/dist/extractor/hoistClassNames.cjs +62 -0
  34. package/dist/extractor/literalToAst.cjs +84 -0
  35. package/dist/extractor/loadFile.cjs +11 -0
  36. package/dist/extractor/loadGui.cjs +322 -0
  37. package/dist/extractor/logLines.cjs +35 -0
  38. package/dist/extractor/normalizeTernaries.cjs +73 -0
  39. package/dist/extractor/propsToFontFamilyCache.cjs +38 -0
  40. package/dist/extractor/regenerateConfig.cjs +150 -0
  41. package/dist/extractor/removeUnusedHooks.cjs +76 -0
  42. package/dist/extractor/timer.cjs +43 -0
  43. package/dist/extractor/validHTMLAttributes.cjs +77 -0
  44. package/dist/extractor/watchGuiConfig.cjs +58 -0
  45. package/dist/getPragmaOptions.cjs +58 -0
  46. package/dist/helpers/memoize.cjs +37 -0
  47. package/dist/helpers/requireGuiCore.cjs +33 -0
  48. package/dist/index.cjs +40 -0
  49. package/dist/registerRequire.cjs +115 -0
  50. package/dist/server.cjs +75 -0
  51. package/dist/setup.cjs +0 -0
  52. package/dist/types.cjs +16 -0
  53. package/dist/worker.cjs +89 -0
  54. package/package.json +101 -0
  55. package/src/check-dep-versions.ts +738 -0
  56. package/src/checkDeps.ts +371 -0
  57. package/src/constants.ts +14 -0
  58. package/src/exports.ts +15 -0
  59. package/src/extractor/accessSafe.ts +22 -0
  60. package/src/extractor/babelParse.ts +37 -0
  61. package/src/extractor/buildClassName.ts +76 -0
  62. package/src/extractor/bundle.ts +277 -0
  63. package/src/extractor/bundleConfig.ts +958 -0
  64. package/src/extractor/concatClassName.ts +105 -0
  65. package/src/extractor/createEvaluator.ts +82 -0
  66. package/src/extractor/createExtractor.ts +2665 -0
  67. package/src/extractor/createLogger.ts +41 -0
  68. package/src/extractor/detectModuleFormat.ts +42 -0
  69. package/src/extractor/ensureImportingConcat.ts +36 -0
  70. package/src/extractor/errors.ts +1 -0
  71. package/src/extractor/esbuildAliasPlugin.ts +40 -0
  72. package/src/extractor/esbuildTsconfigPaths.ts +103 -0
  73. package/src/extractor/evaluateAstNode.ts +136 -0
  74. package/src/extractor/extractHelpers.ts +211 -0
  75. package/src/extractor/extractMediaStyle.ts +194 -0
  76. package/src/extractor/extractToClassNames.ts +631 -0
  77. package/src/extractor/extractToNative.ts +463 -0
  78. package/src/extractor/findTopmostFunction.ts +24 -0
  79. package/src/extractor/generatedUid.ts +41 -0
  80. package/src/extractor/getGuiConfigPathFromOptionsConfig.ts +24 -0
  81. package/src/extractor/getPrefixLogs.ts +9 -0
  82. package/src/extractor/getPropValueFromAttributes.ts +95 -0
  83. package/src/extractor/getSourceModule.ts +96 -0
  84. package/src/extractor/getStaticBindingsForScope.ts +237 -0
  85. package/src/extractor/hoistClassNames.ts +52 -0
  86. package/src/extractor/literalToAst.ts +85 -0
  87. package/src/extractor/loadFile.ts +17 -0
  88. package/src/extractor/loadGui.ts +487 -0
  89. package/src/extractor/logLines.ts +16 -0
  90. package/src/extractor/normalizeTernaries.ts +75 -0
  91. package/src/extractor/propsToFontFamilyCache.ts +18 -0
  92. package/src/extractor/regenerateConfig.ts +186 -0
  93. package/src/extractor/removeUnusedHooks.ts +83 -0
  94. package/src/extractor/timer.ts +25 -0
  95. package/src/extractor/validHTMLAttributes.ts +52 -0
  96. package/src/extractor/watchGuiConfig.ts +57 -0
  97. package/src/getPragmaOptions.ts +57 -0
  98. package/src/helpers/memoize.ts +24 -0
  99. package/src/helpers/requireGuiCore.ts +28 -0
  100. package/src/index.ts +4 -0
  101. package/src/registerRequire.ts +236 -0
  102. package/src/server.ts +43 -0
  103. package/src/setup.ts +0 -0
  104. package/src/types.ts +109 -0
  105. package/src/worker.ts +142 -0
  106. package/types/check-dep-versions.d.ts +37 -0
  107. package/types/check-dep-versions.d.ts.map +1 -0
  108. package/types/checkDeps.d.ts +19 -0
  109. package/types/checkDeps.d.ts.map +1 -0
  110. package/types/constants.d.ts +6 -0
  111. package/types/constants.d.ts.map +1 -0
  112. package/types/exports.d.ts +16 -0
  113. package/types/exports.d.ts.map +1 -0
  114. package/types/extractor/accessSafe.d.ts +3 -0
  115. package/types/extractor/accessSafe.d.ts.map +1 -0
  116. package/types/extractor/babelParse.d.ts +5 -0
  117. package/types/extractor/babelParse.d.ts.map +1 -0
  118. package/types/extractor/buildClassName.d.ts +7 -0
  119. package/types/extractor/buildClassName.d.ts.map +1 -0
  120. package/types/extractor/bundle.d.ts +121 -0
  121. package/types/extractor/bundle.d.ts.map +1 -0
  122. package/types/extractor/bundleConfig.d.ts +49 -0
  123. package/types/extractor/bundleConfig.d.ts.map +1 -0
  124. package/types/extractor/concatClassName.d.ts +8 -0
  125. package/types/extractor/concatClassName.d.ts.map +1 -0
  126. package/types/extractor/createEvaluator.d.ts +12 -0
  127. package/types/extractor/createEvaluator.d.ts.map +1 -0
  128. package/types/extractor/createExtractor.d.ts +32 -0
  129. package/types/extractor/createExtractor.d.ts.map +1 -0
  130. package/types/extractor/createLogger.d.ts +3 -0
  131. package/types/extractor/createLogger.d.ts.map +1 -0
  132. package/types/extractor/detectModuleFormat.d.ts +5 -0
  133. package/types/extractor/detectModuleFormat.d.ts.map +1 -0
  134. package/types/extractor/ensureImportingConcat.d.ts +4 -0
  135. package/types/extractor/ensureImportingConcat.d.ts.map +1 -0
  136. package/types/extractor/errors.d.ts +3 -0
  137. package/types/extractor/errors.d.ts.map +1 -0
  138. package/types/extractor/esbuildAliasPlugin.d.ts +18 -0
  139. package/types/extractor/esbuildAliasPlugin.d.ts.map +1 -0
  140. package/types/extractor/esbuildTsconfigPaths.d.ts +11 -0
  141. package/types/extractor/esbuildTsconfigPaths.d.ts.map +1 -0
  142. package/types/extractor/evaluateAstNode.d.ts +3 -0
  143. package/types/extractor/evaluateAstNode.d.ts.map +1 -0
  144. package/types/extractor/extractHelpers.d.ts +28 -0
  145. package/types/extractor/extractHelpers.d.ts.map +1 -0
  146. package/types/extractor/extractMediaStyle.d.ts +11 -0
  147. package/types/extractor/extractMediaStyle.d.ts.map +1 -0
  148. package/types/extractor/extractToClassNames.d.ts +25 -0
  149. package/types/extractor/extractToClassNames.d.ts.map +1 -0
  150. package/types/extractor/extractToNative.d.ts +13 -0
  151. package/types/extractor/extractToNative.d.ts.map +1 -0
  152. package/types/extractor/findTopmostFunction.d.ts +4 -0
  153. package/types/extractor/findTopmostFunction.d.ts.map +1 -0
  154. package/types/extractor/generatedUid.d.ts +5 -0
  155. package/types/extractor/generatedUid.d.ts.map +1 -0
  156. package/types/extractor/getGuiConfigPathFromOptionsConfig.d.ts +3 -0
  157. package/types/extractor/getGuiConfigPathFromOptionsConfig.d.ts.map +1 -0
  158. package/types/extractor/getPrefixLogs.d.ts +3 -0
  159. package/types/extractor/getPrefixLogs.d.ts.map +1 -0
  160. package/types/extractor/getPropValueFromAttributes.d.ts +19 -0
  161. package/types/extractor/getPropValueFromAttributes.d.ts.map +1 -0
  162. package/types/extractor/getSourceModule.d.ts +16 -0
  163. package/types/extractor/getSourceModule.d.ts.map +1 -0
  164. package/types/extractor/getStaticBindingsForScope.d.ts +5 -0
  165. package/types/extractor/getStaticBindingsForScope.d.ts.map +1 -0
  166. package/types/extractor/hoistClassNames.d.ts +6 -0
  167. package/types/extractor/hoistClassNames.d.ts.map +1 -0
  168. package/types/extractor/literalToAst.d.ts +4 -0
  169. package/types/extractor/literalToAst.d.ts.map +1 -0
  170. package/types/extractor/loadFile.d.ts +1 -0
  171. package/types/extractor/loadFile.d.ts.map +1 -0
  172. package/types/extractor/loadGui.d.ts +22 -0
  173. package/types/extractor/loadGui.d.ts.map +1 -0
  174. package/types/extractor/logLines.d.ts +2 -0
  175. package/types/extractor/logLines.d.ts.map +1 -0
  176. package/types/extractor/normalizeTernaries.d.ts +3 -0
  177. package/types/extractor/normalizeTernaries.d.ts.map +1 -0
  178. package/types/extractor/propsToFontFamilyCache.d.ts +4 -0
  179. package/types/extractor/propsToFontFamilyCache.d.ts.map +1 -0
  180. package/types/extractor/regenerateConfig.d.ts +9 -0
  181. package/types/extractor/regenerateConfig.d.ts.map +1 -0
  182. package/types/extractor/removeUnusedHooks.d.ts +3 -0
  183. package/types/extractor/removeUnusedHooks.d.ts.map +1 -0
  184. package/types/extractor/timer.d.ts +5 -0
  185. package/types/extractor/timer.d.ts.map +1 -0
  186. package/types/extractor/validHTMLAttributes.d.ts +52 -0
  187. package/types/extractor/validHTMLAttributes.d.ts.map +1 -0
  188. package/types/extractor/watchGuiConfig.d.ts +5 -0
  189. package/types/extractor/watchGuiConfig.d.ts.map +1 -0
  190. package/types/getPragmaOptions.d.ts +8 -0
  191. package/types/getPragmaOptions.d.ts.map +1 -0
  192. package/types/helpers/memoize.d.ts +8 -0
  193. package/types/helpers/memoize.d.ts.map +1 -0
  194. package/types/helpers/requireGuiCore.d.ts +3 -0
  195. package/types/helpers/requireGuiCore.d.ts.map +1 -0
  196. package/types/index.d.ts +4 -0
  197. package/types/index.d.ts.map +1 -0
  198. package/types/registerRequire.d.ts +10 -0
  199. package/types/registerRequire.d.ts.map +1 -0
  200. package/types/server.d.ts +3 -0
  201. package/types/server.d.ts.map +1 -0
  202. package/types/setup.d.ts +1 -0
  203. package/types/setup.d.ts.map +1 -0
  204. package/types/types.d.ts +92 -0
  205. package/types/types.d.ts.map +1 -0
  206. package/types/worker.d.ts +46 -0
  207. package/types/worker.d.ts.map +1 -0
@@ -0,0 +1,45 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: !0
9
+ });
10
+ },
11
+ __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
13
+ get: () => from[key],
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ });
16
+ return to;
17
+ };
18
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
+ value: !0
20
+ }), mod);
21
+ var createLogger_exports = {};
22
+ __export(createLogger_exports, {
23
+ createLogger: () => createLogger
24
+ });
25
+ module.exports = __toCommonJS(createLogger_exports);
26
+ var import_node_path = require("node:path"),
27
+ import_getPrefixLogs = require("./getPrefixLogs.cjs");
28
+ function createLogger(sourcePath, options) {
29
+ const shouldLogTiming = options.logTimings ?? !0,
30
+ start = Date.now(),
31
+ mem = process.env.HANZO_GUI_SHOW_MEMORY_USAGE && shouldLogTiming ? process.memoryUsage() : null;
32
+ return res => {
33
+ if (!shouldLogTiming) return;
34
+ const memUsed = mem ? Math.round((process.memoryUsage().heapUsed - mem.heapUsed) / 1024 / 1204 * 10) / 10 : 0,
35
+ path = (0, import_node_path.basename)(sourcePath || "").replace(/\.[jt]sx?$/, "").slice(0, 22).trim().padEnd(24),
36
+ numOptimized = `${res.optimized + res.styled}`.padStart(3),
37
+ numFound = `${res.found + res.styled}`.padStart(3),
38
+ numFlattened = `${res.flattened}`.padStart(3),
39
+ memory = memUsed ? ` ${memUsed}MB` : "",
40
+ timingStr = `${Date.now() - start}ms`.padStart(6),
41
+ pre = (0, import_getPrefixLogs.getPrefixLogs)(options),
42
+ memStr = memory ? `(${memory})` : "";
43
+ console.info(`${pre} ${path} \xB7 ${numFound} found \xB7 ${numOptimized} opt \xB7 ${numFlattened} flat ${timingStr} ${memStr}`);
44
+ };
45
+ }
@@ -0,0 +1,49 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: !0
9
+ });
10
+ },
11
+ __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
13
+ get: () => from[key],
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ });
16
+ return to;
17
+ };
18
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
+ value: !0
20
+ }), mod);
21
+ var detectModuleFormat_exports = {};
22
+ __export(detectModuleFormat_exports, {
23
+ clearFormatCache: () => clearFormatCache,
24
+ detectModuleFormat: () => detectModuleFormat
25
+ });
26
+ module.exports = __toCommonJS(detectModuleFormat_exports);
27
+ var import_node_fs = require("node:fs"),
28
+ import_node_path = require("node:path");
29
+ const formatCache = /* @__PURE__ */new Map();
30
+ function detectModuleFormat(filePath) {
31
+ const ext = (0, import_node_path.extname)(filePath);
32
+ if (ext === ".mjs") return "esm";
33
+ if (ext === ".cjs") return "cjs";
34
+ let dir = (0, import_node_path.dirname)(filePath);
35
+ for (;;) {
36
+ if (formatCache.has(dir)) return formatCache.get(dir);
37
+ try {
38
+ const format = JSON.parse((0, import_node_fs.readFileSync)((0, import_node_path.join)(dir, "package.json"), "utf-8")).type === "module" ? "esm" : "cjs";
39
+ return formatCache.set(dir, format), format;
40
+ } catch {}
41
+ const parent = (0, import_node_path.dirname)(dir);
42
+ if (parent === dir) break;
43
+ dir = parent;
44
+ }
45
+ return "cjs";
46
+ }
47
+ function clearFormatCache() {
48
+ formatCache.clear();
49
+ }
@@ -0,0 +1,48 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf,
6
+ __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: !0
11
+ });
12
+ },
13
+ __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
15
+ get: () => from[key],
16
+ 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", {
26
+ value: mod,
27
+ enumerable: !0
28
+ }) : target, mod)),
29
+ __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
30
+ value: !0
31
+ }), mod);
32
+ var ensureImportingConcat_exports = {};
33
+ __export(ensureImportingConcat_exports, {
34
+ ensureImportingConcat: () => ensureImportingConcat
35
+ });
36
+ module.exports = __toCommonJS(ensureImportingConcat_exports);
37
+ var t = __toESM(require("@babel/types"));
38
+ const importConcatPkg = "@hanzogui/helpers";
39
+ function ensureImportingConcat(path) {
40
+ const imported = path.get("body").find(x => x.isImportDeclaration() && x.node.source.value === importConcatPkg),
41
+ importSpecifier = t.importSpecifier(t.identifier("concatClassName"), t.identifier("concatClassName"));
42
+ if (!imported) {
43
+ path.node.body.push(t.importDeclaration([importSpecifier], t.stringLiteral(importConcatPkg)));
44
+ return;
45
+ }
46
+ const specifiers = imported.node.specifiers;
47
+ specifiers.some(x => t.isImportSpecifier(x) && t.isIdentifier(x.imported) && x.imported.name === "concatClassName") || specifiers.push(t.importSpecifier(t.identifier("concatClassName"), t.identifier("concatClassName")));
48
+ }
@@ -0,0 +1,26 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: !0
9
+ });
10
+ },
11
+ __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
13
+ get: () => from[key],
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ });
16
+ return to;
17
+ };
18
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
+ value: !0
20
+ }), mod);
21
+ var errors_exports = {};
22
+ __export(errors_exports, {
23
+ BailOptimizationError: () => BailOptimizationError
24
+ });
25
+ module.exports = __toCommonJS(errors_exports);
26
+ class BailOptimizationError extends Error {}
@@ -0,0 +1,44 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: !0
9
+ });
10
+ },
11
+ __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
13
+ get: () => from[key],
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ });
16
+ return to;
17
+ };
18
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
19
+ value: !0
20
+ }), mod);
21
+ var esbuildAliasPlugin_exports = {};
22
+ __export(esbuildAliasPlugin_exports, {
23
+ esbuildAliasPlugin: () => esbuildAliasPlugin
24
+ });
25
+ module.exports = __toCommonJS(esbuildAliasPlugin_exports);
26
+ const esbuildAliasPlugin = config => {
27
+ const alias = config && Object.keys(config);
28
+ return {
29
+ name: "path-alias",
30
+ setup(build) {
31
+ if (!alias || !alias.length) return;
32
+ const main = (k, args) => ({
33
+ path: config[k].replace(/\/$/, "")
34
+ });
35
+ alias.forEach(k => {
36
+ build.onResolve({
37
+ filter: new RegExp(`^.*${k}$`)
38
+ }, args => main(k, args)), build.onResolve({
39
+ filter: new RegExp(`^.*\\/${k}\\/.*$`)
40
+ }, args => main(k, args));
41
+ });
42
+ }
43
+ };
44
+ };
@@ -0,0 +1,86 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf,
6
+ __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name2 in all) __defProp(target, name2, {
9
+ get: all[name2],
10
+ enumerable: !0
11
+ });
12
+ },
13
+ __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
15
+ get: () => from[key],
16
+ 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", {
26
+ value: mod,
27
+ enumerable: !0
28
+ }) : target, mod)),
29
+ __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
30
+ value: !0
31
+ }), mod);
32
+ var esbuildTsconfigPaths_exports = {};
33
+ __export(esbuildTsconfigPaths_exports, {
34
+ TsconfigPathsPlugin: () => TsconfigPathsPlugin,
35
+ loadCompilerOptionsFromTsconfig: () => loadCompilerOptionsFromTsconfig
36
+ });
37
+ module.exports = __toCommonJS(esbuildTsconfigPaths_exports);
38
+ var import_node_fs = __toESM(require("node:fs")),
39
+ import_node_path = __toESM(require("node:path")),
40
+ import_typescript = require("typescript");
41
+ const name = "tsconfig-paths";
42
+ function TsconfigPathsPlugin() {
43
+ const compilerOptions = loadCompilerOptionsFromTsconfig();
44
+ return {
45
+ name,
46
+ setup({
47
+ onResolve
48
+ }) {
49
+ onResolve({
50
+ filter: /.*/
51
+ }, args => {
52
+ if (args.path.startsWith("@hanzogui/")) return null;
53
+ const paths = compilerOptions.paths || {};
54
+ if (!Object.keys(paths).some(p => new RegExp(p.replace("*", "\\w*")).test(args.path))) return null;
55
+ const {
56
+ resolvedModule
57
+ } = (0, import_typescript.nodeModuleNameResolver)(args.path, args.importer, compilerOptions, import_typescript.sys);
58
+ if (!resolvedModule) return null;
59
+ const {
60
+ resolvedFileName
61
+ } = resolvedModule;
62
+ return !resolvedFileName || resolvedFileName.endsWith(".d.ts") ? null : {
63
+ path: resolvedFileName
64
+ };
65
+ });
66
+ }
67
+ };
68
+ }
69
+ function loadCompilerOptionsFromTsconfig(tsconfig) {
70
+ if (!tsconfig) {
71
+ const configPath = (0, import_typescript.findConfigFile)(process.cwd(), import_typescript.sys.fileExists, "tsconfig.json") || (0, import_typescript.findConfigFile)(process.cwd(), import_typescript.sys.fileExists, "jsconfig.json");
72
+ return configPath ? parseTsconfig(configPath) : {};
73
+ }
74
+ if (typeof tsconfig == "string") {
75
+ if (import_node_fs.default.existsSync(tsconfig)) return parseTsconfig(tsconfig);
76
+ throw new Error(`Specified tsconfig file not found: ${tsconfig}`);
77
+ }
78
+ const baseDir = process.cwd();
79
+ return (0, import_typescript.parseJsonConfigFileContent)(tsconfig, import_typescript.sys, baseDir).options;
80
+ }
81
+ function parseTsconfig(configFilePath) {
82
+ const configFile = (0, import_typescript.readConfigFile)(configFilePath, import_typescript.sys.readFile);
83
+ if (configFile.error) throw new Error(`Error reading tsconfig file '${configFilePath}': ${configFile.error.messageText}`);
84
+ const baseDir = import_node_path.default.dirname(configFilePath);
85
+ return (0, import_typescript.parseJsonConfigFileContent)(configFile.config, import_typescript.sys, baseDir).options;
86
+ }
@@ -0,0 +1,83 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf,
6
+ __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: !0
11
+ });
12
+ },
13
+ __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
15
+ get: () => from[key],
16
+ 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", {
26
+ value: mod,
27
+ enumerable: !0
28
+ }) : target, mod)),
29
+ __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
30
+ value: !0
31
+ }), mod);
32
+ var evaluateAstNode_exports = {};
33
+ __export(evaluateAstNode_exports, {
34
+ evaluateAstNode: () => evaluateAstNode
35
+ });
36
+ module.exports = __toCommonJS(evaluateAstNode_exports);
37
+ var t = __toESM(require("@babel/types"));
38
+ function evaluateAstNode(exprNode, evalFn, shouldPrintDebug) {
39
+ if (exprNode !== void 0) {
40
+ if (exprNode === null) return !0;
41
+ if (t.isJSXExpressionContainer(exprNode)) return evaluateAstNode(exprNode.expression);
42
+ if (t.isObjectExpression(exprNode)) {
43
+ const ret = {};
44
+ for (let idx = -1, len = exprNode.properties.length; ++idx < len;) {
45
+ const value = exprNode.properties[idx];
46
+ if (!t.isObjectProperty(value)) throw new Error("evaluateAstNode can only evaluate object properties");
47
+ let key;
48
+ if (value.computed) {
49
+ if (typeof evalFn != "function") throw new Error("evaluateAstNode does not support computed keys unless an eval function is provided");
50
+ key = evaluateAstNode(value.key, evalFn);
51
+ } else if (t.isIdentifier(value.key)) key = value.key.name;else if (t.isStringLiteral(value.key) || t.isNumericLiteral(value.key)) key = value.key.value;else throw new Error("Unsupported key type: " + value.key.type);
52
+ if (typeof key != "string" && typeof key != "number") throw new Error("key must be either a string or a number");
53
+ ret[key] = evaluateAstNode(value.value, evalFn);
54
+ }
55
+ return ret;
56
+ }
57
+ if (t.isArrayExpression(exprNode)) return exprNode.elements.map(x => evaluateAstNode(x, evalFn));
58
+ if (t.isUnaryExpression(exprNode) && exprNode.operator === "-") {
59
+ const ret = evaluateAstNode(exprNode.argument, evalFn);
60
+ return ret == null ? null : -ret;
61
+ }
62
+ if (t.isTemplateLiteral(exprNode)) {
63
+ if (typeof evalFn != "function") throw new Error("evaluateAstNode does not support template literals unless an eval function is provided");
64
+ let ret = "";
65
+ for (let idx = -1, len = exprNode.quasis.length; ++idx < len;) {
66
+ const quasi = exprNode.quasis[idx],
67
+ expr = exprNode.expressions[idx];
68
+ ret += quasi.value.raw, expr && (ret += evaluateAstNode(expr, evalFn));
69
+ }
70
+ return ret;
71
+ }
72
+ if (t.isNullLiteral(exprNode)) return null;
73
+ if (t.isNumericLiteral(exprNode) || t.isStringLiteral(exprNode) || t.isBooleanLiteral(exprNode)) return exprNode.value;
74
+ if (t.isBinaryExpression(exprNode)) {
75
+ if (exprNode.operator === "+") return evaluateAstNode(exprNode.left, evalFn) + evaluateAstNode(exprNode.right, evalFn);
76
+ if (exprNode.operator === "-") return evaluateAstNode(exprNode.left, evalFn) - evaluateAstNode(exprNode.right, evalFn);
77
+ if (exprNode.operator === "*") return evaluateAstNode(exprNode.left, evalFn) * evaluateAstNode(exprNode.right, evalFn);
78
+ if (exprNode.operator === "/") return evaluateAstNode(exprNode.left, evalFn) / evaluateAstNode(exprNode.right, evalFn);
79
+ }
80
+ if (typeof evalFn != "function") throw new Error("evaluateAstNode does not support non-literal values unless an eval function is provided");
81
+ return evalFn(exprNode);
82
+ }
83
+ }
@@ -0,0 +1,119 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf,
6
+ __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: !0
11
+ });
12
+ },
13
+ __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
15
+ get: () => from[key],
16
+ 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", {
26
+ value: mod,
27
+ enumerable: !0
28
+ }) : target, mod)),
29
+ __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
30
+ value: !0
31
+ }), mod);
32
+ var extractHelpers_exports = {};
33
+ __export(extractHelpers_exports, {
34
+ attrStr: () => attrStr,
35
+ findComponentName: () => findComponentName,
36
+ getValidComponent: () => getValidComponent,
37
+ getValidComponentsPaths: () => getValidComponentsPaths,
38
+ getValidImport: () => getValidImport,
39
+ isComponentPackage: () => isComponentPackage,
40
+ isInsideComponentPackage: () => isInsideComponentPackage,
41
+ isPresent: () => isPresent,
42
+ isSimpleSpread: () => isSimpleSpread,
43
+ isValidImport: () => isValidImport,
44
+ isValidModule: () => isValidModule,
45
+ isValidThemeHook: () => isValidThemeHook,
46
+ objToStr: () => objToStr,
47
+ ternaryStr: () => ternaryStr
48
+ });
49
+ module.exports = __toCommonJS(extractHelpers_exports);
50
+ var import_node_path = require("node:path"),
51
+ import_generator = __toESM(require("@babel/generator")),
52
+ t = __toESM(require("@babel/types")),
53
+ import_find_root = __toESM(require("find-root")),
54
+ import_memoize = require("../helpers/memoize.cjs");
55
+ function isPresent(input) {
56
+ return input != null;
57
+ }
58
+ function isSimpleSpread(node) {
59
+ return t.isIdentifier(node.argument) || t.isMemberExpression(node.argument);
60
+ }
61
+ const attrStr = attr => attr ? attr.type === "attr" ? getNameAttr(attr.value) : attr.type === "ternary" ? `...${ternaryStr(attr.value)}` : `${attr.type}(${objToStr(attr.value)})` : "",
62
+ objToStr = (obj, spacer = ", ") => obj ? `{${Object.entries(obj).map(([k, v]) => `${k}:${Array.isArray(v) ? "[...]" : v && typeof v == "object" ? `${objToStr(v, ",")}` : JSON.stringify(v)}`).join(spacer)}}` : `${obj}`,
63
+ getNameAttr = attr => t.isJSXSpreadAttribute(attr) ? `...${attr.argument.name}` : "name" in attr ? attr.name.name : `unknown-${attr.type}`,
64
+ ternaryStr = x => ["ternary(", t.isIdentifier(x.test) ? x.test.name : t.isMemberExpression(x.test) ? [x.test.object.name, x.test.property.name] :
65
+ // @ts-ignore
66
+ (0, import_generator.default)(x.test).code, isFilledObj(x.consequent) ? ` ? ${objToStr(x.consequent)}` : " ? \u{1F6AB}", isFilledObj(x.alternate) ? ` : ${objToStr(x.alternate)}` : " : \u{1F6AB}", ")"].flat().join(""),
67
+ isFilledObj = obj => obj && Object.keys(obj).length;
68
+ function findComponentName(scope) {
69
+ let cur = scope.path;
70
+ for (; cur.parentPath && !t.isProgram(cur.parentPath.parent);) cur = cur.parentPath;
71
+ let node = cur.parent;
72
+ if (t.isExportNamedDeclaration(node) && (node = node.declaration), t.isVariableDeclaration(node)) {
73
+ const [dec] = node.declarations;
74
+ if (t.isVariableDeclarator(dec) && t.isIdentifier(dec.id)) return dec.id.name;
75
+ }
76
+ return t.isFunctionDeclaration(node) ? node.id?.name : "";
77
+ }
78
+ function isValidThemeHook(props, jsxPath, n, sourcePath) {
79
+ if (!t.isIdentifier(n.object) || !t.isIdentifier(n.property)) return !1;
80
+ const binding = jsxPath.scope.getAllBindings()[n.object.name];
81
+ if (!binding?.path || !binding.path.isVariableDeclarator()) return !1;
82
+ const init = binding.path.node.init;
83
+ if (!init || !t.isCallExpression(init) || !t.isIdentifier(init.callee) || init.callee.name !== "useTheme") return !1;
84
+ const importNode = binding.scope.getBinding("useTheme")?.path.parent;
85
+ return !(!t.isImportDeclaration(importNode) || sourcePath && !isValidImport(props, sourcePath));
86
+ }
87
+ const isInsideComponentPackage = (props, moduleName) => getValidComponentsPaths(props).some(path => moduleName.startsWith(path)),
88
+ isComponentPackage = (props, srcName) => getValidComponentsPaths(props).some(path => srcName.startsWith(path));
89
+ function getValidComponent(props, moduleName, componentName) {
90
+ if (componentName[0].toUpperCase() !== componentName[0]) return !1;
91
+ for (const loaded of props.allLoadedComponents) {
92
+ if (!loaded) continue;
93
+ const isInModule = moduleName === "*" || moduleName.startsWith(loaded.moduleName),
94
+ foundComponent = loaded.nameToInfo[componentName];
95
+ if (isInModule && foundComponent) return foundComponent;
96
+ }
97
+ return null;
98
+ }
99
+ const isValidModule = (props, moduleName) => {
100
+ if (typeof moduleName != "string") throw new Error("No module name");
101
+ const isLocal = moduleName.startsWith(".");
102
+ return {
103
+ isLocal,
104
+ isValid: isLocal ? isInsideComponentPackage(props, moduleName) : isComponentPackage(props, moduleName)
105
+ };
106
+ },
107
+ getValidImport = (props, moduleName, componentName) => {
108
+ const {
109
+ isValid,
110
+ isLocal
111
+ } = isValidModule(props, moduleName);
112
+ return !isValid || !componentName ? null : getValidComponent(props, isLocal ? "*" : moduleName, componentName) || null;
113
+ },
114
+ isValidImport = (props, moduleName, componentName) => componentName ? !!getValidImport(props, moduleName, componentName) : isValidModule(props, moduleName).isValid,
115
+ getValidComponentPackages = (0, import_memoize.memoize)(props => [... /* @__PURE__ */new Set(["@hanzogui/core", "@hanzo/gui", ...(props.components || [])])]),
116
+ getValidComponentsPaths = (0, import_memoize.memoize)(props => getValidComponentPackages(props).flatMap(pkg => {
117
+ const root = (0, import_find_root.default)(pkg);
118
+ return [(0, import_node_path.basename)(root), pkg].filter(Boolean);
119
+ }));
@@ -0,0 +1,128 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf,
6
+ __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: !0
11
+ });
12
+ },
13
+ __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
15
+ get: () => from[key],
16
+ 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", {
26
+ value: mod,
27
+ enumerable: !0
28
+ }) : target, mod)),
29
+ __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
30
+ value: !0
31
+ }), mod);
32
+ var extractMediaStyle_exports = {};
33
+ __export(extractMediaStyle_exports, {
34
+ extractMediaStyle: () => extractMediaStyle,
35
+ isValidMediaCall: () => isValidMediaCall
36
+ });
37
+ module.exports = __toCommonJS(extractMediaStyle_exports);
38
+ var t = __toESM(require("@babel/types")),
39
+ core = __toESM(require("@hanzogui/core")),
40
+ import_requireGuiCore = require("../helpers/requireGuiCore.cjs"),
41
+ import_extractHelpers = require("./extractHelpers.cjs");
42
+ function extractMediaStyle(props, ternary, jsxPath, guiConfig, sourcePath, importance = 0, shouldPrintDebug = !1) {
43
+ const {
44
+ getCSSStylesAtomic
45
+ } = (0, import_requireGuiCore.requireGuiCore)("web"),
46
+ mt = getMediaQueryTernary(props, ternary, jsxPath, sourcePath);
47
+ if (!mt) return null;
48
+ const {
49
+ key
50
+ } = mt;
51
+ if (!guiConfig.media[key]) return console.error(`Media query "${key}" not found: ${Object.keys(guiConfig.media)}`), null;
52
+ const getStyleObj = (styleObj, negate = !1) => styleObj ? {
53
+ styleObj,
54
+ negate
55
+ } : null,
56
+ styleOpts = [getStyleObj(ternary.consequent, !1), getStyleObj(ternary.alternate, !0)].filter(import_extractHelpers.isPresent);
57
+ if (shouldPrintDebug && !styleOpts.length) return console.info(" media query, no styles?"), null;
58
+ const mediaKeyPrecendence = Object.keys(guiConfig.media).reduce((acc, cur, i) => (acc[cur] = new Array(importance + 1).fill(":root").join(""), acc), {});
59
+ let mediaStyles = [];
60
+ for (const {
61
+ styleObj,
62
+ negate
63
+ } of styleOpts) {
64
+ const singleMediaStyles = getCSSStylesAtomic(styleObj).map(style => {
65
+ const mediaStyle = core.createMediaStyle(style, key, guiConfig.media, !0, negate),
66
+ className = `.${mediaStyle[core.StyleObjectIdentifier]}`;
67
+ return {
68
+ ...mediaStyle,
69
+ className
70
+ };
71
+ });
72
+ shouldPrintDebug === "verbose" && console.info(" media styles:", importance, styleObj, singleMediaStyles.map(x => x[core.StyleObjectIdentifier]).join(", ")), mediaStyles = [...mediaStyles, ...singleMediaStyles];
73
+ }
74
+ return ternary.remove(), {
75
+ mediaStyles,
76
+ ternaryWithoutMedia: mt.ternaryWithoutMedia
77
+ };
78
+ }
79
+ function getMediaQueryTernary(props, ternary, jsxPath, sourcePath) {
80
+ if (t.isLogicalExpression(ternary.test) && ternary.test.operator === "&&") {
81
+ const mediaLeft = getMediaInfoFromExpression(props, ternary.test.left, jsxPath, sourcePath, ternary.inlineMediaQuery);
82
+ if (mediaLeft) return {
83
+ ...mediaLeft,
84
+ ternaryWithoutMedia: {
85
+ ...ternary,
86
+ test: ternary.test.right
87
+ }
88
+ };
89
+ }
90
+ const result = getMediaInfoFromExpression(props, ternary.test, jsxPath, sourcePath, ternary.inlineMediaQuery);
91
+ return result ? {
92
+ ...result,
93
+ ternaryWithoutMedia: null
94
+ } : null;
95
+ }
96
+ function getMediaInfoFromExpression(props, test, jsxPath, sourcePath, inlineMediaQuery) {
97
+ if (inlineMediaQuery) return {
98
+ key: inlineMediaQuery,
99
+ bindingName: inlineMediaQuery
100
+ };
101
+ if (t.isMemberExpression(test) && t.isIdentifier(test.object) && t.isIdentifier(test.property)) {
102
+ const name = test.object.name,
103
+ key = test.property.name,
104
+ binding = jsxPath.scope.getAllBindings()[name];
105
+ if (!binding) return !1;
106
+ const bindingNode = binding.path?.node;
107
+ return !t.isVariableDeclarator(bindingNode) || !bindingNode.init || !isValidMediaCall(props, jsxPath, bindingNode.init, sourcePath) ? !1 : {
108
+ key,
109
+ bindingName: name
110
+ };
111
+ }
112
+ if (t.isIdentifier(test)) {
113
+ const key = test.name,
114
+ node = jsxPath.scope.getBinding(test.name)?.path?.node;
115
+ return !t.isVariableDeclarator(node) || !node.init || !isValidMediaCall(props, jsxPath, node.init, sourcePath) ? !1 : {
116
+ key,
117
+ bindingName: key
118
+ };
119
+ }
120
+ return null;
121
+ }
122
+ function isValidMediaCall(props, jsxPath, init, sourcePath) {
123
+ if (!init || !t.isCallExpression(init) || !t.isIdentifier(init.callee) || init.callee.name !== "useMedia") return !1;
124
+ const mediaBinding = jsxPath.scope.getAllBindings().useMedia;
125
+ if (!mediaBinding) return !1;
126
+ const useMediaImport = mediaBinding.path.parent;
127
+ return !(!t.isImportDeclaration(useMediaImport) || !(0, import_extractHelpers.isValidImport)(props, sourcePath));
128
+ }