@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.
Files changed (182) hide show
  1. package/README.md +32 -31
  2. package/bin/gx-devtools.js +74 -54
  3. package/bin/lib/cli.js +23 -21
  4. package/bin/lib/commands/add-dependency.js +366 -325
  5. package/bin/lib/commands/assets.js +137 -139
  6. package/bin/lib/commands/build.js +169 -174
  7. package/bin/lib/commands/datastore.js +181 -183
  8. package/bin/lib/commands/dev.js +127 -131
  9. package/bin/lib/commands/extensions.js +147 -149
  10. package/bin/lib/commands/extract-config.js +73 -67
  11. package/bin/lib/commands/index.js +12 -12
  12. package/bin/lib/commands/init.js +342 -240
  13. package/bin/lib/commands/publish.js +69 -75
  14. package/bin/lib/commands/socket.js +69 -69
  15. package/bin/lib/commands/ssl.js +14 -14
  16. package/bin/lib/constants.js +10 -24
  17. package/bin/lib/tui/App.tsx +761 -705
  18. package/bin/lib/tui/components/AIPanel.tsx +191 -171
  19. package/bin/lib/tui/components/CommandInput.tsx +394 -343
  20. package/bin/lib/tui/components/GeminiPanel.tsx +175 -151
  21. package/bin/lib/tui/components/Header.tsx +23 -21
  22. package/bin/lib/tui/components/LogPanel.tsx +244 -220
  23. package/bin/lib/tui/components/TabBar.tsx +50 -48
  24. package/bin/lib/tui/components/WelcomeScreen.tsx +126 -71
  25. package/bin/lib/tui/index.tsx +37 -39
  26. package/bin/lib/tui/services/AIService.ts +518 -462
  27. package/bin/lib/tui/services/ExtensionService.ts +140 -129
  28. package/bin/lib/tui/services/GeminiService.ts +367 -337
  29. package/bin/lib/tui/services/ServiceManager.ts +344 -322
  30. package/bin/lib/tui/services/SocketService.ts +168 -168
  31. package/bin/lib/tui/services/ViteService.ts +88 -88
  32. package/bin/lib/tui/services/index.ts +47 -22
  33. package/bin/lib/utils/ai-scaffold.js +291 -280
  34. package/bin/lib/utils/extract-config.js +157 -140
  35. package/bin/lib/utils/files.js +82 -86
  36. package/bin/lib/utils/index.js +7 -7
  37. package/bin/lib/utils/paths.js +34 -34
  38. package/bin/lib/utils/prompts.js +194 -169
  39. package/bin/lib/utils/ssl.js +79 -81
  40. package/browser-extensions/README.md +0 -1
  41. package/browser-extensions/chrome/background.js +244 -237
  42. package/browser-extensions/chrome/content.js +32 -29
  43. package/browser-extensions/chrome/devtools.html +7 -7
  44. package/browser-extensions/chrome/devtools.js +19 -19
  45. package/browser-extensions/chrome/inspector.js +802 -767
  46. package/browser-extensions/chrome/manifest.json +71 -63
  47. package/browser-extensions/chrome/panel.html +674 -636
  48. package/browser-extensions/chrome/panel.js +722 -712
  49. package/browser-extensions/chrome/popup.html +586 -543
  50. package/browser-extensions/chrome/popup.js +282 -244
  51. package/browser-extensions/chrome/rules.json +1 -1
  52. package/browser-extensions/chrome/test-chrome.html +216 -136
  53. package/browser-extensions/chrome/test-mixed-content.html +284 -189
  54. package/browser-extensions/chrome/test-uri-pattern.html +221 -198
  55. package/browser-extensions/firefox/README.md +9 -6
  56. package/browser-extensions/firefox/background.js +221 -218
  57. package/browser-extensions/firefox/content.js +55 -52
  58. package/browser-extensions/firefox/debug-errors.html +386 -228
  59. package/browser-extensions/firefox/debug-https.html +153 -105
  60. package/browser-extensions/firefox/devtools.html +7 -7
  61. package/browser-extensions/firefox/devtools.js +23 -20
  62. package/browser-extensions/firefox/inspector.js +802 -767
  63. package/browser-extensions/firefox/manifest.json +68 -68
  64. package/browser-extensions/firefox/panel.html +674 -636
  65. package/browser-extensions/firefox/panel.js +722 -712
  66. package/browser-extensions/firefox/popup.html +572 -535
  67. package/browser-extensions/firefox/popup.js +281 -236
  68. package/browser-extensions/firefox/test-gramercy.html +170 -125
  69. package/browser-extensions/firefox/test-imports.html +59 -55
  70. package/browser-extensions/firefox/test-masking.html +231 -140
  71. package/browser-extensions/firefox/test-uri-pattern.html +221 -198
  72. package/dist/tui/App.d.ts +1 -1
  73. package/dist/tui/App.d.ts.map +1 -1
  74. package/dist/tui/App.js +154 -150
  75. package/dist/tui/App.js.map +1 -1
  76. package/dist/tui/components/AIPanel.d.ts.map +1 -1
  77. package/dist/tui/components/AIPanel.js +42 -35
  78. package/dist/tui/components/AIPanel.js.map +1 -1
  79. package/dist/tui/components/CommandInput.d.ts +1 -1
  80. package/dist/tui/components/CommandInput.d.ts.map +1 -1
  81. package/dist/tui/components/CommandInput.js +92 -62
  82. package/dist/tui/components/CommandInput.js.map +1 -1
  83. package/dist/tui/components/GeminiPanel.d.ts.map +1 -1
  84. package/dist/tui/components/GeminiPanel.js +37 -30
  85. package/dist/tui/components/GeminiPanel.js.map +1 -1
  86. package/dist/tui/components/Header.d.ts.map +1 -1
  87. package/dist/tui/components/Header.js +1 -1
  88. package/dist/tui/components/Header.js.map +1 -1
  89. package/dist/tui/components/LogPanel.d.ts +1 -1
  90. package/dist/tui/components/LogPanel.d.ts.map +1 -1
  91. package/dist/tui/components/LogPanel.js +26 -24
  92. package/dist/tui/components/LogPanel.js.map +1 -1
  93. package/dist/tui/components/TabBar.d.ts +2 -2
  94. package/dist/tui/components/TabBar.d.ts.map +1 -1
  95. package/dist/tui/components/TabBar.js +11 -11
  96. package/dist/tui/components/TabBar.js.map +1 -1
  97. package/dist/tui/components/WelcomeScreen.d.ts.map +1 -1
  98. package/dist/tui/components/WelcomeScreen.js +6 -6
  99. package/dist/tui/components/WelcomeScreen.js.map +1 -1
  100. package/dist/tui/index.d.ts.map +1 -1
  101. package/dist/tui/index.js +8 -8
  102. package/dist/tui/index.js.map +1 -1
  103. package/dist/tui/services/AIService.d.ts +2 -2
  104. package/dist/tui/services/AIService.d.ts.map +1 -1
  105. package/dist/tui/services/AIService.js +165 -125
  106. package/dist/tui/services/AIService.js.map +1 -1
  107. package/dist/tui/services/ExtensionService.d.ts +1 -1
  108. package/dist/tui/services/ExtensionService.d.ts.map +1 -1
  109. package/dist/tui/services/ExtensionService.js +33 -26
  110. package/dist/tui/services/ExtensionService.js.map +1 -1
  111. package/dist/tui/services/GeminiService.d.ts +1 -1
  112. package/dist/tui/services/GeminiService.d.ts.map +1 -1
  113. package/dist/tui/services/GeminiService.js +87 -76
  114. package/dist/tui/services/GeminiService.js.map +1 -1
  115. package/dist/tui/services/ServiceManager.d.ts +3 -3
  116. package/dist/tui/services/ServiceManager.d.ts.map +1 -1
  117. package/dist/tui/services/ServiceManager.js +72 -58
  118. package/dist/tui/services/ServiceManager.js.map +1 -1
  119. package/dist/tui/services/SocketService.d.ts.map +1 -1
  120. package/dist/tui/services/SocketService.js +32 -32
  121. package/dist/tui/services/SocketService.js.map +1 -1
  122. package/dist/tui/services/ViteService.d.ts.map +1 -1
  123. package/dist/tui/services/ViteService.js +26 -28
  124. package/dist/tui/services/ViteService.js.map +1 -1
  125. package/dist/tui/services/index.d.ts +6 -6
  126. package/dist/tui/services/index.d.ts.map +1 -1
  127. package/dist/tui/services/index.js +6 -6
  128. package/dist/tui/services/index.js.map +1 -1
  129. package/mcp/gxp-api-server.js +83 -81
  130. package/package.json +109 -93
  131. package/runtime/PortalContainer.vue +258 -234
  132. package/runtime/dev-tools/DevToolsModal.vue +153 -155
  133. package/runtime/dev-tools/LayoutSwitcher.vue +144 -140
  134. package/runtime/dev-tools/MockDataEditor.vue +456 -433
  135. package/runtime/dev-tools/SocketSimulator.vue +379 -371
  136. package/runtime/dev-tools/StoreInspector.vue +517 -455
  137. package/runtime/dev-tools/index.js +5 -5
  138. package/runtime/fallback-layouts/PrivateLayout.vue +2 -2
  139. package/runtime/fallback-layouts/PublicLayout.vue +2 -2
  140. package/runtime/fallback-layouts/SystemLayout.vue +2 -2
  141. package/runtime/gxpStringsPlugin.js +159 -134
  142. package/runtime/index.html +17 -19
  143. package/runtime/main.js +24 -22
  144. package/runtime/mock-api/auth-middleware.js +15 -15
  145. package/runtime/mock-api/image-generator.js +46 -46
  146. package/runtime/mock-api/index.js +55 -55
  147. package/runtime/mock-api/response-generator.js +116 -105
  148. package/runtime/mock-api/route-generator.js +107 -84
  149. package/runtime/mock-api/socket-triggers.js +94 -93
  150. package/runtime/mock-api/spec-loader.js +79 -80
  151. package/runtime/package.json +3 -0
  152. package/runtime/server.js +68 -68
  153. package/runtime/stores/gxpPortalConfigStore.js +204 -186
  154. package/runtime/stores/index.js +2 -2
  155. package/runtime/vite-inspector-plugin.js +858 -707
  156. package/runtime/vite-source-tracker-plugin.js +132 -113
  157. package/runtime/vite.config.js +191 -139
  158. package/scripts/launch-chrome.js +41 -41
  159. package/scripts/pack-chrome.js +38 -39
  160. package/socket-events/AiSessionMessageCreated.json +17 -17
  161. package/socket-events/SocialStreamPostCreated.json +23 -23
  162. package/socket-events/SocialStreamPostVariantCompleted.json +22 -22
  163. package/template/.claude/agents/gxp-developer.md +100 -99
  164. package/template/.claude/settings.json +7 -7
  165. package/template/AGENTS.md +30 -23
  166. package/template/GEMINI.md +20 -20
  167. package/template/README.md +70 -53
  168. package/template/app-manifest.json +2 -4
  169. package/template/configuration.json +10 -10
  170. package/template/default-styling.css +1 -1
  171. package/template/index.html +18 -20
  172. package/template/main.js +24 -22
  173. package/template/src/DemoPage.vue +415 -362
  174. package/template/src/Plugin.vue +76 -85
  175. package/template/src/stores/index.js +3 -3
  176. package/template/src/stores/test-data.json +164 -172
  177. package/template/theme-layouts/AdditionalStyling.css +50 -50
  178. package/template/theme-layouts/PrivateLayout.vue +8 -12
  179. package/template/theme-layouts/PublicLayout.vue +8 -12
  180. package/template/theme-layouts/SystemLayout.vue +8 -12
  181. package/template/vite.extend.js +45 -0
  182. 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 | 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 |
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('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');
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('/api/v1/attendees', { event_id: 123 });
95
+ const data = await store.apiGet("/api/v1/attendees", { event_id: 123 })
95
96
 
