@hanzogui/static 7.0.0 → 7.3.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 (99) hide show
  1. package/LICENSE +40 -19
  2. package/dist/check-dep-versions.cjs +1 -1
  3. package/dist/checkDeps.cjs +11 -11
  4. package/dist/constants.cjs +2 -2
  5. package/dist/exports.cjs +2 -2
  6. package/dist/extractor/bundle.cjs +6 -6
  7. package/dist/extractor/bundleConfig.cjs +45 -45
  8. package/dist/extractor/createExtractor.cjs +39 -39
  9. package/dist/extractor/createLogger.cjs +1 -1
  10. package/dist/extractor/extractHelpers.cjs +1 -1
  11. package/dist/extractor/extractMediaStyle.cjs +7 -7
  12. package/dist/extractor/extractToClassNames.cjs +9 -9
  13. package/dist/extractor/extractToNative.cjs +7 -7
  14. package/dist/extractor/{getHanzoguiConfigPathFromOptionsConfig.cjs → getGuiConfigPathFromOptionsConfig.cjs} +5 -5
  15. package/dist/extractor/getPrefixLogs.cjs +1 -1
  16. package/dist/extractor/getStaticBindingsForScope.cjs +2 -2
  17. package/dist/extractor/{loadHanzogui.cjs → loadGui.cjs} +65 -65
  18. package/dist/extractor/regenerateConfig.cjs +20 -20
  19. package/dist/extractor/{watchHanzoguiConfig.cjs → watchGuiConfig.cjs} +15 -15
  20. package/dist/getPragmaOptions.cjs +6 -6
  21. package/dist/helpers/{requireHanzoguiCore.cjs → requireGuiCore.cjs} +12 -12
  22. package/dist/registerRequire.cjs +20 -20
  23. package/dist/worker.cjs +3 -3
  24. package/package.json +25 -24
  25. package/src/check-dep-versions.ts +1 -1
  26. package/src/checkDeps.ts +27 -27
  27. package/src/constants.ts +2 -2
  28. package/src/exports.ts +2 -2
  29. package/src/extractor/bundle.ts +9 -9
  30. package/src/extractor/bundleConfig.ts +56 -56
  31. package/src/extractor/createEvaluator.ts +2 -2
  32. package/src/extractor/createExtractor.ts +55 -55
  33. package/src/extractor/createLogger.ts +3 -3
  34. package/src/extractor/extractHelpers.ts +12 -12
  35. package/src/extractor/extractMediaStyle.ts +13 -13
  36. package/src/extractor/extractToClassNames.ts +11 -11
  37. package/src/extractor/extractToNative.ts +13 -13
  38. package/src/extractor/{getHanzoguiConfigPathFromOptionsConfig.ts → getGuiConfigPathFromOptionsConfig.ts} +3 -3
  39. package/src/extractor/getPrefixLogs.ts +3 -3
  40. package/src/extractor/getStaticBindingsForScope.ts +2 -2
  41. package/src/extractor/{loadHanzogui.ts → loadGui.ts} +85 -85
  42. package/src/extractor/regenerateConfig.ts +23 -23
  43. package/src/extractor/{watchHanzoguiConfig.ts → watchGuiConfig.ts} +10 -10
  44. package/src/getPragmaOptions.ts +6 -6
  45. package/src/helpers/requireGuiCore.ts +28 -0
  46. package/src/registerRequire.ts +27 -27
  47. package/src/server.ts +2 -2
  48. package/src/types.ts +10 -10
  49. package/src/worker.ts +7 -7
  50. package/types/constants.d.ts.map +1 -1
  51. package/types/exports.d.ts +2 -2
  52. package/types/exports.d.ts.map +1 -1
  53. package/types/extractor/bundle.d.ts +2 -2
  54. package/types/extractor/bundle.d.ts.map +1 -1
  55. package/types/extractor/bundleConfig.d.ts +12 -12
  56. package/types/extractor/bundleConfig.d.ts.map +1 -1
  57. package/types/extractor/createEvaluator.d.ts +2 -2
  58. package/types/extractor/createEvaluator.d.ts.map +1 -1
  59. package/types/extractor/createExtractor.d.ts +5 -5
  60. package/types/extractor/createExtractor.d.ts.map +1 -1
  61. package/types/extractor/createLogger.d.ts +2 -2
  62. package/types/extractor/createLogger.d.ts.map +1 -1
  63. package/types/extractor/extractHelpers.d.ts +8 -8
  64. package/types/extractor/extractHelpers.d.ts.map +1 -1
  65. package/types/extractor/extractMediaStyle.d.ts +4 -4
  66. package/types/extractor/extractMediaStyle.d.ts.map +1 -1
  67. package/types/extractor/extractToClassNames.d.ts +2 -2
  68. package/types/extractor/extractToClassNames.d.ts.map +1 -1
  69. package/types/extractor/extractToNative.d.ts +3 -3
  70. package/types/extractor/extractToNative.d.ts.map +1 -1
  71. package/types/extractor/getGuiConfigPathFromOptionsConfig.d.ts +3 -0
  72. package/types/extractor/getGuiConfigPathFromOptionsConfig.d.ts.map +1 -0
  73. package/types/extractor/getPrefixLogs.d.ts +2 -2
  74. package/types/extractor/getPrefixLogs.d.ts.map +1 -1
  75. package/types/extractor/loadGui.d.ts +22 -0
  76. package/types/extractor/loadGui.d.ts.map +1 -0
  77. package/types/extractor/regenerateConfig.d.ts +4 -4
  78. package/types/extractor/regenerateConfig.d.ts.map +1 -1
  79. package/types/extractor/watchGuiConfig.d.ts +5 -0
  80. package/types/extractor/watchGuiConfig.d.ts.map +1 -0
  81. package/types/helpers/requireGuiCore.d.ts +3 -0
  82. package/types/helpers/requireGuiCore.d.ts.map +1 -0
  83. package/types/registerRequire.d.ts +3 -3
  84. package/types/registerRequire.d.ts.map +1 -1
  85. package/types/server.d.ts +2 -2
  86. package/types/server.d.ts.map +1 -1
  87. package/types/types.d.ts +10 -10
  88. package/types/types.d.ts.map +1 -1
  89. package/types/worker.d.ts +4 -4
  90. package/types/worker.d.ts.map +1 -1
  91. package/src/helpers/requireHanzoguiCore.ts +0 -28
  92. package/types/extractor/getHanzoguiConfigPathFromOptionsConfig.d.ts +0 -3
  93. package/types/extractor/getHanzoguiConfigPathFromOptionsConfig.d.ts.map +0 -1
  94. package/types/extractor/loadHanzogui.d.ts +0 -22
  95. package/types/extractor/loadHanzogui.d.ts.map +0 -1
  96. package/types/extractor/watchHanzoguiConfig.d.ts +0 -5
  97. package/types/extractor/watchHanzoguiConfig.d.ts.map +0 -1
  98. package/types/helpers/requireHanzoguiCore.d.ts +0 -3
  99. package/types/helpers/requireHanzoguiCore.d.ts.map +0 -1
