antigravity-rtl 1.0.2 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -25,6 +25,8 @@ Because the tool needs to modify the Antigravity application files, you must run
25
25
  ```bash
26
26
  sudo npx antigravity-rtl
27
27
  ```
28
+ > **macOS Users:** If you get a "Permission Denied" error even with sudo, ensure your terminal (e.g. Terminal, iTerm2, VS Code) has **App Management** permissions enabled in `System Settings > Privacy & Security > App Management`.
29
+
28
30
 
29
31
  ### Windows
30
32
  Open **PowerShell** or **Command Prompt** as **Administrator** (Right-click -> Run as Administrator), then run:
@@ -34,6 +36,9 @@ npx antigravity-rtl
34
36
 
35
37
  > **Note:** You must have [Node.js](https://nodejs.org) installed on your system to run this command.
36
38
 
39
+ > [!WARNING]
40
+ > **App Updates:** Since updating the Antigravity application overwrites its internal files, the RTL patch will be removed. You will need to run the installation command again after each update to re-apply the patch.
41
+
37
42
  ## Restoring to Original (Uninstall)
38
43
 
39
44
  If you ever want to revert Antigravity back to its original state (before the patch), simply run the command with the `--restore` flag:
@@ -51,6 +56,10 @@ This CLI tool:
51
56
  3. Extracts the application and safely injects the Smart RTL Engine into the core logic (`utils.js`).
52
57
  4. Repacks the application so you can start using it immediately.
53
58
 
59
+ ## Future Plans (Roadmap)
60
+
61
+ - Add Right-to-Left (RTL) support for **Antigravity IDE**.
62
+
54
63
  ## Contributing
55
64
 
56
65
  Feel free to open issues or submit pull requests. Let's make Antigravity accessible and beautiful for everyone!
@@ -84,6 +93,8 @@ Feel free to open issues or submit pull requests. Let's make Antigravity accessi
84
93
  ```bash
85
94
  sudo npx antigravity-rtl
86
95
  ```
96
+ > **کاربران مک (macOS):** اگر با وجود استفاده از sudo باز هم خطای Permission Denied دریافت کردید، باید به ترمینال خود (مثل Terminal، iTerm2 یا VS Code) دسترسی **App Management** بدهید. برای این کار به مسیر `System Settings > Privacy & Security > App Management` بروید و دسترسی ترمینال خود را فعال کنید.
97
+
87
98
 
88
99
  ### در ویندوز
89
100
  برنامهٔ **PowerShell** یا **Command Prompt** را در حالت **Administrator** (راست‌کلیک -> Run as Administrator) باز کنید و دستور زیر را بنویسید:
@@ -93,6 +104,9 @@ npx antigravity-rtl
93
104
 
94
105
  > **نکته:** برای اجرای این دستور باید حتماً [Node.js](https://nodejs.org) روی سیستم شما نصب باشد.
95
106
 
107
+ > [!WARNING]
108
+ > **به‌روزرسانی برنامه:** از آنجا که آپدیت کردنِ برنامهٔ آنتی‌گرویتی کدهای آن را بازنویسی می‌کند، پچِ اعمال‌شده از بین خواهد رفت و لازم است پس از هر بار آپدیت، دستور نصب را مجدداً اجرا کنید.
109
+
96
110
  ## بازگردانی به حالت اولیه (Uninstall)
97
111
 
98
112
  اگر زمانی خواستید آنتی‌گرویتی را به حالتِ کارخانه (قبل از نصب این پچ) برگردانید، فقط کافیست دستور بالا را با فلگ `--restore` اجرا کنید:
@@ -109,6 +123,10 @@ sudo npx antigravity-rtl --restore
109
123
  3. فایل را استخراج کرده و کدهای موتورِ RTL را به ایمن‌ترین شکل ممکن به هستهٔ برنامه تزریق می‌کند.
110
124
  4. در نهایت برنامه را مجدداً بسته‌بندی می‌کند تا بتوانید بلافاصله از آن لذت ببرید.
111
125
 
126
+ ## کارهای آینده (Roadmap)
127
+
128
+ - اضافه کردن قابلیت حل مشکل راست‌به‌چپ برای **Antigravity IDE**.
129
+
112
130
  ## مشارکت در توسعه
113
131
 
114
132
  با کمال میل از نظرات، گزارشِ باگ‌ها و Pull Request های شما استقبال می‌شود.
package/index.js CHANGED
@@ -7,12 +7,80 @@ import picocolors from 'picocolors';
7
7
  import ora from 'ora';
8
8
  import prompts from 'prompts';
9
9
  import * as asar from '@electron/asar';
10
+ import figlet from 'figlet';
10
11
 
11
12
  const __filename = fileURLToPath(import.meta.url);
12
13
  const __dirname = path.dirname(__filename);
13
14
  const { blue, cyan, green, red, yellow, bold } = picocolors;
14
15
 
15
- console.log(bold(cyan('\n✨ Antigravity Smart RTL Patcher\n')));
16
+ const pkgPath = path.join(__dirname, 'package.json');
17
+ const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
18
+
19
+ function printBanner() {
20
+ try {
21
+ const fullArt = figlet.textSync('Antigravity RTL', { font: 'RubiFont' }).split('\n');
22
+
23
+ // Hex colors for the multi-color gradient
24
+ const hexColors = [
25
+ '#3387FF',
26
+ '#F25041',
27
+ '#DFAC2A',
28
+ '#91C45B'
29
+ ];
30
+
31
+ // Parse hex to RGB
32
+ const colors = hexColors.map(hex => {
33
+ const bigint = parseInt(hex.replace('#', ''), 16);
34
+ return {
35
+ r: (bigint >> 16) & 255,
36
+ g: (bigint >> 8) & 255,
37
+ b: bigint & 255
38
+ };
39
+ });
40
+
41
+ const applyGradient = (text) => {
42
+ let result = '';
43
+ const len = text.length;
44
+ for (let i = 0; i < len; i++) {
45
+ const char = text[i];
46
+ if (char === ' ' || char === '\n') {
47
+ result += char;
48
+ continue;
49
+ }
50
+ const factor = len > 1 ? i / (len - 1) : 0;
51
+
52
+ // Find current segment in the multi-color transition
53
+ const segments = colors.length - 1;
54
+ const segmentFloat = factor * segments;
55
+ const segmentIdx = Math.min(Math.floor(segmentFloat), segments - 1);
56
+ const segmentFactor = segmentFloat - segmentIdx;
57
+
58
+ const cStart = colors[segmentIdx];
59
+ const cEnd = colors[segmentIdx + 1];
60
+
61
+ const r = Math.round(cStart.r + segmentFactor * (cEnd.r - cStart.r));
62
+ const g = Math.round(cStart.g + segmentFactor * (cEnd.g - cStart.g));
63
+ const b = Math.round(cStart.b + segmentFactor * (cEnd.b - cStart.b));
64
+
65
+ result += `\x1b[38;2;${r};${g};${b}m${char}\x1b[0m`;
66
+ }
67
+ return result;
68
+ };
69
+
70
+ console.log('');
71
+ for (const line of fullArt) {
72
+ if (!line.trim()) continue;
73
+ console.log(applyGradient(line));
74
+ }
75
+ console.log('');
76
+ console.log(`\x1b[2m RTL & UI Patcher for Antigravity | v${pkg.version}\x1b[0m\n`);
77
+ } catch (err) {
78
+ // Fallback banner in case figlet has issues loading
79
+ console.log(bold(cyan(`\n✨ Antigravity Smart RTL Patcher v${pkg.version}\n`)));
80
+ }
81
+ }
82
+
83
+ printBanner();
16
84
 
17
85
  function getDefaultPath() {
18
86
  if (os.platform() === 'darwin') {
@@ -81,10 +149,13 @@ async function main() {
81
149
  console.error(red('\nSystem Error: ' + e.message));
82
150
  if (os.platform() === 'win32') {
83
151
  console.error(yellow('\nPlease run your terminal (PowerShell/CMD) as Administrator and try again.\n'));
152
+ } else if (os.platform() === 'darwin') {
153
+ console.error(yellow('\nPlease ensure you run this command with sudo.'));
154
+ console.error(yellow('If you are using sudo, macOS requires your terminal to have "App Management" permission.'));
155
+ console.error(yellow('Go to: System Settings > Privacy & Security > App Management'));
156
+ console.error(yellow('And enable the toggle for your terminal (e.g. Terminal, iTerm2, VS Code), then try again.\n'));
84
157
  } else {
85
- console.error(yellow('\nNote: "sudo npx" sometimes drops root privileges. If so, try this alternative:'));
86
- console.error(bold(' sudo npm install -g antigravity-rtl'));
87
- console.error(bold(' sudo antigravity-rtl\n'));
158
+ console.error(yellow('\nPlease run this command with sudo.\n'));
88
159
  }
89
160
  process.exit(1);
90
161
  }
@@ -127,6 +198,8 @@ async function main() {
127
198
  }
128
199
 
129
200
  utilsCode = utilsCode.replace(anchor, payload);
201
+ // Force-enable DevTools in packaged app
202
+ utilsCode = utilsCode.replace(/devTools:\s*!electron_1?\.app\.isPackaged/g, 'devTools: true');
130
203
  fs.writeFileSync(utilsPath, utilsCode);
131
204
 
132
205
  const fontSource = path.join(__dirname, 'Vazirmatn-Variable.woff2');
package/package.json CHANGED
@@ -1,20 +1,30 @@
1
1
  {
2
2
  "name": "antigravity-rtl",
3
- "version": "1.0.2",
3
+ "version": "1.0.7",
4
4
  "description": "A smart RTL (Right-to-Left) patcher with UI settings for the Antigravity application.",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1"
8
8
  },
9
- "keywords": ["antigravity", "rtl", "persian", "arabic", "hebrew", "patcher", "electron", "asar"],
9
+ "keywords": [
10
+ "antigravity",
11
+ "rtl",
12
+ "persian",
13
+ "arabic",
14
+ "hebrew",
15
+ "patcher",
16
+ "electron",
17
+ "asar"
18
+ ],
10
19
  "author": "mmnaderi",
11
20
  "license": "MIT",
12
21
  "dependencies": {
13
22
  "@electron/asar": "^4.2.0",
23
+ "figlet": "^1.11.0",
14
24
  "ora": "^9.4.1",
15
25
  "picocolors": "^1.1.1",
16
26
  "prompts": "^2.4.2"
17
27
  },
18
28
  "type": "module",
19
29
  "bin": "index.js"
20
- }
30
+ }
package/payload.js CHANGED
@@ -98,7 +98,7 @@ win.webContents.on('console-message', (event, level, message) => {
98
98
  [data-testid="user-input-step"] > *:not(pre):not(code) {
99
99
  direction: rtl !important;
100
100
  text-align: right !important;
101
- unicode-bidi: normal !important;
101
+ unicode-bidi: isolate !important;
102
102
  }
103
103
  \` : '';
104
104
 
@@ -145,14 +145,14 @@ win.webContents.on('console-message', (event, level, message) => {
145
145
  .cursor-edit.text-secondary-foreground * {
146
146
  direction: ltr !important;
147
147
  text-align: left !important;
148
- unicode-bidi: normal !important;
148
+ unicode-bidi: isolate !important;
149
149
  }
150
150
 
151
151
  /* Custom CSS removed to rely on Tailwind completely */
152
152
 
153
153
  /* Code Blocks */
154
154
  pre, code, pre *, code * {
155
- unicode-bidi: normal !important;
155
+ unicode-bidi: isolate !important;
156
156
  direction: ltr !important;
157
157
  text-align: left !important;
158
158
  font-family: \${codeFontStr} !important;
@@ -164,7 +164,7 @@ win.webContents.on('console-message', (event, level, message) => {
164
164
  }
165
165
 
166
166
  [contenteditable="true"], [contenteditable="true"] * {
167
- unicode-bidi: normal !important;
167
+ unicode-bidi: isolate !important;
168
168
  text-align: start !important;
169
169
  }
170
170