@gxp-dev/tools 2.0.5 → 2.0.7
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/dist/tui/App.d.ts +13 -0
- package/dist/tui/App.d.ts.map +1 -0
- package/dist/tui/App.js +480 -0
- package/dist/tui/App.js.map +1 -0
- package/dist/tui/components/CommandInput.d.ts +13 -0
- package/dist/tui/components/CommandInput.d.ts.map +1 -0
- package/dist/tui/components/CommandInput.js +180 -0
- package/dist/tui/components/CommandInput.js.map +1 -0
- package/dist/tui/components/GeminiPanel.d.ts +7 -0
- package/dist/tui/components/GeminiPanel.d.ts.map +1 -0
- package/dist/tui/components/GeminiPanel.js +99 -0
- package/dist/tui/components/GeminiPanel.js.map +1 -0
- package/dist/tui/components/Header.d.ts +6 -0
- package/dist/tui/components/Header.d.ts.map +1 -0
- package/dist/tui/components/Header.js +6 -0
- package/dist/tui/components/Header.js.map +1 -0
- package/dist/tui/components/LogPanel.d.ts +8 -0
- package/dist/tui/components/LogPanel.d.ts.map +1 -0
- package/dist/tui/components/LogPanel.js +89 -0
- package/dist/tui/components/LogPanel.js.map +1 -0
- package/dist/tui/components/TabBar.d.ts +9 -0
- package/dist/tui/components/TabBar.d.ts.map +1 -0
- package/dist/tui/components/TabBar.js +23 -0
- package/dist/tui/components/TabBar.js.map +1 -0
- package/dist/tui/components/WelcomeScreen.d.ts +2 -0
- package/dist/tui/components/WelcomeScreen.d.ts.map +1 -0
- package/dist/tui/components/WelcomeScreen.js +14 -0
- package/dist/tui/components/WelcomeScreen.js.map +1 -0
- package/dist/tui/index.d.ts +8 -0
- package/dist/tui/index.d.ts.map +1 -0
- package/dist/tui/index.js +47 -0
- package/dist/tui/index.js.map +1 -0
- package/dist/tui/package.json +1 -0
- package/dist/tui/services/ExtensionService.d.ts +11 -0
- package/dist/tui/services/ExtensionService.d.ts.map +1 -0
- package/dist/tui/services/ExtensionService.js +101 -0
- package/dist/tui/services/ExtensionService.js.map +1 -0
- package/dist/tui/services/GeminiService.d.ts +40 -0
- package/dist/tui/services/GeminiService.d.ts.map +1 -0
- package/dist/tui/services/GeminiService.js +327 -0
- package/dist/tui/services/GeminiService.js.map +1 -0
- package/dist/tui/services/ServiceManager.d.ts +40 -0
- package/dist/tui/services/ServiceManager.d.ts.map +1 -0
- package/dist/tui/services/ServiceManager.js +283 -0
- package/dist/tui/services/ServiceManager.js.map +1 -0
- package/dist/tui/services/SocketService.d.ts +19 -0
- package/dist/tui/services/SocketService.d.ts.map +1 -0
- package/dist/tui/services/SocketService.js +163 -0
- package/dist/tui/services/SocketService.js.map +1 -0
- package/dist/tui/services/ViteService.d.ts +8 -0
- package/dist/tui/services/ViteService.d.ts.map +1 -0
- package/dist/tui/services/ViteService.js +89 -0
- package/dist/tui/services/ViteService.js.map +1 -0
- package/dist/tui/services/index.d.ts +6 -0
- package/dist/tui/services/index.d.ts.map +1 -0
- package/dist/tui/services/index.js +6 -0
- package/dist/tui/services/index.js.map +1 -0
- package/package.json +11 -1
- package/.github/workflows/npm-publish.yml +0 -48
- package/CLAUDE.md +0 -400
- package/REFACTOR_PLAN.md +0 -194
- package/docs/DOCUSAURUS_IMPORT.md +0 -378
- package/docs/_category_.json +0 -8
- package/docs/app-manifest.md +0 -272
- package/docs/building-for-platform.md +0 -315
- package/docs/dev-tools.md +0 -291
- package/docs/getting-started.md +0 -180
- package/docs/gxp-store.md +0 -305
- package/docs/index.md +0 -44
- package/tsconfig.tui.json +0 -21
- package/vite.config.js +0 -164
|
@@ -1,378 +0,0 @@
|
|
|
1
|
-
# Importing GxP Toolkit Docs into Docusaurus
|
|
2
|
-
|
|
3
|
-
This guide shows how to configure your platform's Docusaurus site to automatically import documentation from this repository.
|
|
4
|
-
|
|
5
|
-
## Option 1: Remote Content Plugin (Recommended)
|
|
6
|
-
|
|
7
|
-
Use `docusaurus-plugin-remote-content` to fetch docs at build time.
|
|
8
|
-
|
|
9
|
-
### Installation
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
npm install docusaurus-plugin-remote-content
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
### Configuration
|
|
16
|
-
|
|
17
|
-
Add to your `docusaurus.config.js`:
|
|
18
|
-
|
|
19
|
-
```javascript
|
|
20
|
-
module.exports = {
|
|
21
|
-
// ... other config
|
|
22
|
-
|
|
23
|
-
plugins: [
|
|
24
|
-
[
|
|
25
|
-
'docusaurus-plugin-remote-content',
|
|
26
|
-
{
|
|
27
|
-
// Unique name for this remote source
|
|
28
|
-
name: 'gx-devtools-docs',
|
|
29
|
-
|
|
30
|
-
// GitHub raw content URL for the docs folder
|
|
31
|
-
sourceBaseUrl:
|
|
32
|
-
'https://raw.githubusercontent.com/gramercytech/gx-devtools/develop/docs/',
|
|
33
|
-
|
|
34
|
-
// Where to output the fetched docs
|
|
35
|
-
outDir: 'docs/gx-devtools',
|
|
36
|
-
|
|
37
|
-
// List of documents to fetch
|
|
38
|
-
documents: [
|
|
39
|
-
'index.md',
|
|
40
|
-
'getting-started.md',
|
|
41
|
-
'app-manifest.md',
|
|
42
|
-
'gxp-store.md',
|
|
43
|
-
'dev-tools.md',
|
|
44
|
-
'building-for-platform.md',
|
|
45
|
-
],
|
|
46
|
-
|
|
47
|
-
// Fetch category config too
|
|
48
|
-
// Note: _category_.json needs special handling (see below)
|
|
49
|
-
},
|
|
50
|
-
],
|
|
51
|
-
],
|
|
52
|
-
};
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
### Fetching _category_.json
|
|
56
|
-
|
|
57
|
-
The category file needs to be fetched separately since it's not markdown:
|
|
58
|
-
|
|
59
|
-
```javascript
|
|
60
|
-
module.exports = {
|
|
61
|
-
plugins: [
|
|
62
|
-
// Markdown docs
|
|
63
|
-
[
|
|
64
|
-
'docusaurus-plugin-remote-content',
|
|
65
|
-
{
|
|
66
|
-
name: 'gx-devtools-docs',
|
|
67
|
-
sourceBaseUrl:
|
|
68
|
-
'https://raw.githubusercontent.com/gramercytech/gx-devtools/main/docs/',
|
|
69
|
-
outDir: 'docs/gx-devtools',
|
|
70
|
-
documents: [
|
|
71
|
-
'index.md',
|
|
72
|
-
'getting-started.md',
|
|
73
|
-
'app-manifest.md',
|
|
74
|
-
'gxp-store.md',
|
|
75
|
-
'dev-tools.md',
|
|
76
|
-
'building-for-platform.md',
|
|
77
|
-
],
|
|
78
|
-
// Ensure content is returned as string (plugin expects {content: string} object)
|
|
79
|
-
modifyContent: (filename, content) => {
|
|
80
|
-
return {
|
|
81
|
-
content: typeof content === "string" ? content : String(content),
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
],
|
|
86
|
-
// Category config (JSON)
|
|
87
|
-
[
|
|
88
|
-
'docusaurus-plugin-remote-content',
|
|
89
|
-
{
|
|
90
|
-
name: 'gx-devtools-category',
|
|
91
|
-
sourceBaseUrl:
|
|
92
|
-
'https://raw.githubusercontent.com/gramercytech/gx-devtools/main/docs/',
|
|
93
|
-
outDir: 'docs/gx-devtools',
|
|
94
|
-
documents: ['_category_.json'],
|
|
95
|
-
// JSON files need to be stringified before writing (plugin expects {content: string} object)
|
|
96
|
-
modifyContent: (filename, content) => {
|
|
97
|
-
return {
|
|
98
|
-
content:
|
|
99
|
-
typeof content === "string"
|
|
100
|
-
? content
|
|
101
|
-
: JSON.stringify(content, null, 2),
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
],
|
|
106
|
-
],
|
|
107
|
-
};
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
### Dynamic Document List (Advanced)
|
|
111
|
-
|
|
112
|
-
Fetch the document list dynamically from GitHub API:
|
|
113
|
-
|
|
114
|
-
```javascript
|
|
115
|
-
const { Octokit } = require('@octokit/rest');
|
|
116
|
-
|
|
117
|
-
module.exports = {
|
|
118
|
-
plugins: [
|
|
119
|
-
[
|
|
120
|
-
'docusaurus-plugin-remote-content',
|
|
121
|
-
{
|
|
122
|
-
name: 'gx-devtools-docs',
|
|
123
|
-
sourceBaseUrl:
|
|
124
|
-
'https://raw.githubusercontent.com/gramercytech/gx-devtools/main/docs/',
|
|
125
|
-
outDir: 'docs/gx-devtools',
|
|
126
|
-
|
|
127
|
-
// Dynamically fetch file list
|
|
128
|
-
documents: async () => {
|
|
129
|
-
const octokit = new Octokit();
|
|
130
|
-
const { data } = await octokit.repos.getContent({
|
|
131
|
-
owner: 'gramercytech',
|
|
132
|
-
repo: 'gx-devtools',
|
|
133
|
-
path: 'docs',
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
return data
|
|
137
|
-
.filter((file) => file.name.endsWith('.md'))
|
|
138
|
-
.map((file) => file.name);
|
|
139
|
-
},
|
|
140
|
-
},
|
|
141
|
-
],
|
|
142
|
-
],
|
|
143
|
-
};
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
## Option 2: Git Submodule
|
|
147
|
-
|
|
148
|
-
Add gx-devtools as a git submodule and reference its docs directly.
|
|
149
|
-
|
|
150
|
-
### Setup
|
|
151
|
-
|
|
152
|
-
```bash
|
|
153
|
-
# Add submodule
|
|
154
|
-
git submodule add https://github.com/gramercytech/gx-devtools.git packages/gx-devtools
|
|
155
|
-
|
|
156
|
-
# Update .gitmodules
|
|
157
|
-
git submodule update --init --recursive
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
### Configuration
|
|
161
|
-
|
|
162
|
-
```javascript
|
|
163
|
-
// docusaurus.config.js
|
|
164
|
-
module.exports = {
|
|
165
|
-
presets: [
|
|
166
|
-
[
|
|
167
|
-
'@docusaurus/preset-classic',
|
|
168
|
-
{
|
|
169
|
-
docs: {
|
|
170
|
-
// Include gx-devtools docs
|
|
171
|
-
include: ['**/*.md', '../packages/gx-devtools/docs/**/*.md'],
|
|
172
|
-
},
|
|
173
|
-
},
|
|
174
|
-
],
|
|
175
|
-
],
|
|
176
|
-
};
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
### CI/CD Update
|
|
180
|
-
|
|
181
|
-
Add to your build script:
|
|
182
|
-
|
|
183
|
-
```bash
|
|
184
|
-
git submodule update --remote --merge
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
## Option 3: npm Package Docs
|
|
188
|
-
|
|
189
|
-
Since gx-devtools is an npm package, reference docs from node_modules.
|
|
190
|
-
|
|
191
|
-
### Configuration
|
|
192
|
-
|
|
193
|
-
```javascript
|
|
194
|
-
// docusaurus.config.js
|
|
195
|
-
const path = require('path');
|
|
196
|
-
|
|
197
|
-
module.exports = {
|
|
198
|
-
plugins: [
|
|
199
|
-
[
|
|
200
|
-
'@docusaurus/plugin-content-docs',
|
|
201
|
-
{
|
|
202
|
-
id: 'gx-devtools',
|
|
203
|
-
path: path.resolve(
|
|
204
|
-
__dirname,
|
|
205
|
-
'node_modules/@gramercytech/gx-devtools/docs'
|
|
206
|
-
),
|
|
207
|
-
routeBasePath: 'gx-devtools',
|
|
208
|
-
sidebarPath: require.resolve('./sidebars-gx-devtools.js'),
|
|
209
|
-
},
|
|
210
|
-
],
|
|
211
|
-
],
|
|
212
|
-
};
|
|
213
|
-
```
|
|
214
|
-
|
|
215
|
-
### Sidebar Config
|
|
216
|
-
|
|
217
|
-
Create `sidebars-gx-devtools.js`:
|
|
218
|
-
|
|
219
|
-
```javascript
|
|
220
|
-
module.exports = {
|
|
221
|
-
gxToolkitSidebar: [
|
|
222
|
-
'index',
|
|
223
|
-
'getting-started',
|
|
224
|
-
'app-manifest',
|
|
225
|
-
'gxp-store',
|
|
226
|
-
'dev-tools',
|
|
227
|
-
'building-for-platform',
|
|
228
|
-
],
|
|
229
|
-
};
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
## Sidebar Integration
|
|
233
|
-
|
|
234
|
-
To include gx-devtools docs in your main sidebar:
|
|
235
|
-
|
|
236
|
-
```javascript
|
|
237
|
-
// sidebars.js
|
|
238
|
-
module.exports = {
|
|
239
|
-
docs: [
|
|
240
|
-
'intro',
|
|
241
|
-
'quickstart',
|
|
242
|
-
// ... your other docs
|
|
243
|
-
|
|
244
|
-
// Link to gx-devtools section
|
|
245
|
-
{
|
|
246
|
-
type: 'category',
|
|
247
|
-
label: 'GxP Toolkit',
|
|
248
|
-
link: {
|
|
249
|
-
type: 'doc',
|
|
250
|
-
id: 'gx-devtools/index',
|
|
251
|
-
},
|
|
252
|
-
items: [
|
|
253
|
-
'gx-devtools/getting-started',
|
|
254
|
-
'gx-devtools/app-manifest',
|
|
255
|
-
'gx-devtools/gxp-store',
|
|
256
|
-
'gx-devtools/dev-tools',
|
|
257
|
-
'gx-devtools/building-for-platform',
|
|
258
|
-
],
|
|
259
|
-
},
|
|
260
|
-
],
|
|
261
|
-
};
|
|
262
|
-
```
|
|
263
|
-
|
|
264
|
-
## Customizing Imported Docs
|
|
265
|
-
|
|
266
|
-
### Modify Content During Fetch
|
|
267
|
-
|
|
268
|
-
```javascript
|
|
269
|
-
[
|
|
270
|
-
'docusaurus-plugin-remote-content',
|
|
271
|
-
{
|
|
272
|
-
name: 'gx-devtools-docs',
|
|
273
|
-
sourceBaseUrl: '...',
|
|
274
|
-
outDir: 'docs/gx-devtools',
|
|
275
|
-
documents: ['getting-started.md'],
|
|
276
|
-
|
|
277
|
-
// Modify content before writing
|
|
278
|
-
modifyContent: (filename, content) => {
|
|
279
|
-
// Add custom header
|
|
280
|
-
if (filename === 'index.md') {
|
|
281
|
-
return {
|
|
282
|
-
filename,
|
|
283
|
-
content: content.replace(
|
|
284
|
-
'---',
|
|
285
|
-
'---\ncustom_edit_url: https://github.com/gramercytech/gx-devtools/edit/main/docs/index.md'
|
|
286
|
-
),
|
|
287
|
-
};
|
|
288
|
-
}
|
|
289
|
-
return undefined; // No modification
|
|
290
|
-
},
|
|
291
|
-
},
|
|
292
|
-
];
|
|
293
|
-
```
|
|
294
|
-
|
|
295
|
-
### Override Specific Pages
|
|
296
|
-
|
|
297
|
-
Create local overrides that take precedence:
|
|
298
|
-
|
|
299
|
-
```
|
|
300
|
-
docs/
|
|
301
|
-
├── gx-devtools/ # Remote content lands here
|
|
302
|
-
│ ├── index.md # From remote
|
|
303
|
-
│ └── getting-started.md # From remote
|
|
304
|
-
└── gx-devtools-overrides/
|
|
305
|
-
└── getting-started.md # Your custom version
|
|
306
|
-
```
|
|
307
|
-
|
|
308
|
-
Configure path priority in Docusaurus.
|
|
309
|
-
|
|
310
|
-
## Adding/Removing Pages
|
|
311
|
-
|
|
312
|
-
To add new pages to gx-devtools docs:
|
|
313
|
-
|
|
314
|
-
1. Create the `.md` file in `/docs/` in this repo
|
|
315
|
-
2. Add Docusaurus frontmatter (sidebar_position, title, etc.)
|
|
316
|
-
3. Add the filename to the `documents` array in your platform's config
|
|
317
|
-
4. Rebuild your platform docs
|
|
318
|
-
|
|
319
|
-
To remove a page:
|
|
320
|
-
|
|
321
|
-
1. Remove from the `documents` array
|
|
322
|
-
2. Delete from your `outDir` if using CLI sync mode
|
|
323
|
-
3. Rebuild
|
|
324
|
-
|
|
325
|
-
## Triggering Rebuilds
|
|
326
|
-
|
|
327
|
-
### GitHub Actions (Recommended)
|
|
328
|
-
|
|
329
|
-
Set up a webhook to rebuild platform docs when gx-devtools changes:
|
|
330
|
-
|
|
331
|
-
```yaml
|
|
332
|
-
# .github/workflows/docs-update.yml (in gx-devtools repo)
|
|
333
|
-
name: Notify Platform Docs
|
|
334
|
-
|
|
335
|
-
on:
|
|
336
|
-
push:
|
|
337
|
-
paths:
|
|
338
|
-
- 'docs/**'
|
|
339
|
-
|
|
340
|
-
jobs:
|
|
341
|
-
notify:
|
|
342
|
-
runs-on: ubuntu-latest
|
|
343
|
-
steps:
|
|
344
|
-
- name: Trigger platform docs rebuild
|
|
345
|
-
run: |
|
|
346
|
-
curl -X POST \
|
|
347
|
-
-H "Authorization: token ${{ secrets.PLATFORM_DOCS_TOKEN }}" \
|
|
348
|
-
-H "Accept: application/vnd.github.v3+json" \
|
|
349
|
-
https://api.github.com/repos/gramercytech/platform-docs/dispatches \
|
|
350
|
-
-d '{"event_type": "gx-devtools-docs-updated"}'
|
|
351
|
-
```
|
|
352
|
-
|
|
353
|
-
### Manual Rebuild
|
|
354
|
-
|
|
355
|
-
```bash
|
|
356
|
-
# Clear cached remote content
|
|
357
|
-
npx docusaurus clear-remote-gx-devtools-docs
|
|
358
|
-
|
|
359
|
-
# Rebuild
|
|
360
|
-
npm run build
|
|
361
|
-
```
|
|
362
|
-
|
|
363
|
-
## Versioning
|
|
364
|
-
|
|
365
|
-
If you need versioned docs:
|
|
366
|
-
|
|
367
|
-
```javascript
|
|
368
|
-
[
|
|
369
|
-
'docusaurus-plugin-remote-content',
|
|
370
|
-
{
|
|
371
|
-
name: 'gx-devtools-docs-v1',
|
|
372
|
-
sourceBaseUrl:
|
|
373
|
-
'https://raw.githubusercontent.com/gramercytech/gx-devtools/v1.0.0/docs/',
|
|
374
|
-
outDir: 'versioned_docs/version-1.0/gx-devtools',
|
|
375
|
-
documents: ['index.md', '...'],
|
|
376
|
-
},
|
|
377
|
-
];
|
|
378
|
-
```
|
package/docs/_category_.json
DELETED
package/docs/app-manifest.md
DELETED
|
@@ -1,272 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
sidebar_position: 3
|
|
3
|
-
title: App Manifest
|
|
4
|
-
description: Configure your plugin with settings, strings, assets, and more
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# App Manifest
|
|
8
|
-
|
|
9
|
-
The `app-manifest.json` file is the central configuration for your GxP plugin. It defines settings, translatable strings, assets, and runtime state that the platform injects into your plugin.
|
|
10
|
-
|
|
11
|
-
## File Location
|
|
12
|
-
|
|
13
|
-
The manifest file should be in your project root:
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
my-plugin/
|
|
17
|
-
├── app-manifest.json # <-- Here
|
|
18
|
-
├── src/
|
|
19
|
-
└── ...
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## Basic Structure
|
|
23
|
-
|
|
24
|
-
```json
|
|
25
|
-
{
|
|
26
|
-
"settings": {},
|
|
27
|
-
"strings": {},
|
|
28
|
-
"assets": {},
|
|
29
|
-
"triggerState": {},
|
|
30
|
-
"dependencies": [],
|
|
31
|
-
"permissions": []
|
|
32
|
-
}
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## Configuration Sections
|
|
36
|
-
|
|
37
|
-
### Settings (`pluginVars`)
|
|
38
|
-
|
|
39
|
-
Define configurable settings that administrators can customize per deployment:
|
|
40
|
-
|
|
41
|
-
```json
|
|
42
|
-
{
|
|
43
|
-
"settings": {
|
|
44
|
-
"primary_color": "#FFD600",
|
|
45
|
-
"background_color": "#ffffff",
|
|
46
|
-
"company_name": "Acme Corp",
|
|
47
|
-
"max_items": 10,
|
|
48
|
-
"enable_animations": true
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
Access in your component:
|
|
54
|
-
|
|
55
|
-
```javascript
|
|
56
|
-
const store = useGxpStore();
|
|
57
|
-
|
|
58
|
-
// Get a setting with fallback
|
|
59
|
-
const color = store.getSetting('primary_color', '#000000');
|
|
60
|
-
|
|
61
|
-
// Check if setting exists
|
|
62
|
-
if (store.pluginVars.enable_animations) {
|
|
63
|
-
// ...
|
|
64
|
-
}
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
Use in templates with the `gxp-settings` modifier:
|
|
68
|
-
|
|
69
|
-
```html
|
|
70
|
-
<span gxp-string="company_name" gxp-settings>Default Company</span>
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
### Strings (`stringsList`)
|
|
74
|
-
|
|
75
|
-
Define translatable text content:
|
|
76
|
-
|
|
77
|
-
```json
|
|
78
|
-
{
|
|
79
|
-
"strings": {
|
|
80
|
-
"default": {
|
|
81
|
-
"welcome_title": "Welcome to the Event",
|
|
82
|
-
"welcome_subtitle": "Please check in below",
|
|
83
|
-
"button_checkin": "Check In",
|
|
84
|
-
"button_cancel": "Cancel",
|
|
85
|
-
"error_not_found": "Registration not found"
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
Use in templates with the `gxp-string` directive:
|
|
92
|
-
|
|
93
|
-
```html
|
|
94
|
-
<h1 gxp-string="welcome_title">Default Welcome</h1>
|
|
95
|
-
<button gxp-string="button_checkin">Check In</button>
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
Access programmatically:
|
|
99
|
-
|
|
100
|
-
```javascript
|
|
101
|
-
const store = useGxpStore();
|
|
102
|
-
const title = store.getString('welcome_title', 'Default Title');
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
:::tip Hot Reload
|
|
106
|
-
Changes to strings in `app-manifest.json` are hot-reloaded during development. No page refresh needed!
|
|
107
|
-
:::
|
|
108
|
-
|
|
109
|
-
### Assets (`assetList`)
|
|
110
|
-
|
|
111
|
-
Define asset URLs (images, documents, etc.):
|
|
112
|
-
|
|
113
|
-
```json
|
|
114
|
-
{
|
|
115
|
-
"assets": {
|
|
116
|
-
"hero_image": "/dev-assets/images/hero.jpg",
|
|
117
|
-
"logo": "/dev-assets/images/logo.png",
|
|
118
|
-
"background": "/dev-assets/images/bg-pattern.svg",
|
|
119
|
-
"welcome_video": "/dev-assets/videos/intro.mp4"
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
Use in templates with the `gxp-src` directive:
|
|
125
|
-
|
|
126
|
-
```html
|
|
127
|
-
<img gxp-src="hero_image" src="/dev-assets/placeholder.jpg" alt="Hero" />
|
|
128
|
-
<img gxp-src="logo" src="/dev-assets/placeholder.jpg" alt="Logo" />
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
Access programmatically:
|
|
132
|
-
|
|
133
|
-
```javascript
|
|
134
|
-
const store = useGxpStore();
|
|
135
|
-
const heroUrl = store.getAsset('hero_image', '/fallback.jpg');
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
### Trigger State (`triggerState`)
|
|
139
|
-
|
|
140
|
-
Define dynamic runtime state that can change during plugin execution:
|
|
141
|
-
|
|
142
|
-
```json
|
|
143
|
-
{
|
|
144
|
-
"triggerState": {
|
|
145
|
-
"is_active": true,
|
|
146
|
-
"current_step": 1,
|
|
147
|
-
"checked_in_count": 0,
|
|
148
|
-
"last_scan_result": null
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
Use in templates with the `gxp-state` modifier:
|
|
154
|
-
|
|
155
|
-
```html
|
|
156
|
-
<span gxp-string="current_step" gxp-state>1</span>
|
|
157
|
-
<img gxp-src="dynamic_badge" gxp-state src="/placeholder.jpg" />
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
Update programmatically:
|
|
161
|
-
|
|
162
|
-
```javascript
|
|
163
|
-
const store = useGxpStore();
|
|
164
|
-
|
|
165
|
-
// Update state
|
|
166
|
-
store.updateState('current_step', 2);
|
|
167
|
-
store.updateState('checked_in_count', store.triggerState.checked_in_count + 1);
|
|
168
|
-
|
|
169
|
-
// Read state
|
|
170
|
-
const step = store.getState('current_step', 1);
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
### Dependencies
|
|
174
|
-
|
|
175
|
-
Define external services or plugins this plugin depends on:
|
|
176
|
-
|
|
177
|
-
```json
|
|
178
|
-
{
|
|
179
|
-
"dependencies": [
|
|
180
|
-
{
|
|
181
|
-
"id": "badge-printer",
|
|
182
|
-
"type": "hardware",
|
|
183
|
-
"required": true
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
"id": "registration-api",
|
|
187
|
-
"type": "api",
|
|
188
|
-
"required": true
|
|
189
|
-
}
|
|
190
|
-
]
|
|
191
|
-
}
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
### Permissions
|
|
195
|
-
|
|
196
|
-
Define permissions required by the plugin:
|
|
197
|
-
|
|
198
|
-
```json
|
|
199
|
-
{
|
|
200
|
-
"permissions": [
|
|
201
|
-
"camera",
|
|
202
|
-
"bluetooth",
|
|
203
|
-
"notifications"
|
|
204
|
-
]
|
|
205
|
-
}
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
Check permissions in code:
|
|
209
|
-
|
|
210
|
-
```javascript
|
|
211
|
-
const store = useGxpStore();
|
|
212
|
-
|
|
213
|
-
if (store.hasPermission('camera')) {
|
|
214
|
-
// Enable camera features
|
|
215
|
-
}
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
## Complete Example
|
|
219
|
-
|
|
220
|
-
```json
|
|
221
|
-
{
|
|
222
|
-
"settings": {
|
|
223
|
-
"primary_color": "#FFD600",
|
|
224
|
-
"secondary_color": "#1976D2",
|
|
225
|
-
"company_name": "TechConf 2024",
|
|
226
|
-
"check_in_timeout": 30,
|
|
227
|
-
"enable_badge_printing": true
|
|
228
|
-
},
|
|
229
|
-
"strings": {
|
|
230
|
-
"default": {
|
|
231
|
-
"welcome_title": "Welcome to TechConf 2024",
|
|
232
|
-
"welcome_subtitle": "Scan your QR code to check in",
|
|
233
|
-
"btn_manual_entry": "Enter Code Manually",
|
|
234
|
-
"btn_help": "Need Help?",
|
|
235
|
-
"success_message": "You're all set!",
|
|
236
|
-
"error_invalid_code": "Invalid code. Please try again.",
|
|
237
|
-
"error_already_checked_in": "You've already checked in."
|
|
238
|
-
}
|
|
239
|
-
},
|
|
240
|
-
"assets": {
|
|
241
|
-
"logo": "/dev-assets/images/techconf-logo.png",
|
|
242
|
-
"hero_background": "/dev-assets/images/hero-bg.jpg",
|
|
243
|
-
"success_animation": "/dev-assets/animations/success.json"
|
|
244
|
-
},
|
|
245
|
-
"triggerState": {
|
|
246
|
-
"is_scanning": false,
|
|
247
|
-
"current_attendee": null,
|
|
248
|
-
"badge_printing": false
|
|
249
|
-
},
|
|
250
|
-
"dependencies": [],
|
|
251
|
-
"permissions": ["camera"]
|
|
252
|
-
}
|
|
253
|
-
```
|
|
254
|
-
|
|
255
|
-
## Directive Reference
|
|
256
|
-
|
|
257
|
-
| Directive | Modifier | Source | Example |
|
|
258
|
-
|-----------|----------|--------|---------|
|
|
259
|
-
| `gxp-string` | (none) | `stringsList` | `<h1 gxp-string="title">Default</h1>` |
|
|
260
|
-
| `gxp-string` | `gxp-settings` | `pluginVars` | `<span gxp-string="company" gxp-settings>Acme</span>` |
|
|
261
|
-
| `gxp-string` | `gxp-assets` | `assetList` | `<span gxp-string="logo_url" gxp-assets>/logo.png</span>` |
|
|
262
|
-
| `gxp-string` | `gxp-state` | `triggerState` | `<span gxp-string="count" gxp-state>0</span>` |
|
|
263
|
-
| `gxp-src` | (none) | `assetList` | `<img gxp-src="hero" src="/placeholder.jpg" />` |
|
|
264
|
-
| `gxp-src` | `gxp-state` | `triggerState` | `<img gxp-src="badge" gxp-state src="/placeholder.jpg" />` |
|
|
265
|
-
|
|
266
|
-
## Best Practices
|
|
267
|
-
|
|
268
|
-
1. **Use descriptive keys** - `welcome_title` is better than `title1`
|
|
269
|
-
2. **Provide defaults** - Always include fallback text in your templates
|
|
270
|
-
3. **Group related strings** - Keep related strings together for easier management
|
|
271
|
-
4. **Use dev-assets for development** - Put placeholder images in `dev-assets/images/`
|
|
272
|
-
5. **Keep settings minimal** - Only expose settings that need admin configuration
|