@gxp-dev/tools 2.0.62 → 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 +207 -132
- 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
package/template/README.md
CHANGED
|
@@ -49,23 +49,23 @@ your-project/
|
|
|
49
49
|
|
|
50
50
|
```vue
|
|
51
51
|
<template>
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
<div class="my-plugin">
|
|
53
|
+
<h1>{{ stringsList?.welcome_text || "Welcome!" }}</h1>
|
|
54
|
+
<!-- Your custom content here -->
|
|
55
|
+
</div>
|
|
56
56
|
</template>
|
|
57
57
|
|
|
58
58
|
<script setup>
|
|
59
59
|
// Props injected by the platform
|
|
60
60
|
const props = defineProps({
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
})
|
|
61
|
+
pluginVars: Object, // Custom variables from admin panel
|
|
62
|
+
dependencyList: Object, // Selected dependencies
|
|
63
|
+
assetUrls: Object, // Asset URLs (signed URLs for images, etc.)
|
|
64
|
+
stringsList: Object, // Localized strings
|
|
65
|
+
permissionFlags: Array, // Permission flags
|
|
66
|
+
theme: Object, // Theme configuration
|
|
67
|
+
router: Object, // Platform router for navigation
|
|
68
|
+
})
|
|
69
69
|
</script>
|
|
70
70
|
```
|
|
71
71
|
|
|
@@ -83,18 +83,18 @@ You can customize these layouts to match your kiosk's design.
|
|
|
83
83
|
|
|
84
84
|
### Available Scripts
|
|
85
85
|
|
|
86
|
-
| Script
|
|
87
|
-
|
|
88
|
-
| `npm run dev`
|
|
89
|
-
| `npm run dev-app`
|
|
90
|
-
| `npm run dev-http`
|
|
91
|
-
| `npm run build`
|
|
92
|
-
| `npm run setup-ssl`
|
|
93
|
-
| `npm run socket:list`
|
|
94
|
-
| `npm run socket:send`
|
|
95
|
-
| `npm run assets:list`
|
|
96
|
-
| `npm run assets:init`
|
|
97
|
-
| `npm run assets:generate` | Generate placeholder images
|
|
86
|
+
| Script | Description |
|
|
87
|
+
| ------------------------- | ------------------------------------- |
|
|
88
|
+
| `npm run dev` | Start HTTPS dev server with Socket.IO |
|
|
89
|
+
| `npm run dev-app` | Start HTTPS dev server only |
|
|
90
|
+
| `npm run dev-http` | Start HTTP dev server (no SSL) |
|
|
91
|
+
| `npm run build` | Build for production |
|
|
92
|
+
| `npm run setup-ssl` | Generate SSL certificates |
|
|
93
|
+
| `npm run socket:list` | List available socket events |
|
|
94
|
+
| `npm run socket:send` | Send test socket events |
|
|
95
|
+
| `npm run assets:list` | List development assets |
|
|
96
|
+
| `npm run assets:init` | Initialize asset directories |
|
|
97
|
+
| `npm run assets:generate` | Generate placeholder images |
|
|
98
98
|
|
|
99
99
|
### Dev Tools Modal
|
|
100
100
|
|
|
@@ -116,9 +116,10 @@ The Dev Tools Modal provides:
|
|
|
116
116
|
4. **Mock Data Editor** - Edit theme colors, navigation items, user session, and permissions
|
|
117
117
|
|
|
118
118
|
You can also control dev tools from the browser console:
|
|
119
|
+
|
|
119
120
|
```javascript
|
|
120
|
-
window.gxDevTools.open()
|
|
121
|
-
window.gxDevTools.close()
|
|
121
|
+
window.gxDevTools.open() // Open modal
|
|
122
|
+
window.gxDevTools.close() // Close modal
|
|
122
123
|
window.gxDevTools.toggle() // Toggle modal
|
|
123
124
|
```
|
|
124
125
|
|
|
@@ -143,29 +144,37 @@ VITE_SSL_KEY=.certs/localhost-key.pem
|
|
|
143
144
|
Your Plugin.vue component receives these props from the platform:
|
|
144
145
|
|
|
145
146
|
### pluginVars
|
|
147
|
+
|
|
146
148
|
Custom variables configured in the admin panel:
|
|
149
|
+
|
|
147
150
|
```javascript
|
|
148
|
-
const { pluginVars } = props
|
|
149
|
-
console.log(pluginVars.primary_color)
|
|
150
|
-
console.log(pluginVars.projectId)
|
|
151
|
+
const { pluginVars } = props
|
|
152
|
+
console.log(pluginVars.primary_color) // "#FFD600"
|
|
153
|
+
console.log(pluginVars.projectId) // 39
|
|
151
154
|
```
|
|
152
155
|
|
|
153
156
|
### assetUrls
|
|
157
|
+
|
|
154
158
|
URLs for configured assets:
|
|
159
|
+
|
|
155
160
|
```vue
|
|
156
161
|
<img :src="assetUrls.main_logo" alt="Logo" />
|
|
157
162
|
<img :src="assetUrls.background_image" alt="Background" />
|
|
158
163
|
```
|
|
159
164
|
|
|
160
165
|
### stringsList
|
|
166
|
+
|
|
161
167
|
Localized strings:
|
|
168
|
+
|
|
162
169
|
```vue
|
|
163
170
|
<h1>{{ stringsList.welcome_text }}</h1>
|
|
164
171
|
<p>{{ stringsList.instruction_text }}</p>
|
|
165
172
|
```
|
|
166
173
|
|
|
167
174
|
### theme
|
|
175
|
+
|
|
168
176
|
Theme configuration (colors, fonts, etc.):
|
|
177
|
+
|
|
169
178
|
```vue
|
|
170
179
|
<GxThemeWrapper :theme="theme">
|
|
171
180
|
<!-- Your content inherits theme variables -->
|
|
@@ -173,26 +182,28 @@ Theme configuration (colors, fonts, etc.):
|
|
|
173
182
|
```
|
|
174
183
|
|
|
175
184
|
### router
|
|
185
|
+
|
|
176
186
|
Platform router for navigation (Inertia.js-style):
|
|
187
|
+
|
|
177
188
|
```javascript
|
|
178
189
|
// Basic navigation
|
|
179
|
-
router.visit(
|
|
190
|
+
router.visit("/camera")
|
|
180
191
|
|
|
181
192
|
// POST data to a route
|
|
182
|
-
router.visit(
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
})
|
|
193
|
+
router.visit("/share", {
|
|
194
|
+
method: "post",
|
|
195
|
+
data: { image: photoUrl, caption: "My photo!" },
|
|
196
|
+
})
|
|
186
197
|
|
|
187
198
|
// Navigation with options
|
|
188
|
-
router.visit(
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
})
|
|
199
|
+
router.visit("/results", {
|
|
200
|
+
preserveScroll: true,
|
|
201
|
+
preserveState: true,
|
|
202
|
+
replace: true,
|
|
203
|
+
onStart: () => {},
|
|
204
|
+
onFinish: () => {},
|
|
205
|
+
onError: (errors) => {},
|
|
206
|
+
})
|
|
196
207
|
```
|
|
197
208
|
|
|
198
209
|
## GX ComponentKit
|
|
@@ -200,6 +211,7 @@ router.visit('/results', {
|
|
|
200
211
|
This project includes `@gramercytech/gx-componentkit` with pre-built components:
|
|
201
212
|
|
|
202
213
|
### Page Components
|
|
214
|
+
|
|
203
215
|
- `GxPageStart` - Welcome/start screen with idle timeout
|
|
204
216
|
- `GxPageInstructions` - Instruction display page
|
|
205
217
|
- `GxPageCamera` - Camera capture interface
|
|
@@ -209,33 +221,36 @@ This project includes `@gramercytech/gx-componentkit` with pre-built components:
|
|
|
209
221
|
- `GxPageLoading` - Loading overlay
|
|
210
222
|
|
|
211
223
|
### UI Components
|
|
224
|
+
|
|
212
225
|
- `GxModal` - Customizable modal dialogs
|
|
213
226
|
- `GxCountdown` - Timer/countdown component
|
|
214
227
|
- `GxVideoPlayer` - Video player with custom controls
|
|
215
228
|
- `GxThemeWrapper` - Theme provider component
|
|
216
229
|
|
|
217
230
|
### Composables
|
|
231
|
+
|
|
218
232
|
- `useMedia()` - Camera, video, and audio utilities
|
|
219
233
|
- `useAnimations()` - Animation helpers
|
|
220
234
|
- `useScanning()` - Barcode/QR scanning
|
|
221
235
|
- `useErrors()` - Error state management
|
|
222
236
|
|
|
223
237
|
### Usage Example
|
|
238
|
+
|
|
224
239
|
```vue
|
|
225
240
|
<script setup>
|
|
226
241
|
import {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
} from
|
|
242
|
+
GxModal,
|
|
243
|
+
GxCountdown,
|
|
244
|
+
GxVideoPlayer,
|
|
245
|
+
useMedia,
|
|
246
|
+
} from "@gramercytech/gx-componentkit"
|
|
232
247
|
|
|
233
|
-
const { startCamera, takePhoto } = useMedia()
|
|
248
|
+
const { startCamera, takePhoto } = useMedia()
|
|
234
249
|
</script>
|
|
235
250
|
|
|
236
251
|
<template>
|
|
237
|
-
|
|
238
|
-
|
|
252
|
+
<GxCountdown :duration="30" @finished="handleFinished" />
|
|
253
|
+
<GxVideoPlayer :src="videoUrl" @play="handlePlay" />
|
|
239
254
|
</template>
|
|
240
255
|
```
|
|
241
256
|
|
|
@@ -245,9 +260,9 @@ Theme CSS variables are automatically available:
|
|
|
245
260
|
|
|
246
261
|
```css
|
|
247
262
|
.my-component {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
263
|
+
background: var(--gx-primary-color);
|
|
264
|
+
color: var(--gx-text-color);
|
|
265
|
+
border: 2px solid var(--gx-primary-color);
|
|
251
266
|
}
|
|
252
267
|
```
|
|
253
268
|
|
|
@@ -284,6 +299,7 @@ gxdev assets generate --name logo --size 200x200 --color "#FF5722" --text "My Lo
|
|
|
284
299
|
```
|
|
285
300
|
|
|
286
301
|
### ImageMagick Installation
|
|
302
|
+
|
|
287
303
|
```bash
|
|
288
304
|
# macOS
|
|
289
305
|
brew install imagemagick
|
|
@@ -301,6 +317,7 @@ npm run build
|
|
|
301
317
|
```
|
|
302
318
|
|
|
303
319
|
This creates a `dist/` folder with:
|
|
320
|
+
|
|
304
321
|
- `plugin.es.js` - Your compiled plugin (ES module)
|
|
305
322
|
- `style.css` - Compiled styles
|
|
306
323
|
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
"additionalTabs": [
|
|
3
|
+
{
|
|
4
|
+
"type": "card_list",
|
|
5
|
+
"cards": [
|
|
6
|
+
{
|
|
7
|
+
"cols": 12,
|
|
8
|
+
"type": "fields_list",
|
|
9
|
+
"title": "Configuration",
|
|
10
|
+
"fieldsList": []
|
|
11
11
|
}
|
|
12
12
|
]
|
|
13
13
|
}
|
|
14
14
|
]
|
|
15
|
-
}
|
|
15
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/* This file used to pre-populate the the additional styling editor in the GxP app */
|
|
1
|
+
/* This file used to pre-populate the the additional styling editor in the GxP app */
|
package/template/index.html
CHANGED
|
@@ -1,22 +1,20 @@
|
|
|
1
|
-
<!
|
|
1
|
+
<!doctype html>
|
|
2
2
|
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>GxP Plugin Builder</title>
|
|
8
|
+
<script type="module">
|
|
9
|
+
import * as Vue from "/node_modules/vue/dist/vue.esm-bundler.js"
|
|
10
|
+
window.Vue = Vue
|
|
11
|
+
import * as Pinia from "/node_modules/pinia/dist/pinia.esm-browser.js"
|
|
12
|
+
window.Pinia = Pinia
|
|
13
|
+
</script>
|
|
14
|
+
</head>
|
|
3
15
|
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
<script type="module">
|
|
10
|
-
import * as Vue from '/node_modules/vue/dist/vue.esm-bundler.js';
|
|
11
|
-
window.Vue = Vue;
|
|
12
|
-
import * as Pinia from '/node_modules/pinia/dist/pinia.esm-browser.js';
|
|
13
|
-
window.Pinia = Pinia;
|
|
14
|
-
</script>
|
|
15
|
-
</head>
|
|
16
|
-
|
|
17
|
-
<body>
|
|
18
|
-
<div id="app"></div>
|
|
19
|
-
<script type="module" src="/main.js"></script>
|
|
20
|
-
</body>
|
|
21
|
-
|
|
22
|
-
</html>
|
|
16
|
+
<body>
|
|
17
|
+
<div id="app"></div>
|
|
18
|
+
<script type="module" src="/main.js"></script>
|
|
19
|
+
</body>
|
|
20
|
+
</html>
|
package/template/main.js
CHANGED
|
@@ -1,40 +1,42 @@
|
|
|
1
|
-
import { createApp } from "vue"
|
|
2
|
-
import * as Vue from "vue"
|
|
3
|
-
import * as Pinia from "pinia"
|
|
4
|
-
import { createPinia, setActivePinia } from "pinia"
|
|
1
|
+
import { createApp } from "vue"
|
|
2
|
+
import * as Vue from "vue"
|
|
3
|
+
import * as Pinia from "pinia"
|
|
4
|
+
import { createPinia, setActivePinia } from "pinia"
|
|
5
5
|
|
|
6
6
|
// Create and configure Pinia before any store imports
|
|
7
|
-
const pinia = createPinia()
|
|
8
|
-
setActivePinia(pinia)
|
|
7
|
+
const pinia = createPinia()
|
|
8
|
+
setActivePinia(pinia)
|
|
9
9
|
|
|
10
10
|
// Expose Vue and Pinia to window for dynamically loaded plugins
|
|
11
|
-
window.Vue = Vue
|
|
12
|
-
window.Pinia = Pinia
|
|
13
|
-
window.pinia = pinia
|
|
11
|
+
window.Vue = Vue
|
|
12
|
+
window.Pinia = Pinia
|
|
13
|
+
window.pinia = pinia
|
|
14
14
|
|
|
15
15
|
// Dynamic imports ensure pinia is set up before stores load
|
|
16
16
|
async function init() {
|
|
17
|
-
const { default: App } = await import("@gx-runtime/PortalContainer.vue")
|
|
18
|
-
const { useGxpStore } = await import("@/stores/index.js")
|
|
19
|
-
const { createGxpStringsPlugin } =
|
|
17
|
+
const { default: App } = await import("@gx-runtime/PortalContainer.vue")
|
|
18
|
+
const { useGxpStore } = await import("@/stores/index.js")
|
|
19
|
+
const { createGxpStringsPlugin } =
|
|
20
|
+
await import("@gx-runtime/gxpStringsPlugin.js")
|
|
20
21
|
|
|
21
|
-
window.useGxpStore = useGxpStore
|
|
22
|
+
window.useGxpStore = useGxpStore
|
|
22
23
|
|
|
23
|
-
const app = createApp(App)
|
|
24
|
-
app.use(pinia)
|
|
24
|
+
const app = createApp(App)
|
|
25
|
+
app.use(pinia)
|
|
25
26
|
|
|
26
|
-
const gxpStore = useGxpStore()
|
|
27
|
+
const gxpStore = useGxpStore()
|
|
27
28
|
|
|
28
29
|
// Build the dev server base URL so gxp-src default paths resolve to the
|
|
29
30
|
// local dev server instead of the current domain (important when the app
|
|
30
31
|
// is injected into the cloud platform via browser extension).
|
|
31
|
-
const devProtocol =
|
|
32
|
-
|
|
33
|
-
const
|
|
32
|
+
const devProtocol =
|
|
33
|
+
import.meta.env.VITE_USE_HTTPS !== "false" ? "https" : "http"
|
|
34
|
+
const devPort = import.meta.env.VITE_NODE_PORT || "3060"
|
|
35
|
+
const devServerBaseUrl = `${devProtocol}://localhost:${devPort}`
|
|
34
36
|
|
|
35
|
-
app.use(createGxpStringsPlugin(gxpStore, { devServerBaseUrl }))
|
|
37
|
+
app.use(createGxpStringsPlugin(gxpStore, { devServerBaseUrl }))
|
|
36
38
|
|
|
37
|
-
app.mount("#app")
|
|
39
|
+
app.mount("#app")
|
|
38
40
|
}
|
|
39
41
|
|
|
40
|
-
init()
|
|
42
|
+
init()
|