96
97
  // POST request
97
- const result = await store.apiPost('/api/v1/check-ins', {
98
- attendee_id: 456,
99
- station_id: 'kiosk-1'
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('/api/v1/attendees/456', { status: 'checked_in' });
104
+ await store.apiPut("/api/v1/attendees/456", { status: "checked_in" })
104
105
 
105
106
  // PATCH request
106
- await store.apiPatch('/api/v1/attendees/456', { badge_printed: true });
107
+ await store.apiPatch("/api/v1/attendees/456", { badge_printed: true })
107
108
 
108
109
  // DELETE request
109
- await store.apiDelete('/api/v1/check-ins/789');
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 | API Base URL |
117
- |-------------|--------------|
118
- | `mock` | Local mock server (default) |
119
- | `local` | https://dashboard.eventfinity.test |
120
- | `develop` | https://api.zenith-develop.env.eventfinity.app |
121
- | `staging` | https://api.efz-staging.env.eventfinity.app |
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('primary', 'EventName', (data) => {
133
- console.log('Event received:', data);
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('primary', 'client-event', { message: 'Hello' });
138
+ store.emitSocket("primary", "client-event", { message: "Hello" })
138
139
 
139
140
  // For dependency-based sockets (configured in app-manifest.json)
140
- store.useSocketListener('dependency_identifier', 'updated', (data) => {
141
- console.log('Dependency updated:', data);
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
- "dependencies": [
152
- {
153
- "identifier": "ai_session",
154
- "model": "AiInterface",
155
- "events": {
156
- "created": "AiSessionMessageCreated",
157
- "updated": "AiSessionMessageUpdated"
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
- console.log('AI message created:', data);
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
- <div class="my-component">
207
- <h1 gxp-string="component_title">Default Title</h1>
208
- <img gxp-src="component_image" src="/placeholder.jpg" alt="">
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
- <button @click="handleAction" variant="primary">
211
- <span gxp-string="action_button">Click Me</span>
212
- </button>
211
+ <button @click="handleAction" variant="primary">
212
+ <span gxp-string="action_button">Click Me</span>
213
+ </button>
213
214
 
214
- <div v-if="loading" class="spinner"></div>
215
- </div>
215
+ <div v-if="loading" class="spinner"></div>
216
+ </div>
216
217
  </template>
217
218
 
218
219
  <script setup>
219
- import { ref, onMounted } from 'vue';
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
- loading.value = true;
228
- try {
229
- data.value = await store.apiGet('/api/v1/endpoint');
230
- } catch (error) {
231
- console.error('API Error:', error);
232
- } finally {
233
- loading.value = false;
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
- // Listen for real-time updates
239
- store.listenSocket('primary', 'DataUpdated', (eventData) => {
240
- data.value = eventData;
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
- padding: 20px;
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
- "name": "my-plugin",
259
- "description": "My GxP Plugin",
260
- "settings": {
261
- "primary_color": "#FFD600",
262
- "idle_timeout": 30
263
- },
264
- "strings": {
265
- "default": {
266
- "welcome_title": "Welcome",
267
- "action_button": "Get Started"
268
- }
269
- },
270
- "assets": {
271
- "hero_image": "/dev-assets/images/hero.jpg",
272
- "logo": "/dev-assets/images/logo.png"
273
- },
274
- "dependencies": [],
275
- "permissions": []
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
 
@@ -1,9 +1,9 @@
1
1
  {
2
- "mcpServers": {
3
- "gxp-api": {
4
- "command": "gxp-api-server",
5
- "args": [],
6
- "env": {}
7
- }
8
- }
2
+ "mcpServers": {
3
+ "gxp-api": {
4
+ "command": "gxp-api-server",
5
+ "args": [],
6
+ "env": {}
7
+ }
8
+ }
9
9
  }
@@ -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 '@gx-runtime/stores/gxpPortalConfigStore';
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('/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');
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('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
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('key', 'value');
56
- store.updateSetting('key', 'value');
57
- store.updateAsset('key', 'url');
58
- store.updateState('key', 'value');
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('primary', 'EventName', (data) => {
68
- console.log('Received:', data);
69
- });
67
+ store.listenSocket("primary", "EventName", (data) => {
68
+ console.log("Received:", data)
69
+ })
70
70
 
71
71
  // Emit events
72
- store.emitSocket('primary', 'client-event', { data: 'value' });
72
+ store.emitSocket("primary", "client-event", { data: "value" })
73
73
 
74
74
  // For dependency-based sockets
75
- store.useSocketListener('dependency_id', 'updated', callback);
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 { GxButton, GxCard, GxInput, GxModal, GxSpinner } from '@gramercytech/gx-componentkit';
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
@@ -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 '@gx-runtime/stores/gxpPortalConfigStore';
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('/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');
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('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
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('key', 'value');
41
- store.updateSetting('key', 'value');
42
- store.updateAsset('key', 'url');
43
- store.updateState('key', 'value');
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('primary', 'EventName', (data) => {
51
- console.log('Event received:', data);
52
- });
50
+ store.listenSocket("primary", "EventName", (data) => {
51
+ console.log("Event received:", data)
52
+ })
53
53
 
54
54
  // Emit events
55
- store.emitSocket('primary', 'event-name', data);
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