@@ -45,14 +45,14 @@ var import_node_fs = require("node:fs");
45
45
  var import_node_path = require("node:path");
46
46
  var import_typescript = require("typescript");
47
47
  var import_constants = require("../constants.cjs");
48
- var import_requireHanzoguiCore = require("../helpers/requireHanzoguiCore.cjs");
48
+ var import_requireGuiCore = require("../helpers/requireGuiCore.cjs");
49
49
  var import_createEvaluator = require("./createEvaluator.cjs");
50
50
  var import_evaluateAstNode = require("./evaluateAstNode.cjs");
51
51
  var import_extractHelpers = require("./extractHelpers.cjs");
52
52
  var import_findTopmostFunction = require("./findTopmostFunction.cjs");
53
53
  var import_getStaticBindingsForScope = require("./getStaticBindingsForScope.cjs");
54
54
  var import_literalToAst = require("./literalToAst.cjs");
55
- var import_loadHanzogui = require("./loadHanzogui.cjs");
55
+ var import_loadGui = require("./loadGui.cjs");
56
56
  var import_logLines = require("./logLines.cjs");
57
57
  var import_normalizeTernaries = require("./normalizeTernaries.cjs");
58
58
  var import_propsToFontFamilyCache = require("./propsToFontFamilyCache.cjs");
