rn-studio 0.2.0 → 0.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.
- package/README.md +8 -0
- package/bin/rn-studio-init.js +173 -0
- package/bin/rn-studio-server.js +77 -14
- package/dist/StudioProvider.d.ts +5 -18
- package/dist/StudioProvider.d.ts.map +1 -1
- package/dist/StudioProvider.js +118 -41
- package/dist/StudioProvider.js.map +1 -1
- package/dist/ast/AstEngine.d.ts.map +1 -1
- package/dist/ast/AstEngine.js +10 -0
- package/dist/ast/AstEngine.js.map +1 -1
- package/dist/ast/UndoStack.d.ts +18 -0
- package/dist/ast/UndoStack.d.ts.map +1 -0
- package/dist/ast/UndoStack.js +105 -0
- package/dist/ast/UndoStack.js.map +1 -0
- package/dist/components/AddPropertyModal.d.ts +19 -0
- package/dist/components/AddPropertyModal.d.ts.map +1 -0
- package/dist/components/AddPropertyModal.js +174 -0
- package/dist/components/AddPropertyModal.js.map +1 -0
- package/dist/components/InspectorPanel.js +35 -5
- package/dist/components/InspectorPanel.js.map +1 -1
- package/dist/components/SelectionOverlay.d.ts.map +1 -1
- package/dist/components/SelectionOverlay.js +5 -0
- package/dist/components/SelectionOverlay.js.map +1 -1
- package/dist/components/StyleEditor.d.ts +5 -3
- package/dist/components/StyleEditor.d.ts.map +1 -1
- package/dist/components/StyleEditor.js +45 -11
- package/dist/components/StyleEditor.js.map +1 -1
- package/dist/data/styleProperties.d.ts +26 -0
- package/dist/data/styleProperties.d.ts.map +1 -0
- package/dist/data/styleProperties.js +142 -0
- package/dist/data/styleProperties.js.map +1 -0
- package/dist/types.d.ts +19 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/autoScroll.d.ts +15 -0
- package/dist/utils/autoScroll.d.ts.map +1 -0
- package/dist/utils/autoScroll.js +132 -0
- package/dist/utils/autoScroll.js.map +1 -0
- package/dist/utils/findFiberBySource.d.ts +17 -0
- package/dist/utils/findFiberBySource.d.ts.map +1 -0
- package/dist/utils/findFiberBySource.js +76 -0
- package/dist/utils/findFiberBySource.js.map +1 -0
- package/dist/utils/persistence.d.ts +12 -0
- package/dist/utils/persistence.d.ts.map +1 -0
- package/dist/utils/persistence.js +44 -0
- package/dist/utils/persistence.js.map +1 -0
- package/package.json +3 -2
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* persistence
|
|
3
|
+
*
|
|
4
|
+
* Lightweight AsyncStorage wrapper for persisting the last-selected
|
|
5
|
+
* component source across full JS reloads (Cmd+R). Falls back to a
|
|
6
|
+
* no-op in environments where AsyncStorage isn't installed.
|
|
7
|
+
*/
|
|
8
|
+
import type { SourceLocation } from '../types';
|
|
9
|
+
export declare function saveLastSelection(source: SourceLocation): Promise<void>;
|
|
10
|
+
export declare function loadLastSelection(): Promise<SourceLocation | null>;
|
|
11
|
+
export declare function clearLastSelection(): Promise<void>;
|
|
12
|
+
//# sourceMappingURL=persistence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persistence.d.ts","sourceRoot":"","sources":["../../src/utils/persistence.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAU/C,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAK7E;AAED,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAWxE;AAED,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CAKxD"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.saveLastSelection = saveLastSelection;
|
|
4
|
+
exports.loadLastSelection = loadLastSelection;
|
|
5
|
+
exports.clearLastSelection = clearLastSelection;
|
|
6
|
+
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
7
|
+
let AsyncStorage = null;
|
|
8
|
+
try {
|
|
9
|
+
AsyncStorage = require('@react-native-async-storage/async-storage').default;
|
|
10
|
+
}
|
|
11
|
+
catch { }
|
|
12
|
+
const KEY = '@rn-studio/last-selection';
|
|
13
|
+
async function saveLastSelection(source) {
|
|
14
|
+
if (!AsyncStorage)
|
|
15
|
+
return;
|
|
16
|
+
try {
|
|
17
|
+
await AsyncStorage.setItem(KEY, JSON.stringify(source));
|
|
18
|
+
}
|
|
19
|
+
catch { }
|
|
20
|
+
}
|
|
21
|
+
async function loadLastSelection() {
|
|
22
|
+
if (!AsyncStorage)
|
|
23
|
+
return null;
|
|
24
|
+
try {
|
|
25
|
+
const raw = await AsyncStorage.getItem(KEY);
|
|
26
|
+
if (!raw)
|
|
27
|
+
return null;
|
|
28
|
+
const parsed = JSON.parse(raw);
|
|
29
|
+
if (parsed && parsed.file && typeof parsed.line === 'number') {
|
|
30
|
+
return parsed;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
catch { }
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
async function clearLastSelection() {
|
|
37
|
+
if (!AsyncStorage)
|
|
38
|
+
return;
|
|
39
|
+
try {
|
|
40
|
+
await AsyncStorage.removeItem(KEY);
|
|
41
|
+
}
|
|
42
|
+
catch { }
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=persistence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persistence.js","sourceRoot":"","sources":["../../src/utils/persistence.ts"],"names":[],"mappings":";;AAiBA,8CAKC;AAED,8CAWC;AAED,gDAKC;AAjCD,uDAAuD;AACvD,IAAI,YAAY,GAAQ,IAAI,CAAC;AAC7B,IAAI,CAAC;IACH,YAAY,GAAG,OAAO,CAAC,2CAA2C,CAAC,CAAC,OAAO,CAAC;AAC9E,CAAC;AAAC,MAAM,CAAC,CAAA,CAAC;AAEV,MAAM,GAAG,GAAG,2BAA2B,CAAC;AAEjC,KAAK,UAAU,iBAAiB,CAAC,MAAsB;IAC5D,IAAI,CAAC,YAAY;QAAE,OAAO;IAC1B,IAAI,CAAC;QACH,MAAM,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;IAC1D,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;AACZ,CAAC;AAEM,KAAK,UAAU,iBAAiB;IACrC,IAAI,CAAC,YAAY;QAAE,OAAO,IAAI,CAAC;IAC/B,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC5C,IAAI,CAAC,GAAG;YAAE,OAAO,IAAI,CAAC;QACtB,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC/B,IAAI,MAAM,IAAI,MAAM,CAAC,IAAI,IAAI,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC7D,OAAO,MAAwB,CAAC;QAClC,CAAC;IACH,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;IACV,OAAO,IAAI,CAAC;AACd,CAAC;AAEM,KAAK,UAAU,kBAAkB;IACtC,IAAI,CAAC,YAAY;QAAE,OAAO;IAC1B,IAAI,CAAC;QACH,MAAM,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACrC,CAAC;IAAC,MAAM,CAAC,CAAA,CAAC;AACZ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rn-studio",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Live UI editor for React Native — inspect and edit components directly in your emulator",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"README.md"
|
|
12
12
|
],
|
|
13
13
|
"bin": {
|
|
14
|
-
"rn-studio-server": "./bin/rn-studio-server.js"
|
|
14
|
+
"rn-studio-server": "./bin/rn-studio-server.js",
|
|
15
|
+
"rn-studio-init": "./bin/rn-studio-init.js"
|
|
15
16
|
},
|
|
16
17
|
"scripts": {
|
|
17
18
|
"build": "tsc",
|