@gxp-dev/tools 2.0.63 → 2.0.64
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 +32 -31
- package/bin/gx-devtools.js +74 -54
- package/bin/lib/cli.js +23 -21
- package/bin/lib/commands/add-dependency.js +366 -325
- package/bin/lib/commands/assets.js +137 -139
- package/bin/lib/commands/build.js +169 -174
- package/bin/lib/commands/datastore.js +181 -183
- package/bin/lib/commands/dev.js +127 -131
- package/bin/lib/commands/extensions.js +147 -149
- package/bin/lib/commands/extract-config.js +73 -67
- package/bin/lib/commands/index.js +12 -12
- package/bin/lib/commands/init.js +342 -240
- package/bin/lib/commands/publish.js +69 -75
- package/bin/lib/commands/socket.js +69 -69
- package/bin/lib/commands/ssl.js +14 -14
- package/bin/lib/constants.js +10 -24
- package/bin/lib/tui/App.tsx +761 -705
- package/bin/lib/tui/components/AIPanel.tsx +191 -171
- package/bin/lib/tui/components/CommandInput.tsx +394 -343
- package/bin/lib/tui/components/GeminiPanel.tsx +175 -151
- package/bin/lib/tui/components/Header.tsx +23 -21
- package/bin/lib/tui/components/LogPanel.tsx +244 -220
- package/bin/lib/tui/components/TabBar.tsx +50 -48
- package/bin/lib/tui/components/WelcomeScreen.tsx +126 -71
- package/bin/lib/tui/index.tsx +37 -39
- package/bin/lib/tui/services/AIService.ts +518 -462
- package/bin/lib/tui/services/ExtensionService.ts +140 -129
- package/bin/lib/tui/services/GeminiService.ts +367 -337
- package/bin/lib/tui/services/ServiceManager.ts +344 -322
- package/bin/lib/tui/services/SocketService.ts +168 -168
- package/bin/lib/tui/services/ViteService.ts +88 -88
- package/bin/lib/tui/services/index.ts +47 -22
- package/bin/lib/utils/ai-scaffold.js +291 -280
- package/bin/lib/utils/extract-config.js +157 -140
- package/bin/lib/utils/files.js +82 -86
- package/bin/lib/utils/index.js +7 -7
- package/bin/lib/utils/paths.js +34 -34
- package/bin/lib/utils/prompts.js +194 -169
- package/bin/lib/utils/ssl.js +79 -81
- package/browser-extensions/README.md +0 -1
- package/browser-extensions/chrome/background.js +244 -237
- package/browser-extensions/chrome/content.js +32 -29
- package/browser-extensions/chrome/devtools.html +7 -7
- package/browser-extensions/chrome/devtools.js +19 -19
- package/browser-extensions/chrome/inspector.js +802 -767
- package/browser-extensions/chrome/manifest.json +71 -63
- package/browser-extensions/chrome/panel.html +674 -636
- package/browser-extensions/chrome/panel.js +722 -712
- package/browser-extensions/chrome/popup.html +586 -543
- package/browser-extensions/chrome/popup.js +282 -244
- package/browser-extensions/chrome/rules.json +1 -1
- package/browser-extensions/chrome/test-chrome.html +216 -136
- package/browser-extensions/chrome/test-mixed-content.html +284 -189
- package/browser-extensions/chrome/test-uri-pattern.html +221 -198
- package/browser-extensions/firefox/README.md +9 -6
- package/browser-extensions/firefox/background.js +221 -218
- package/browser-extensions/firefox/content.js +55 -52
- package/browser-extensions/firefox/debug-errors.html +386 -228
- package/browser-extensions/firefox/debug-https.html +153 -105
- package/browser-extensions/firefox/devtools.html +7 -7
- package/browser-extensions/firefox/devtools.js +23 -20
- package/browser-extensions/firefox/inspector.js +802 -767
- package/browser-extensions/firefox/manifest.json +68 -68
- package/browser-extensions/firefox/panel.html +674 -636
- package/browser-extensions/firefox/panel.js +722 -712
- package/browser-extensions/firefox/popup.html +572 -535
- package/browser-extensions/firefox/popup.js +281 -236
- package/browser-extensions/firefox/test-gramercy.html +170 -125
- package/browser-extensions/firefox/test-imports.html +59 -55
- package/browser-extensions/firefox/test-masking.html +231 -140
- package/browser-extensions/firefox/test-uri-pattern.html +221 -198
- package/dist/tui/App.d.ts +1 -1
- package/dist/tui/App.d.ts.map +1 -1
- package/dist/tui/App.js +154 -150
- package/dist/tui/App.js.map +1 -1
- package/dist/tui/components/AIPanel.d.ts.map +1 -1
- package/dist/tui/components/AIPanel.js +42 -35
- package/dist/tui/components/AIPanel.js.map +1 -1
- package/dist/tui/components/CommandInput.d.ts +1 -1
- package/dist/tui/components/CommandInput.d.ts.map +1 -1
- package/dist/tui/components/CommandInput.js +92 -62
- package/dist/tui/components/CommandInput.js.map +1 -1
- package/dist/tui/components/GeminiPanel.d.ts.map +1 -1
- package/dist/tui/components/GeminiPanel.js +37 -30
- package/dist/tui/components/GeminiPanel.js.map +1 -1
- package/dist/tui/components/Header.d.ts.map +1 -1
- package/dist/tui/components/Header.js +1 -1
- package/dist/tui/components/Header.js.map +1 -1
- package/dist/tui/components/LogPanel.d.ts +1 -1
- package/dist/tui/components/LogPanel.d.ts.map +1 -1
- package/dist/tui/components/LogPanel.js +26 -24
- package/dist/tui/components/LogPanel.js.map +1 -1
- package/dist/tui/components/TabBar.d.ts +2 -2
- package/dist/tui/components/TabBar.d.ts.map +1 -1
- package/dist/tui/components/TabBar.js +11 -11
- package/dist/tui/components/TabBar.js.map +1 -1
- package/dist/tui/components/WelcomeScreen.d.ts.map +1 -1
- package/dist/tui/components/WelcomeScreen.js +6 -6
- package/dist/tui/components/WelcomeScreen.js.map +1 -1
- package/dist/tui/index.d.ts.map +1 -1
- package/dist/tui/index.js +8 -8
- package/dist/tui/index.js.map +1 -1
- package/dist/tui/services/AIService.d.ts +2 -2
- package/dist/tui/services/AIService.d.ts.map +1 -1
- package/dist/tui/services/AIService.js +165 -125
- package/dist/tui/services/AIService.js.map +1 -1
- package/dist/tui/services/ExtensionService.d.ts +1 -1
- package/dist/tui/services/ExtensionService.d.ts.map +1 -1
- package/dist/tui/services/ExtensionService.js +33 -26
- package/dist/tui/services/ExtensionService.js.map +1 -1
- package/dist/tui/services/GeminiService.d.ts +1 -1
- package/dist/tui/services/GeminiService.d.ts.map +1 -1
- package/dist/tui/services/GeminiService.js +87 -76
- package/dist/tui/services/GeminiService.js.map +1 -1
- package/dist/tui/services/ServiceManager.d.ts +3 -3
- package/dist/tui/services/ServiceManager.d.ts.map +1 -1
- package/dist/tui/services/ServiceManager.js +72 -58
- package/dist/tui/services/ServiceManager.js.map +1 -1
- package/dist/tui/services/SocketService.d.ts.map +1 -1
- package/dist/tui/services/SocketService.js +32 -32
- package/dist/tui/services/SocketService.js.map +1 -1
- package/dist/tui/services/ViteService.d.ts.map +1 -1
- package/dist/tui/services/ViteService.js +26 -28
- package/dist/tui/services/ViteService.js.map +1 -1
- package/dist/tui/services/index.d.ts +6 -6
- package/dist/tui/services/index.d.ts.map +1 -1
- package/dist/tui/services/index.js +6 -6
- package/dist/tui/services/index.js.map +1 -1
- package/mcp/gxp-api-server.js +83 -81
- package/package.json +109 -93
- package/runtime/PortalContainer.vue +258 -234
- package/runtime/dev-tools/DevToolsModal.vue +153 -155
- package/runtime/dev-tools/LayoutSwitcher.vue +144 -140
- package/runtime/dev-tools/MockDataEditor.vue +456 -433
- package/runtime/dev-tools/SocketSimulator.vue +379 -371
- package/runtime/dev-tools/StoreInspector.vue +517 -455
- package/runtime/dev-tools/index.js +5 -5
- package/runtime/fallback-layouts/PrivateLayout.vue +2 -2
- package/runtime/fallback-layouts/PublicLayout.vue +2 -2
- package/runtime/fallback-layouts/SystemLayout.vue +2 -2
- package/runtime/gxpStringsPlugin.js +159 -134
- package/runtime/index.html +17 -19
- package/runtime/main.js +24 -22
- package/runtime/mock-api/auth-middleware.js +15 -15
- package/runtime/mock-api/image-generator.js +46 -46
- package/runtime/mock-api/index.js +55 -55
- package/runtime/mock-api/response-generator.js +116 -105
- package/runtime/mock-api/route-generator.js +107 -84
- package/runtime/mock-api/socket-triggers.js +94 -93
- package/runtime/mock-api/spec-loader.js +79 -80
- package/runtime/package.json +3 -0
- package/runtime/server.js +68 -68
- package/runtime/stores/gxpPortalConfigStore.js +204 -186
- package/runtime/stores/index.js +2 -2
- package/runtime/vite-inspector-plugin.js +858 -707
- package/runtime/vite-source-tracker-plugin.js +132 -113
- package/runtime/vite.config.js +191 -139
- package/scripts/launch-chrome.js +41 -41
- package/scripts/pack-chrome.js +38 -39
- package/socket-events/AiSessionMessageCreated.json +17 -17
- package/socket-events/SocialStreamPostCreated.json +23 -23
- package/socket-events/SocialStreamPostVariantCompleted.json +22 -22
- package/template/.claude/agents/gxp-developer.md +100 -99
- package/template/.claude/settings.json +7 -7
- package/template/AGENTS.md +30 -23
- package/template/GEMINI.md +20 -20
- package/template/README.md +70 -53
- package/template/app-manifest.json +2 -4
- package/template/configuration.json +10 -10
- package/template/default-styling.css +1 -1
- package/template/index.html +18 -20
- package/template/main.js +24 -22
- package/template/src/DemoPage.vue +415 -362
- package/template/src/Plugin.vue +76 -85
- package/template/src/stores/index.js +3 -3
- package/template/src/stores/test-data.json +164 -172
- package/template/theme-layouts/AdditionalStyling.css +50 -50
- package/template/theme-layouts/PrivateLayout.vue +8 -12
- package/template/theme-layouts/PublicLayout.vue +8 -12
- package/template/theme-layouts/SystemLayout.vue +8 -12
- package/template/vite.extend.js +45 -0
- package/template/vite.config.js +0 -409
|
@@ -24,6 +24,7 @@ GxP plugins run inside a **container environment** provided by the `gxdev` devel
|
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
**Key Principle**: Users ONLY edit files in `src/` directory. The runtime container handles:
|
|
27
|
+
|
|
27
28
|
- Layout switching (Public, Private, System)
|
|
28
29
|
- Dev tools modal (Ctrl+Shift+D)
|
|
29
30
|
- Mock router for navigation
|
|
@@ -51,95 +52,95 @@ project/
|
|
|
51
52
|
The store is the central hub for all platform data. Import it in any component:
|
|
52
53
|
|
|
53
54
|
```javascript
|
|
54
|
-
import { useGxpStore } from "@/stores/gxpPortalConfigStore"
|
|
55
|
-
|
|
55
|
+
import { useGxpStore } from "@/stores/gxpPortalConfigStore"
|
|
56
56
|
|
|
57
|
-
const store = useGxpStore()
|
|
57
|
+
const store = useGxpStore()
|
|
58
58
|
```
|
|
59
59
|
|
|
60
60
|
### Store Sections
|
|
61
61
|
|
|
62
|
-
| Section
|
|
63
|
-
|
|
64
|
-
| `pluginVars`
|
|
65
|
-
| `stringsList`
|
|
66
|
-
| `assetList`
|
|
67
|
-
| `triggerState`
|
|
68
|
-
| `dependencyList`
|
|
69
|
-
| `permissionFlags` | Feature permissions
|
|
62
|
+
| Section | Purpose | Source |
|
|
63
|
+
| ----------------- | ----------------------------- | ------------------------------------- |
|
|
64
|
+
| `pluginVars` | Plugin settings/configuration | `app-manifest.json` → settings |
|
|
65
|
+
| `stringsList` | Translatable UI strings | `app-manifest.json` → strings.default |
|
|
66
|
+
| `assetList` | Asset URLs (images, etc.) | `app-manifest.json` → assets |
|
|
67
|
+
| `triggerState` | Dynamic runtime state | `app-manifest.json` → triggerState |
|
|
68
|
+
| `dependencyList` | External data dependencies | `app-manifest.json` → dependencies |
|
|
69
|
+
| `permissionFlags` | Feature permissions | `app-manifest.json` → permissions |
|
|
70
70
|
|
|
71
71
|
### Getter Methods
|
|
72
72
|
|
|
73
73
|
```javascript
|
|
74
74
|
// Get values with fallbacks
|
|
75
|
-
store.getString(
|
|
76
|
-
store.getSetting(
|
|
77
|
-
store.getAsset(
|
|
78
|
-
store.getState(
|
|
79
|
-
store.hasPermission(
|
|
75
|
+
store.getString("welcome_title", "Default Title")
|
|
76
|
+
store.getSetting("primary_color", "#FFD600")
|
|
77
|
+
store.getAsset("hero_image", "/fallback.jpg")
|
|
78
|
+
store.getState("current_step", 0)
|
|
79
|
+
store.hasPermission("admin")
|
|
80
80
|
```
|
|
81
81
|
|
|
82
82
|
## API Calls - ALWAYS USE THE STORE
|
|
83
83
|
|
|
84
84
|
**CRITICAL**: Never use axios or fetch directly. Always use the store's API methods which handle:
|
|
85
|
+
|
|
85
86
|
- Authentication (Bearer token injection)
|
|
86
87
|
- Base URL configuration based on environment
|
|
87
88
|
- Proxy handling for CORS in development
|
|
88
89
|
- Error handling and logging
|
|
89
90
|
|
|
90
91
|
```javascript
|
|
91
|
-
const store = useGxpStore()
|
|
92
|
+
const store = useGxpStore()
|
|
92
93
|
|
|
93
94
|
// GET request
|
|
94
|
-
const data = await store.apiGet(
|
|
95
|
+
const data = await store.apiGet("/api/v1/attendees", { event_id: 123 })
|
|
95
96
|
|
|
96
97
|
// POST request
|
|
97
|
-
const result = await store.apiPost(
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
})
|
|
98
|
+
const result = await store.apiPost("/api/v1/check-ins", {
|
|
99
|
+
attendee_id: 456,
|
|
100
|
+
station_id: "kiosk-1",
|
|
101
|
+
})
|
|
101
102
|
|
|
102
103
|
// PUT request
|
|
103
|
-
await store.apiPut(
|
|
104
|
+
await store.apiPut("/api/v1/attendees/456", { status: "checked_in" })
|
|
104
105
|
|
|
105
106
|
// PATCH request
|
|
106
|
-
await store.apiPatch(
|
|
107
|
+
await store.apiPatch("/api/v1/attendees/456", { badge_printed: true })
|
|
107
108
|
|
|
108
109
|
// DELETE request
|
|
109
|
-
await store.apiDelete(
|
|
110
|
+
await store.apiDelete("/api/v1/check-ins/789")
|
|
110
111
|
```
|
|
111
112
|
|
|
112
113
|
### API Environment Configuration
|
|
113
114
|
|
|
114
115
|
The store reads `VITE_API_ENV` from `.env`:
|
|
115
116
|
|
|
116
|
-
| Environment
|
|
117
|
-
|
|
118
|
-
| `mock`
|
|
119
|
-
| `local`
|
|
120
|
-
| `develop`
|
|
121
|
-
| `staging`
|
|
122
|
-
| `production` | https://api.gramercy.cloud
|
|
117
|
+
| Environment | API Base URL |
|
|
118
|
+
| ------------ | ---------------------------------------------- |
|
|
119
|
+
| `mock` | Local mock server (default) |
|
|
120
|
+
| `local` | https://dashboard.eventfinity.test |
|
|
121
|
+
| `develop` | https://api.zenith-develop.env.eventfinity.app |
|
|
122
|
+
| `staging` | https://api.efz-staging.env.eventfinity.app |
|
|
123
|
+
| `production` | https://api.gramercy.cloud |
|
|
123
124
|
|
|
124
125
|
## WebSocket Events
|
|
125
126
|
|
|
126
127
|
WebSockets are pre-configured through the store. Listen for real-time events:
|
|
127
128
|
|
|
128
129
|
```javascript
|
|
129
|
-
const store = useGxpStore()
|
|
130
|
+
const store = useGxpStore()
|
|
130
131
|
|
|
131
132
|
// Listen on primary socket
|
|
132
|
-
store.listenSocket(
|
|
133
|
-
|
|
134
|
-
})
|
|
133
|
+
store.listenSocket("primary", "EventName", (data) => {
|
|
134
|
+
console.log("Event received:", data)
|
|
135
|
+
})
|
|
135
136
|
|
|
136
137
|
// Emit to primary socket
|
|
137
|
-
store.emitSocket(
|
|
138
|
+
store.emitSocket("primary", "client-event", { message: "Hello" })
|
|
138
139
|
|
|
139
140
|
// For dependency-based sockets (configured in app-manifest.json)
|
|
140
|
-
store.useSocketListener(
|
|
141
|
-
|
|
142
|
-
})
|
|
141
|
+
store.useSocketListener("dependency_identifier", "updated", (data) => {
|
|
142
|
+
console.log("Dependency updated:", data)
|
|
143
|
+
})
|
|
143
144
|
```
|
|
144
145
|
|
|
145
146
|
### Dependency Socket Configuration
|
|
@@ -148,16 +149,16 @@ In `app-manifest.json`:
|
|
|
148
149
|
|
|
149
150
|
```json
|
|
150
151
|
{
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
152
|
+
"dependencies": [
|
|
153
|
+
{
|
|
154
|
+
"identifier": "ai_session",
|
|
155
|
+
"model": "AiInterface",
|
|
156
|
+
"events": {
|
|
157
|
+
"created": "AiSessionMessageCreated",
|
|
158
|
+
"updated": "AiSessionMessageUpdated"
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
]
|
|
161
162
|
}
|
|
162
163
|
```
|
|
163
164
|
|
|
@@ -165,8 +166,8 @@ Then listen:
|
|
|
165
166
|
|
|
166
167
|
```javascript
|
|
167
168
|
store.sockets.ai_session?.created?.listen((data) => {
|
|
168
|
-
|
|
169
|
-
})
|
|
169
|
+
console.log("AI message created:", data)
|
|
170
|
+
})
|
|
170
171
|
```
|
|
171
172
|
|
|
172
173
|
## Vue Directives for Dynamic Content
|
|
@@ -191,10 +192,10 @@ store.sockets.ai_session?.created?.listen((data) => {
|
|
|
191
192
|
|
|
192
193
|
```html
|
|
193
194
|
<!-- Replace src from assetList (default) -->
|
|
194
|
-
<img gxp-src="hero_image" src="/placeholder.jpg" alt="Hero"
|
|
195
|
+
<img gxp-src="hero_image" src="/placeholder.jpg" alt="Hero" />
|
|
195
196
|
|
|
196
197
|
<!-- Replace src from triggerState -->
|
|
197
|
-
<img gxp-src="dynamic_image" gxp-state src="/placeholder.jpg"
|
|
198
|
+
<img gxp-src="dynamic_image" gxp-state src="/placeholder.jpg" />
|
|
198
199
|
```
|
|
199
200
|
|
|
200
201
|
## Component Template
|
|
@@ -203,48 +204,48 @@ When creating new components, use this pattern:
|
|
|
203
204
|
|
|
204
205
|
```vue
|
|
205
206
|
<template>
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
207
|
+
<div class="my-component">
|
|
208
|
+
<h1 gxp-string="component_title">Default Title</h1>
|
|
209
|
+
<img gxp-src="component_image" src="/placeholder.jpg" alt="" />
|
|
209
210
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
211
|
+
<button @click="handleAction" variant="primary">
|
|
212
|
+
<span gxp-string="action_button">Click Me</span>
|
|
213
|
+
</button>
|
|
213
214
|
|
|
214
|
-
|
|
215
|
-
|
|
215
|
+
<div v-if="loading" class="spinner"></div>
|
|
216
|
+
</div>
|
|
216
217
|
</template>
|
|
217
218
|
|
|
218
219
|
<script setup>
|
|
219
|
-
import { ref, onMounted } from
|
|
220
|
-
import { useGxpStore } from "@/stores/gxpPortalConfigStore"
|
|
220
|
+
import { ref, onMounted } from "vue"
|
|
221
|
+
import { useGxpStore } from "@/stores/gxpPortalConfigStore"
|
|
221
222
|
|
|
222
|
-
const store = useGxpStore()
|
|
223
|
-
const loading = ref(false)
|
|
224
|
-
const data = ref(null)
|
|
223
|
+
const store = useGxpStore()
|
|
224
|
+
const loading = ref(false)
|
|
225
|
+
const data = ref(null)
|
|
225
226
|
|
|
226
227
|
async function handleAction() {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
228
|
+
loading.value = true
|
|
229
|
+
try {
|
|
230
|
+
data.value = await store.apiGet("/api/v1/endpoint")
|
|
231
|
+
} catch (error) {
|
|
232
|
+
console.error("API Error:", error)
|
|
233
|
+
} finally {
|
|
234
|
+
loading.value = false
|
|
235
|
+
}
|
|
235
236
|
}
|
|
236
237
|
|
|
237
238
|
onMounted(() => {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
})
|
|
239
|
+
// Listen for real-time updates
|
|
240
|
+
store.listenSocket("primary", "DataUpdated", (eventData) => {
|
|
241
|
+
data.value = eventData
|
|
242
|
+
})
|
|
243
|
+
})
|
|
243
244
|
</script>
|
|
244
245
|
|
|
245
246
|
<style scoped>
|
|
246
247
|
.my-component {
|
|
247
|
-
|
|
248
|
+
padding: 20px;
|
|
248
249
|
}
|
|
249
250
|
</style>
|
|
250
251
|
```
|
|
@@ -255,24 +256,24 @@ This is the main configuration file. Changes hot-reload during development:
|
|
|
255
256
|
|
|
256
257
|
```json
|
|
257
258
|
{
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
259
|
+
"name": "my-plugin",
|
|
260
|
+
"description": "My GxP Plugin",
|
|
261
|
+
"settings": {
|
|
262
|
+
"primary_color": "#FFD600",
|
|
263
|
+
"idle_timeout": 30
|
|
264
|
+
},
|
|
265
|
+
"strings": {
|
|
266
|
+
"default": {
|
|
267
|
+
"welcome_title": "Welcome",
|
|
268
|
+
"action_button": "Get Started"
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
"assets": {
|
|
272
|
+
"hero_image": "/dev-assets/images/hero.jpg",
|
|
273
|
+
"logo": "/dev-assets/images/logo.png"
|
|
274
|
+
},
|
|
275
|
+
"dependencies": [],
|
|
276
|
+
"permissions": []
|
|
276
277
|
}
|
|
277
278
|
```
|
|
278
279
|
|
package/template/AGENTS.md
CHANGED
|
@@ -20,8 +20,8 @@ src/
|
|
|
20
20
|
The `gxpPortalConfigStore` is the central hub. Import it in any component:
|
|
21
21
|
|
|
22
22
|
```javascript
|
|
23
|
-
import { useGxpStore } from
|
|
24
|
-
const store = useGxpStore()
|
|
23
|
+
import { useGxpStore } from "@gx-runtime/stores/gxpPortalConfigStore"
|
|
24
|
+
const store = useGxpStore()
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
## API Calls - ALWAYS Use Store Methods
|
|
@@ -30,11 +30,11 @@ NEVER use axios or fetch directly. The store handles authentication, base URLs,
|
|
|
30
30
|
|
|
31
31
|
```javascript
|
|
32
32
|
// Correct - use store methods
|
|
33
|
-
const data = await store.apiGet(
|
|
34
|
-
await store.apiPost(
|
|
35
|
-
await store.apiPut(
|
|
36
|
-
await store.apiPatch(
|
|
37
|
-
await store.apiDelete(
|
|
33
|
+
const data = await store.apiGet("/api/v1/endpoint", { param: "value" })
|
|
34
|
+
await store.apiPost("/api/v1/endpoint", { data: "value" })
|
|
35
|
+
await store.apiPut("/api/v1/endpoint/123", { data: "value" })
|
|
36
|
+
await store.apiPatch("/api/v1/endpoint/123", { data: "value" })
|
|
37
|
+
await store.apiDelete("/api/v1/endpoint/123")
|
|
38
38
|
|
|
39
39
|
// WRONG - never do this
|
|
40
40
|
// const response = await axios.get(...); // NO!
|
|
@@ -45,17 +45,17 @@ await store.apiDelete('/api/v1/endpoint/123');
|
|
|
45
45
|
|
|
46
46
|
```javascript
|
|
47
47
|
// Get values with fallbacks
|
|
48
|
-
store.getString(
|
|
49
|
-
store.getSetting(
|
|
50
|
-
store.getAsset(
|
|
51
|
-
store.getState(
|
|
52
|
-
store.hasPermission(
|
|
48
|
+
store.getString("key", "default") // From stringsList
|
|
49
|
+
store.getSetting("key", "default") // From pluginVars
|
|
50
|
+
store.getAsset("key", "/fallback.jpg") // From assetList
|
|
51
|
+
store.getState("key", null) // From triggerState
|
|
52
|
+
store.hasPermission("admin") // Check permissions
|
|
53
53
|
|
|
54
54
|
// Update values
|
|
55
|
-
store.updateString(
|
|
56
|
-
store.updateSetting(
|
|
57
|
-
store.updateAsset(
|
|
58
|
-
store.updateState(
|
|
55
|
+
store.updateString("key", "value")
|
|
56
|
+
store.updateSetting("key", "value")
|
|
57
|
+
store.updateAsset("key", "url")
|
|
58
|
+
store.updateState("key", "value")
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
## WebSocket Events
|
|
@@ -64,15 +64,15 @@ Listen for real-time events through the store:
|
|
|
64
64
|
|
|
65
65
|
```javascript
|
|
66
66
|
// Listen on primary socket
|
|
67
|
-
store.listenSocket(
|
|
68
|
-
|
|
69
|
-
})
|
|
67
|
+
store.listenSocket("primary", "EventName", (data) => {
|
|
68
|
+
console.log("Received:", data)
|
|
69
|
+
})
|
|
70
70
|
|
|
71
71
|
// Emit events
|
|
72
|
-
store.emitSocket(
|
|
72
|
+
store.emitSocket("primary", "client-event", { data: "value" })
|
|
73
73
|
|
|
74
74
|
// For dependency-based sockets
|
|
75
|
-
store.useSocketListener(
|
|
75
|
+
store.useSocketListener("dependency_id", "updated", callback)
|
|
76
76
|
```
|
|
77
77
|
|
|
78
78
|
## Vue Directives for Dynamic Content
|
|
@@ -87,7 +87,7 @@ Use these directives instead of hardcoding text and images:
|
|
|
87
87
|
<span gxp-string="company_name" gxp-settings>Company</span>
|
|
88
88
|
|
|
89
89
|
<!-- Images from assets -->
|
|
90
|
-
<img gxp-src="hero_image" src="/placeholder.jpg" alt="Hero"
|
|
90
|
+
<img gxp-src="hero_image" src="/placeholder.jpg" alt="Hero" />
|
|
91
91
|
```
|
|
92
92
|
|
|
93
93
|
## Component Kit
|
|
@@ -95,7 +95,13 @@ Use these directives instead of hardcoding text and images:
|
|
|
95
95
|
Import UI components from `@gramercytech/gx-componentkit`:
|
|
96
96
|
|
|
97
97
|
```javascript
|
|
98
|
-
import {
|
|
98
|
+
import {
|
|
99
|
+
GxButton,
|
|
100
|
+
GxCard,
|
|
101
|
+
GxInput,
|
|
102
|
+
GxModal,
|
|
103
|
+
GxSpinner,
|
|
104
|
+
} from "@gramercytech/gx-componentkit"
|
|
99
105
|
```
|
|
100
106
|
|
|
101
107
|
Available: GxButton, GxCard, GxInput, GxModal, GxSpinner, GxAlert, GxBadge, GxAvatar, GxProgress, GxTabs, GxAccordion
|
|
@@ -113,6 +119,7 @@ Edit `app-manifest.json` for strings, assets, and settings. Changes hot-reload d
|
|
|
113
119
|
## API Environments
|
|
114
120
|
|
|
115
121
|
Set `VITE_API_ENV` in `.env`:
|
|
122
|
+
|
|
116
123
|
- `mock` - Local mock server (default)
|
|
117
124
|
- `develop` - https://api.zenith-develop.env.eventfinity.app
|
|
118
125
|
- `staging` - https://api.efz-staging.env.eventfinity.app
|
package/template/GEMINI.md
CHANGED
|
@@ -16,43 +16,43 @@ The plugin runs inside a container provided by the `gxdev` server. Only edit fil
|
|
|
16
16
|
NEVER use axios or fetch directly. Always use the store's API methods:
|
|
17
17
|
|
|
18
18
|
```javascript
|
|
19
|
-
import { useGxpStore } from
|
|
20
|
-
const store = useGxpStore()
|
|
19
|
+
import { useGxpStore } from "@gx-runtime/stores/gxpPortalConfigStore"
|
|
20
|
+
const store = useGxpStore()
|
|
21
21
|
|
|
22
22
|
// API methods (handles auth, CORS, base URL automatically)
|
|
23
|
-
await store.apiGet(
|
|
24
|
-
await store.apiPost(
|
|
25
|
-
await store.apiPut(
|
|
26
|
-
await store.apiPatch(
|
|
27
|
-
await store.apiDelete(
|
|
23
|
+
await store.apiGet("/api/v1/endpoint", { params })
|
|
24
|
+
await store.apiPost("/api/v1/endpoint", data)
|
|
25
|
+
await store.apiPut("/api/v1/endpoint/id", data)
|
|
26
|
+
await store.apiPatch("/api/v1/endpoint/id", data)
|
|
27
|
+
await store.apiDelete("/api/v1/endpoint/id")
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
## Store Data Access
|
|
31
31
|
|
|
32
32
|
```javascript
|
|
33
33
|
// Getters
|
|
34
|
-
store.getString(
|
|
35
|
-
store.getSetting(
|
|
36
|
-
store.getAsset(
|
|
37
|
-
store.getState(
|
|
34
|
+
store.getString("key", "default") // UI strings
|
|
35
|
+
store.getSetting("key", "default") // Settings
|
|
36
|
+
store.getAsset("key", "/fallback.jpg") // Asset URLs
|
|
37
|
+
store.getState("key", null) // Runtime state
|
|
38
38
|
|
|
39
39
|
// Setters
|
|
40
|
-
store.updateString(
|
|
41
|
-
store.updateSetting(
|
|
42
|
-
store.updateAsset(
|
|
43
|
-
store.updateState(
|
|
40
|
+
store.updateString("key", "value")
|
|
41
|
+
store.updateSetting("key", "value")
|
|
42
|
+
store.updateAsset("key", "url")
|
|
43
|
+
store.updateState("key", "value")
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
## WebSocket Events
|
|
47
47
|
|
|
48
48
|
```javascript
|
|
49
49
|
// Listen for events
|
|
50
|
-
store.listenSocket(
|
|
51
|
-
|
|
52
|
-
})
|
|
50
|
+
store.listenSocket("primary", "EventName", (data) => {
|
|
51
|
+
console.log("Event received:", data)
|
|
52
|
+
})
|
|
53
53
|
|
|
54
54
|
// Emit events
|
|
55
|
-
store.emitSocket(
|
|
55
|
+
store.emitSocket("primary", "event-name", data)
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
## Vue Directives
|
|
@@ -62,7 +62,7 @@ store.emitSocket('primary', 'event-name', data);
|
|
|
62
62
|
<h1 gxp-string="welcome_title">Default</h1>
|
|
63
63
|
|
|
64
64
|
<!-- Dynamic images from assets -->
|
|
65
|
-
<img gxp-src="hero_image" src="/placeholder.jpg"
|
|
65
|
+
<img gxp-src="hero_image" src="/placeholder.jpg" />
|
|
66
66
|
```
|
|
67
67
|
|
|
68
68
|
## Component Kit
|