@gxp-dev/tools 2.0.58 → 2.0.59
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/package.json
CHANGED
|
@@ -68,7 +68,7 @@ function getApiConfig() {
|
|
|
68
68
|
if (isDev) {
|
|
69
69
|
const protocol = useHttps ? "https" : "http";
|
|
70
70
|
return {
|
|
71
|
-
apiBaseUrl: `${protocol}://localhost:${
|
|
71
|
+
apiBaseUrl: `${protocol}://localhost:${nodePort}/api-proxy`,
|
|
72
72
|
authToken: "", // Proxy injects the token server-side
|
|
73
73
|
projectId: projectId,
|
|
74
74
|
};
|
|
@@ -51,9 +51,8 @@ project/
|
|
|
51
51
|
The store is the central hub for all platform data. Import it in any component:
|
|
52
52
|
|
|
53
53
|
```javascript
|
|
54
|
-
import { useGxpStore } from
|
|
55
|
-
|
|
56
|
-
import { useGxpStore } from '@/stores/index.js';
|
|
54
|
+
import { useGxpStore } from "@/stores/gxpPortalConfigStore";
|
|
55
|
+
|
|
57
56
|
|
|
58
57
|
const store = useGxpStore();
|
|
59
58
|
```
|
|
@@ -80,16 +79,6 @@ store.getState('current_step', 0);
|
|
|
80
79
|
store.hasPermission('admin');
|
|
81
80
|
```
|
|
82
81
|
|
|
83
|
-
### Update Methods
|
|
84
|
-
|
|
85
|
-
```javascript
|
|
86
|
-
// Update store values programmatically
|
|
87
|
-
store.updateString('welcome_title', 'New Title');
|
|
88
|
-
store.updateSetting('primary_color', '#FF0000');
|
|
89
|
-
store.updateAsset('hero_image', '/new-image.jpg');
|
|
90
|
-
store.updateState('current_step', 2);
|
|
91
|
-
```
|
|
92
|
-
|
|
93
82
|
## API Calls - ALWAYS USE THE STORE
|
|
94
83
|
|
|
95
84
|
**CRITICAL**: Never use axios or fetch directly. Always use the store's API methods which handle:
|
|
@@ -218,18 +207,17 @@ When creating new components, use this pattern:
|
|
|
218
207
|
<h1 gxp-string="component_title">Default Title</h1>
|
|
219
208
|
<img gxp-src="component_image" src="/placeholder.jpg" alt="">
|
|
220
209
|
|
|
221
|
-
<
|
|
210
|
+
<button @click="handleAction" variant="primary">
|
|
222
211
|
<span gxp-string="action_button">Click Me</span>
|
|
223
|
-
</
|
|
212
|
+
</button>
|
|
224
213
|
|
|
225
|
-
<
|
|
214
|
+
<div v-if="loading" class="spinner"></div>
|
|
226
215
|
</div>
|
|
227
216
|
</template>
|
|
228
217
|
|
|
229
218
|
<script setup>
|
|
230
219
|
import { ref, onMounted } from 'vue';
|
|
231
|
-
import { useGxpStore } from
|
|
232
|
-
import { GxButton, GxSpinner } from '@gramercytech/gx-componentkit';
|
|
220
|
+
import { useGxpStore } from "@/stores/gxpPortalConfigStore";
|
|
233
221
|
|
|
234
222
|
const store = useGxpStore();
|
|
235
223
|
const loading = ref(false);
|
|
@@ -261,21 +249,6 @@ onMounted(() => {
|
|
|
261
249
|
</style>
|
|
262
250
|
```
|
|
263
251
|
|
|
264
|
-
## GxP Component Kit
|
|
265
|
-
|
|
266
|
-
Use these pre-built components from `@gramercytech/gx-componentkit`:
|
|
267
|
-
|
|
268
|
-
- `GxButton` - Styled buttons (variants: primary, secondary, outline)
|
|
269
|
-
- `GxCard` - Card containers
|
|
270
|
-
- `GxInput` - Form inputs with validation
|
|
271
|
-
- `GxModal` - Modal dialogs
|
|
272
|
-
- `GxSpinner` - Loading indicators
|
|
273
|
-
- `GxAlert` - Notifications
|
|
274
|
-
- `GxBadge` - Status badges
|
|
275
|
-
- `GxAvatar` - User avatars
|
|
276
|
-
- `GxProgress` - Progress bars
|
|
277
|
-
- `GxTabs` - Tab navigation
|
|
278
|
-
|
|
279
252
|
## app-manifest.json
|
|
280
253
|
|
|
281
254
|
This is the main configuration file. Changes hot-reload during development:
|