@@ -189,23 +189,23 @@ function createExtractor({
189
189
  if (isFullyDisabled(props)) {
190
190
  return null;
191
191
  }
192
- return projectInfo ||= (0, import_loadHanzogui.loadHanzoguiSync)(props);
192
+ return projectInfo ||= (0, import_loadGui.loadGuiSync)(props);
193
193
  }
194
194
  async function load(props) {
195
195
  if (isFullyDisabled(props)) {
196
196
  return null;
197
197
  }
198
- return projectInfo ||= await (0, import_loadHanzogui.loadHanzogui)(props);
198
+ return projectInfo ||= await (0, import_loadGui.loadGui)(props);
199
199
  }
200
200
  return {
201
201
  options: {
202
202
  logger
203
203
  },
204
204
  cleanupBeforeExit: import_getStaticBindingsForScope.cleanupBeforeExit,
205
- loadHanzogui: load,
206
- loadHanzoguiSync: loadSync,
207
- getHanzogui() {
208
- return projectInfo?.hanzoguiConfig;
205
+ loadGui: load,
206
+ loadGuiSync: loadSync,
207
+ getGui() {
208
+ return projectInfo?.guiConfig;
209
209
  },
210
210
  parseSync: (f, props) => {
211
211
  globalThis.expo ||= {};
@@ -220,10 +220,10 @@ function createExtractor({
220
220
  };
221
221
  function parseWithConfig({
222
222
  components,
223
- hanzoguiConfig
223
+ guiConfig
224
224
  }, fileOrPath, options) {
225
225
  const {
226
- config = "hanzogui.config.ts",
226
+ config = "gui.config.ts",
227
227
  importsWhitelist = ["constants.js"],
228
228
  evaluateVars = true,
229
229
  sourcePath = "",
@@ -246,7 +246,7 @@ function createExtractor({
246
246
  dynamicComponentCache.delete(sourcePath);
247
247
  styledCheckCache.delete(sourcePath);
248
248
  }
249
- if (sourcePath.includes(".hanzogui-dynamic-eval")) {
249
+ if (sourcePath.includes(".gui-dynamic-eval")) {
250
250
  return null;
251
251
  }
252
252
  const {
@@ -257,7 +257,7 @@ function createExtractor({
257
257
  proxyThemeVariables,
258
258
  getDefaultProps,
259
259
  pseudoDescriptors
260
- } = (0, import_requireHanzoguiCore.requireHanzoguiCore)(platform2);
260
+ } = (0, import_requireGuiCore.requireGuiCore)(platform2);
261
261
  let shouldPrintDebug = options.shouldPrintDebug || false;
262
262
  if (disable === true || Array.isArray(disable) && disable.includes(sourcePath)) {
263
263
  return null;
@@ -275,7 +275,7 @@ function createExtractor({
275
275
  }
276
276
  function isValidStyleKey(name, staticConfig) {
277
277
  if (!projectInfo) {
278
- throw new Error(`Hanzogui extractor not loaded yet`);
278
+ throw new Error(`Gui extractor not loaded yet`);
279
279
  }
280
280
  if (platform2 === "native" && name[0] === "$" && mediaQueryConfig[name.slice(1)]) {
281
281
  return false;
@@ -291,7 +291,7 @@ function createExtractor({
291
291
  }
292
292
  return !!(staticConfig.validStyles?.[name] || pseudoDescriptors[name] ||
293
293
  // don't disable variants or else you lose many things flattening
294
- staticConfig.variants?.[name] || projectInfo?.hanzoguiConfig?.shorthands[name]);
294
+ staticConfig.variants?.[name] || projectInfo?.guiConfig?.shorthands[name]);
295
295
  }
296
296
  const isTargetingHTML = platform2 === "web";
297
297
  const ogDebug = shouldPrintDebug;
@@ -306,16 +306,16 @@ function createExtractor({
306
306
  if (shouldPrintDebug) {
307
307
  logger.info(["loaded components:", propsWithFileInfo.allLoadedComponents.map(comp => Object.keys(comp.nameToInfo).join(", ")).join(", ")].join(" "));
308
308
  }
309
- if (process.env.DEBUG?.startsWith("hanzogui")) {
309
+ if (process.env.DEBUG?.startsWith("gui")) {
310
310
  logger.info(["loaded:", propsWithFileInfo.allLoadedComponents.map(x => x.moduleName)].join("\n"));
311
311
  }
312
312
  }
313
- tm.mark("load-hanzogui", !!shouldPrintDebug);
313
+ tm.mark("load-gui", !!shouldPrintDebug);
314
314
  if (!isFullyDisabled(options)) {
315
- if (!hanzoguiConfig?.themes) {
316
- console.error(`\u26D4\uFE0F Error: Missing "themes" in your hanzogui.config file:
315
+ if (!guiConfig?.themes) {
316
+ console.error(`\u26D4\uFE0F Error: Missing "themes" in your gui.config file:
317
317
 
318
- You may not need the compiler! Remember you can run Hanzogui with no configuration at all.
318
+ You may not need the compiler! Remember you can run Gui with no configuration at all.
319
319
 
320
320
  You may have not "export default" your config (you can also "export const config").
321
321
 
@@ -323,15 +323,15 @@ function createExtractor({
323
323
  - try out https://github.com/bmish/check-dependency-version-consistency to see if there are mis-matches.
324
324
  - or search your lockfile for mis-matches.
325
325
  `);
326
- console.info(` Got config:`, hanzoguiConfig);
326
+ console.info(` Got config:`, guiConfig);
327
327
  process.exit(0);
328
328
  }
329
329
  }
330
- const firstThemeName = Object.keys(hanzoguiConfig?.themes || {})[0];
331
- const firstTheme = hanzoguiConfig?.themes[firstThemeName] || {};
330
+ const firstThemeName = Object.keys(guiConfig?.themes || {})[0];
331
+ const firstTheme = guiConfig?.themes[firstThemeName] || {};
332
332
  if (!firstTheme || typeof firstTheme !== "object") {
333
333
  const err = `Missing theme ${firstThemeName}, an error occurred when importing your config`;
334
- console.info(err, `Got config:`, hanzoguiConfig);
334
+ console.info(err, `Got config:`, guiConfig);
335
335
  console.info(`Looking for theme:`, firstThemeName);
336
336
  throw new Error(err);
337
337
  }
@@ -348,8 +348,8 @@ function createExtractor({
348
348
  const body = fileOrPath.type === "Program" ? fileOrPath.get("body") : fileOrPath.program.body;
349
349
  if (!isFullyDisabled(options)) {
350
350
  if (Object.keys(components || []).length === 0) {
351
- console.warn(`Warning: Hanzogui didn't find any valid components (DEBUG=hanzogui for more)`);
352
- if (process.env.DEBUG === "hanzogui") {
351
+ console.warn(`Warning: Gui didn't find any valid components (DEBUG=gui for more)`);
352
+ if (process.env.DEBUG === "gui") {
353
353
  console.info(`components`, Object.keys(components || []), components);
354
354
  }
355
355
  }
@@ -477,7 +477,7 @@ function createExtractor({
477
477
  if (shouldPrintDebug) {
478
478
  logger.info(`Unknown component: ${variableName} = styled(${parentName}) attempting dynamic load: ${sourcePath}`);
479
479
  }
480
- const out2 = (0, import_loadHanzogui.loadHanzoguiSync)({
480
+ const out2 = (0, import_loadGui.loadGuiSync)({
481
481
  forceExports: true,
482
482
  components: [sourcePath],
483
483
  cacheKey: version
@@ -493,12 +493,12 @@ function createExtractor({
493
493
  if (!out2.cached) {
494
494
  const foundNames = out2.components?.map(x => Object.keys(x.nameToInfo).join(", ")).join(", ").trim();
495
495
  if (foundNames) {
496
- (0, import_cli_color.colorLog)(import_cli_color.Color.FgYellow, ` | Hanzogui found dynamic components: ${foundNames}`);
496
+ (0, import_cli_color.colorLog)(import_cli_color.Color.FgYellow, ` | Gui found dynamic components: ${foundNames}`);
497
497
  }
498
498
  }
499
499
  } catch (err) {
500
500
  if (shouldPrintDebug) {
501
- logger.info(`skip optimize styled(${variableName}), unable to pre-process (DEBUG=hanzogui for more)`);
501
+ logger.info(`skip optimize styled(${variableName}), unable to pre-process (DEBUG=gui for more)`);
502
502
  }
503
503
  }
504
504
  }
@@ -627,7 +627,7 @@ function createExtractor({
627
627
  } else if (!dynamicLoadingInProgress.has(resolved) && mightHaveStyledComponents(resolved)) {
628
628
  dynamicLoadingInProgress.add(resolved);
629
629
  try {
630
- const out = (0, import_loadHanzogui.loadHanzoguiSync)({
630
+ const out = (0, import_loadGui.loadGuiSync)({
631
631
  forceExports: true,
632
632
  components: [resolved]
633
633
  });
@@ -676,7 +676,7 @@ function createExtractor({
676
676
  if (!component || !component.staticConfig) {
677
677
  if (shouldPrintDebug) {
678
678
  logger.info(`
679
- - No Hanzogui conf for: ${node.name.name}
679
+ - No Gui conf for: ${node.name.name}
680
680
  `);
681
681
  }
682
682
  return;
@@ -1206,7 +1206,7 @@ function createExtractor({
1206
1206
  // always de-opt animation these
1207
1207
  "animation", "animateOnly", "animatePresence", "disableOptimization", ...(!isTargetingHTML ? ["pressStyle", "focusStyle", "focusVisibleStyle", "focusWithinStyle", "disabledStyle"] : []),
1208
1208
  // when using a non-CSS driver, de-opt on enterStyle/exitStyle
1209
- ...(hanzoguiConfig?.animations.isReactNative ? ["enterStyle", "exitStyle"] : [])]);
1209
+ ...(guiConfig?.animations.isReactNative ? ["enterStyle", "exitStyle"] : [])]);
1210
1210
  const inlineWhenUnflattened = new Set(staticConfig.inlineWhenUnflattened || []);
1211
1211
  const staticNamespace = (0, import_getStaticBindingsForScope.getStaticBindingsForScope)(traversePath.scope, importsWhitelist, sourcePath, bindingCache, shouldPrintDebug);
1212
1212
  const attemptEval = !evaluateVars ? import_evaluateAstNode.evaluateAstNode : (0, import_createEvaluator.createEvaluator)({
@@ -1237,7 +1237,7 @@ function createExtractor({
1237
1237
  style: {},
1238
1238
  theme: defaultTheme,
1239
1239
  viewProps: defaultProps,
1240
- conf: hanzoguiConfig,
1240
+ conf: guiConfig,
1241
1241
  props: defaultProps,
1242
1242
  componentState,
1243
1243
  styleProps: {
@@ -1344,7 +1344,7 @@ function createExtractor({
1344
1344
  if (!isValidStyleKey(key, staticConfig)) {
1345
1345
  return [];
1346
1346
  }
1347
- const name = hanzoguiConfig?.shorthands[key] || key;
1347
+ const name = guiConfig?.shorthands[key] || key;
1348
1348
  if (value === void 0) {
1349
1349
  logger.warn(`\u26A0\uFE0F Error evaluating default style for component, prop ${key} ${value}`);
1350
1350
  shouldDeopt = true;
@@ -1420,9 +1420,9 @@ function createExtractor({
1420
1420
  attrs = attrs.filter(x => !(x.type === "attr" && t.isJSXAttribute(x.value) && x.value.name.name === "theme"));
1421
1421
  if (!hasImportedTheme) {
1422
1422
  hasImportedTheme = true;
1423
- programPath.node.body.push(t.importDeclaration([t.importSpecifier(t.identifier("_HanzoguiTheme"), t.identifier("Theme"))], t.stringLiteral("@hanzogui/web")));
1423
+ programPath.node.body.push(t.importDeclaration([t.importSpecifier(t.identifier("_GuiTheme"), t.identifier("Theme"))], t.stringLiteral("@hanzogui/web")));
1424
1424
  }
1425
- traversePath.replaceWith(t.jsxElement(t.jsxOpeningElement(t.jsxIdentifier("_HanzoguiTheme"), [t.jsxAttribute(t.jsxIdentifier("name"), themeVal.value)]), t.jsxClosingElement(t.jsxIdentifier("_HanzoguiTheme")), [traversePath.node]));
1425
+ traversePath.replaceWith(t.jsxElement(t.jsxOpeningElement(t.jsxIdentifier("_GuiTheme"), [t.jsxAttribute(t.jsxIdentifier("name"), themeVal.value)]), t.jsxClosingElement(t.jsxIdentifier("_GuiTheme")), [traversePath.node]));
1426
1426
  }
1427
1427
  }
1428
1428
  if (shouldPrintDebug) {
@@ -1515,7 +1515,7 @@ function createExtractor({
1515
1515
  }
1516
1516
  let key = Object.keys(cur.value)[0];
1517
1517
  const value = cur.value[key];
1518
- const fullKey = hanzoguiConfig?.shorthands[key];
1518
+ const fullKey = guiConfig?.shorthands[key];
1519
1519
  if (fullKey) {
1520
1520
  cur.value = {
1521
1521
  [fullKey]: value
@@ -1783,7 +1783,7 @@ function createExtractor({
1783
1783
  node,
1784
1784
  lineNumbers,
1785
1785
  filePath,
1786
- config: hanzoguiConfig,
1786
+ config: guiConfig,
1787
1787
  flatNodeName,
1788
1788
  attemptEval,
1789
1789
  jsxPath: traversePath,
@@ -1808,8 +1808,8 @@ function createExtractor({
1808
1808
  } catch (err) {
1809
1809
  node.attributes = ogAttributes;
1810
1810
  if (!(err instanceof import_errors.BailOptimizationError)) {
1811
- console.error(`@hanzogui/static error, reverting optimization. In ${filePath} ${lineNumbers} on ${originalNodeName}: ${err.message}. For stack trace set environment TAMAGUI_DEBUG=1`);
1812
- if (process.env.TAMAGUI_DEBUG === "1") {
1811
+ console.error(`@hanzogui/static error, reverting optimization. In ${filePath} ${lineNumbers} on ${originalNodeName}: ${err.message}. For stack trace set environment GUI_DEBUG=1`);
1812
+ if (process.env.GUI_DEBUG === "1") {
1813
1813
  console.error(err.stack);
1814
1814
  }
1815
1815
  }
@@ -30,7 +30,7 @@ var import_getPrefixLogs = require("./getPrefixLogs.cjs");
30
30
  function createLogger(sourcePath, options) {
31
31
  const shouldLogTiming = options.logTimings ?? true;
32
32
  const start = Date.now();
33
- const mem = process.env.TAMAGUI_SHOW_MEMORY_USAGE && shouldLogTiming ? process.memoryUsage() : null;
33
+ const mem = process.env.GUI_SHOW_MEMORY_USAGE && shouldLogTiming ? process.memoryUsage() : null;
34
34
  return res => {
35
35
  if (!shouldLogTiming) {
36
36
  return;
@@ -171,7 +171,7 @@ const isValidImport = (props, moduleName, componentName) => {
171
171
  return Boolean(getValidImport(props, moduleName, componentName));
172
172
  };
173
173
  const getValidComponentPackages = (0, import_memoize.memoize)(props => {
174
- return [... /* @__PURE__ */new Set(["@hanzogui/core", "hanzogui", ...(props.components || [])])];
174
+ return [... /* @__PURE__ */new Set(["@hanzogui/core", "gui", ...(props.components || [])])];
175
175
  });
176
176
  const getValidComponentsPaths = (0, import_memoize.memoize)(props => {
177
177
  return getValidComponentPackages(props).flatMap(pkg => {
@@ -39,12 +39,12 @@ __export(extractMediaStyle_exports, {
39
39
  module.exports = __toCommonJS(extractMediaStyle_exports);
40
40
  var t = __toESM(require("@babel/types"));
41
41
  var core = __toESM(require("@hanzogui/core"));
42
- var import_requireHanzoguiCore = require("../helpers/requireHanzoguiCore.cjs");
42
+ var import_requireGuiCore = require("../helpers/requireGuiCore.cjs");
43
43
  var import_extractHelpers = require("./extractHelpers.cjs");
44
- function extractMediaStyle(props, ternary, jsxPath, hanzoguiConfig, sourcePath, importance = 0, shouldPrintDebug = false) {
44
+ function extractMediaStyle(props, ternary, jsxPath, guiConfig, sourcePath, importance = 0, shouldPrintDebug = false) {
45
45
  const {
46
46
  getCSSStylesAtomic
47
- } = (0, import_requireHanzoguiCore.requireHanzoguiCore)("web");
47
+ } = (0, import_requireGuiCore.requireGuiCore)("web");
48
48
  const mt = getMediaQueryTernary(props, ternary, jsxPath, sourcePath);
49
49
  if (!mt) {
50
50
  return null;
@@ -52,9 +52,9 @@ function extractMediaStyle(props, ternary, jsxPath, hanzoguiConfig, sourcePath,
52
52
  const {
53
53
  key
54
54
  } = mt;
55
- const mq = hanzoguiConfig.media[key];
55
+ const mq = guiConfig.media[key];
56
56
  if (!mq) {
57
- console.error(`Media query "${key}" not found: ${Object.keys(hanzoguiConfig.media)}`);
57
+ console.error(`Media query "${key}" not found: ${Object.keys(guiConfig.media)}`);
58
58
  return null;
59
59
  }
60
60
  const getStyleObj = (styleObj, negate = false) => {
@@ -68,7 +68,7 @@ function extractMediaStyle(props, ternary, jsxPath, hanzoguiConfig, sourcePath,
68
68
  console.info(" media query, no styles?");
69
69
  return null;
70
70
  }
71
- const mediaKeys = Object.keys(hanzoguiConfig.media);
71
+ const mediaKeys = Object.keys(guiConfig.media);
72
72
  const mediaKeyPrecendence = mediaKeys.reduce((acc, cur, i) => {
73
73
  acc[cur] = new Array(importance + 1).fill(":root").join("");
74
74
  return acc;
@@ -80,7 +80,7 @@ function extractMediaStyle(props, ternary, jsxPath, hanzoguiConfig, sourcePath,
80
80
  } of styleOpts) {
81
81
  const styles = getCSSStylesAtomic(styleObj);
82
82
  const singleMediaStyles = styles.map(style => {
83
- const mediaStyle = core.createMediaStyle(style, key, hanzoguiConfig.media, true, negate);
83
+ const mediaStyle = core.createMediaStyle(style, key, guiConfig.media, true, negate);
84
84
  const className = `.${mediaStyle[core.StyleObjectIdentifier]}`;
85
85
  return {
86
86
  ...mediaStyle,
@@ -41,7 +41,7 @@ var t = __toESM(require("@babel/types"));
41
41
  var import_web = require("@hanzogui/web");
42
42
  var path = __toESM(require("node:path"));
43
43
  var util = __toESM(require("node:util"));
44
- var import_requireHanzoguiCore = require("../helpers/requireHanzoguiCore.cjs");
44
+ var import_requireGuiCore = require("../helpers/requireGuiCore.cjs");
45
45
  var import_babelParse = require("./babelParse.cjs");
46
46
  var import_createLogger = require("./createLogger.cjs");
47
47
  var import_extractMediaStyle = require("./extractMediaStyle.cjs");
@@ -63,7 +63,7 @@ async function extractToClassNames({
63
63
  const {
64
64
  getCSSStylesAtomic,
65
65
  createMediaStyle
66
- } = (0, import_requireHanzoguiCore.requireHanzoguiCore)("web");
66
+ } = (0, import_requireGuiCore.requireGuiCore)("web");
67
67
  if (sourcePath.includes("node_modules")) {
68
68
  return null;
69
69
  }
@@ -81,8 +81,8 @@ async function extractToClassNames({
81
81
  if (!/.[tj]sx?$/i.test(sourcePath || "")) {
82
82
  console.warn(`${sourcePath.slice(0, 100)} - bad filename.`);
83
83
  }
84
- if (!options.disableExtraction && !options["_disableLoadHanzogui"]) {
85
- await extractor.loadHanzogui(options);
84
+ if (!options.disableExtraction && !options["_disableLoadGui"]) {
85
+ await extractor.loadGui(options);
86
86
  }
87
87
  const printLog = (0, import_createLogger.createLogger)(sourcePath, options);
88
88
  let ast;
@@ -94,7 +94,7 @@ async function extractToClassNames({
94
94
  }
95
95
  tm.mark(`babel-parse`, shouldPrintDebug === "verbose");
96
96
  const cssMap = /* @__PURE__ */new Map();
97
- const hanzoguiConfig = extractor.getHanzogui();
97
+ const guiConfig = extractor.getGui();
98
98
  const res = await extractor.parse(ast, {
99
99
  shouldPrintDebug,
100
100
  ...options,
@@ -163,13 +163,13 @@ async function extractToClassNames({
163
163
  const mediaTypeMatch = mediaName.match(/^(theme|platform)-/);
164
164
  if (mediaTypeMatch) {
165
165
  const mediaType = mediaTypeMatch[1];
166
- const mediaStyle = createMediaStyle(style2, mediaName, extractor.getHanzogui().media, mediaType, false, mediaStylesSeen);
166
+ const mediaStyle = createMediaStyle(style2, mediaName, extractor.getGui().media, mediaType, false, mediaStylesSeen);
167
167
  const identifier2 = addStyle(mediaStyle);
168
168
  classNames.push(identifier2);
169
169
  continue;
170
170
  }
171
- if (mediaName in hanzoguiConfig.media) {
172
- const mediaStyle = createMediaStyle(style2, mediaName, extractor.getHanzogui().media, true, false, mediaStylesSeen);
171
+ if (mediaName in guiConfig.media) {
172
+ const mediaStyle = createMediaStyle(style2, mediaName, extractor.getGui().media, true, false, mediaStylesSeen);
173
173
  const identifier2 = addStyle(mediaStyle);
174
174
  classNames.push(identifier2);
175
175
  continue;
@@ -213,7 +213,7 @@ async function extractToClassNames({
213
213
  }
214
214
  let ternary = attr.value;
215
215
  if (ternary.inlineMediaQuery) {
216
- const mediaExtraction = (0, import_extractMediaStyle.extractMediaStyle)(parserProps, attr.value, jsxPath, extractor.getHanzogui(), sourcePath || "", mediaStylesSeen++, shouldPrintDebug);
216
+ const mediaExtraction = (0, import_extractMediaStyle.extractMediaStyle)(parserProps, attr.value, jsxPath, extractor.getGui(), sourcePath || "", mediaStylesSeen++, shouldPrintDebug);
217
217
  if (mediaExtraction) {
218
218
  if (mediaExtraction.mediaStyles) {
219
219
  mergeForwardBaseStyle = (0, import_web.mergeProps)(mergeForwardBaseStyle || {}, {
@@ -50,7 +50,7 @@ var import_createExtractor = require("./createExtractor.cjs");
50
50
  var import_createLogger = require("./createLogger.cjs");
51
51
  var import_extractHelpers = require("./extractHelpers.cjs");
52
52
  var import_literalToAst = require("./literalToAst.cjs");
53
- var import_loadHanzogui = require("./loadHanzogui.cjs");
53
+ var import_loadGui = require("./loadGui.cjs");
54
54
  const importNativeView = (0, import_template.default)(`
55
55
  const __ReactNativeView = require('react-native').View;
56
56
  const __ReactNativeText = require('react-native').Text;
@@ -62,7 +62,7 @@ const importWithStyle = import_template.default.ast(`import { _withStableStyle }
62
62
  const extractor = (0, import_createExtractor.createExtractor)({
63
63
  platform: "native"
64
64
  });
65
- let hanzoguiBuildOptionsLoaded;
65
+ let guiBuildOptionsLoaded;
66
66
  function extractToNative(sourceFileName, sourceCode, options) {
67
67
  const ast = (0, import_parser.parse)(sourceCode, {
68
68
  sourceType: "module",
@@ -88,7 +88,7 @@ function getBabelPlugin() {
88
88
  }
89
89
  function getBabelParseDefinition(options) {
90
90
  return {
91
- name: "hanzogui",
91
+ name: "gui",
92
92
  visitor: {
93
93
  Program: {
94
94
  enter(root) {
@@ -122,12 +122,12 @@ function getBabelParseDefinition(options) {
122
122
  return;
123
123
  }
124
124
  if (!options.config && !options.components) {
125
- hanzoguiBuildOptionsLoaded ||= (0, import_loadHanzogui.loadHanzoguiBuildConfigSync)({});
125
+ guiBuildOptionsLoaded ||= (0, import_loadGui.loadGuiBuildConfigSync)({});
126
126
  }
127
127
  const finalOptions = {
128
128
  // @ts-ignore just in case they leave it out
129
129
  platform: "native",
130
- ...hanzoguiBuildOptionsLoaded,
130
+ ...guiBuildOptionsLoaded,
131
131
  ...options
132
132
  };
133
133
  const printLog = (0, import_createLogger.createLogger)(sourcePath, finalOptions);
@@ -306,7 +306,7 @@ function getBabelParseDefinition(options) {
306
306
  if (message.includes("Unexpected return value from visitor method")) {
307
307
  message = "Unexpected return value from visitor method";
308
308
  }
309
- console.warn("Error in Hanzogui parse, skipping", message, err.stack);
309
+ console.warn("Error in Gui parse, skipping", message, err.stack);
310
310
  return;
311
311
  }
312
312
  }
@@ -336,7 +336,7 @@ function getBabelParseDefinition(options) {
336
336
  }
337
337
  function assertValidTag(node) {
338
338
  if (node.attributes.find(x => x.type === "JSXAttribute" && x.name.name === "style")) {
339
- if (process.env.DEBUG?.startsWith("hanzogui")) {
339
+ if (process.env.DEBUG?.startsWith("gui")) {
340
340
  console.warn("\u26A0\uFE0F Cannot pass style attribute to extracted style");
341
341
  }
342
342
  }
@@ -20,14 +20,14 @@ var __copyProps = (to, from, except, desc) => {
20
20
  var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
21
21
  value: true
22
22
  }), mod);
23
- var getHanzoguiConfigPathFromOptionsConfig_exports = {};
24
- __export(getHanzoguiConfigPathFromOptionsConfig_exports, {
25
- getHanzoguiConfigPathFromOptionsConfig: () => getHanzoguiConfigPathFromOptionsConfig
23
+ var getGuiConfigPathFromOptionsConfig_exports = {};
24
+ __export(getGuiConfigPathFromOptionsConfig_exports, {
25
+ getGuiConfigPathFromOptionsConfig: () => getGuiConfigPathFromOptionsConfig
26
26
  });
27
- module.exports = __toCommonJS(getHanzoguiConfigPathFromOptionsConfig_exports);
27
+ module.exports = __toCommonJS(getGuiConfigPathFromOptionsConfig_exports);
28
28
  var import_node_path = require("node:path");
29
29
  var import_node_fs = require("node:fs");
30
- function getHanzoguiConfigPathFromOptionsConfig(config) {
30
+ function getGuiConfigPathFromOptionsConfig(config) {
31
31
  if ((0, import_node_path.isAbsolute)(config)) {
32
32
  return config;
33
33
  }
@@ -27,5 +27,5 @@ __export(getPrefixLogs_exports, {
27
27
  module.exports = __toCommonJS(getPrefixLogs_exports);
28
28
  var import_cli_color = require("@hanzogui/cli-color");
29
29
  function getPrefixLogs(options) {
30
- return options?.prefixLogs ?? ` \u{1F425} [hanzogui] ${(0, import_cli_color.colorString)(import_cli_color.Color.FgYellow, options?.platform || "web")}`;
30
+ return options?.prefixLogs ?? ` \u{1F425} [gui] ${(0, import_cli_color.colorString)(import_cli_color.Color.FgYellow, options?.platform || "web")}`;
31
31
  }
@@ -141,8 +141,8 @@ async function getStaticBindingsForScope(scope, whitelist = [], sourcePath, bind
141
141
  }
142
142
  } catch (err) {
143
143
  if (shouldPrintDebug) {
144
- console.warn(` | Skipping partial evaluation of constant file: ${moduleName} (DEBUG=hanzogui for more)`);
145
- } else if (process.env.DEBUG?.startsWith("hanzogui")) {
144
+ console.warn(` | Skipping partial evaluation of constant file: ${moduleName} (DEBUG=gui for more)`);
145
+ } else if (process.env.DEBUG?.startsWith("gui")) {
146
146
  console.info(`Error in partial evaluation`, err.message, err.stack);
147
147
  }
148
148
  }