@ham2k/extension-sdk 0.2.0 → 0.4.0
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/LICENSE +21 -0
- package/README.md +20 -4
- package/dist/activityExports.js +48 -11
- package/dist/activityScoring.js +2 -0
- package/dist/dxcc.js +15 -2
- package/dist/exportSettings.js +133 -0
- package/dist/index.d.ts +133 -5
- package/dist/index.js +17 -14
- package/dist/modes.js +20 -0
- package/dist/refTransforms.js +34 -0
- package/dist/referenceActivity.js +89 -18
- package/dist/scoring.js +11 -4
- package/dist/segments.js +17 -0
- package/dist/templateContext.js +4 -0
- package/docs/distribution.md +168 -2
- package/docs/forms.md +36 -0
- package/docs/hooks.md +193 -28
- package/docs/settings.md +11 -9
- package/docs/templates.md +27 -25
- package/package.json +11 -2
- package/samples/k2hrc-cqww/manifest.json +0 -1
- package/samples/k2hrc-cqww/src/index.ts +1 -1
- package/samples/k2hrc-hamqth/manifest.json +0 -1
- package/samples/k2hrc-hamqth/src/index.ts +1 -1
- package/samples/k2hrc-llota/manifest.json +1 -1
- package/samples/k2hrc-llota/src/index.ts +1 -1
- package/samples/k2hrc-radio/manifest.json +0 -1
- package/samples/k2hrc-radio/src/index.ts +1 -1
package/docs/templates.md
CHANGED
|
@@ -19,7 +19,7 @@ const text = renderTemplate("{{ op.station }} — {{ op.qsoCount }} QSOs", templ
|
|
|
19
19
|
|
|
20
20
|
A template is DATA. Liquid parses and interprets; Handlebars compiles
|
|
21
21
|
through `new Function`. These templates are written by operators, copied
|
|
22
|
-
between operators, and
|
|
22
|
+
between operators, and are editable in settings, so the one
|
|
23
23
|
that cannot become code is the one to have. Liquid also has comparisons
|
|
24
24
|
(`{% if op.qsoCount > 100 %}`) and loops built in, where Handlebars needs a
|
|
25
25
|
registered helper for `>` and Mustache cannot compare at all.
|
|
@@ -38,19 +38,19 @@ the namespaces are deliberately polo's. The syntax around them does not:
|
|
|
38
38
|
|
|
39
39
|
## What a template can name
|
|
40
40
|
|
|
41
|
-
| namespace | panel `render` | export filename | ADIF fields |
|
|
42
|
-
|
|
43
|
-
| `app` | ✓ | — | ✓ |
|
|
44
|
-
| `now` | ✓ | ✓ | ✓ |
|
|
45
|
-
| `op` | ✓ |
|
|
46
|
-
| `qso` | when the placement's triggers ask for it | — | ✓ |
|
|
47
|
-
| `config` | ✓ | — | — |
|
|
48
|
-
| `log` | — | ✓ | ✓ |
|
|
41
|
+
| namespace | panel `render` | export filename | ADIF fields | CW message |
|
|
42
|
+
|---|---|---|---|---|
|
|
43
|
+
| `app` | ✓ | — | ✓ | ✓ |
|
|
44
|
+
| `now` | ✓ | ✓ | ✓ | ✓ |
|
|
45
|
+
| `op` | ✓ | ✓ | ✓ | ✓ |
|
|
46
|
+
| `qso` | when the placement's triggers ask for it | — | ✓ | the draft contact, as far as it is typed |
|
|
47
|
+
| `config` | ✓ | — | — | — |
|
|
48
|
+
| `log` | — | ✓ | ✓ | — |
|
|
49
49
|
|
|
50
50
|
A namespace a surface has nothing for is **absent**, not blank — which is
|
|
51
|
-
what makes `{% if qso %}` an honest question.
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
what makes `{% if qso %}` an honest question. Registered exports get the operation plus the selected file’s `log` values.
|
|
52
|
+
The low-level `exportFilename(parts)` helper still supplies only dates and
|
|
53
|
+
filename parts.
|
|
54
54
|
|
|
55
55
|
### `app`
|
|
56
56
|
`app.name` — the platform-appropriate name ("Ham2K Logger" on desktop,
|
|
@@ -61,7 +61,8 @@ An ISO-8601 UTC string, for the `date` filter: `{{ now | date: '%H:%M' }}`.
|
|
|
61
61
|
|
|
62
62
|
### `op` — the operation
|
|
63
63
|
`station` (the field as typed, which may hold several comma-separated
|
|
64
|
-
callsigns
|
|
64
|
+
callsigns; `call` is the same value, the name `qso.call` has), `stations`
|
|
65
|
+
(that list, uppercased and deduped), `operator`,
|
|
65
66
|
`title` (the generated, ref-derived one), `userTitle` (the operator's own
|
|
66
67
|
words), `grid`, `refs`, `uuid`, `qsoCount`, `date`, `dateCompact`, `time`,
|
|
67
68
|
`at`, `startDate`, `startTime`, `startAt`, `endDate`, `endTime`, `endAt`.
|
|
@@ -190,15 +191,16 @@ will jump rather than count. Show HH:MM.
|
|
|
190
191
|
| what | where | editable |
|
|
191
192
|
|---|---|---|
|
|
192
193
|
| Panel documents | `custom-text`'s content and tab name | by the operator, in the panel's config form |
|
|
193
|
-
| Export filenames | `sdk/src/
|
|
194
|
-
| ADIF NOTES / COMMENT / QSLMSG | `core/adif`
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
194
|
+
| Export filenames and titles | Registered export types and `sdk/src/exportSettings.ts` | Settings → Exports, globally and per type |
|
|
195
|
+
| ADIF NOTES / COMMENT / QSLMSG | Export type settings, consumed by `core/adif` | Settings → Exports; empty templates suppress a field |
|
|
196
|
+
| CW messages | Radio settings `cwMessage1..8`, keyed on F1-F8 through the radio (docs/design/cat.md § CW keying) — rendered by the `template` hook (hooks.md) | by the operator, in the Station dialog's Messages… dialog |
|
|
197
|
+
|
|
198
|
+
NOTES and COMMENT default to QSO notes and are withheld when private data
|
|
199
|
+
is off. QSLMSG defaults to empty for program exports, and to the operation’s
|
|
200
|
+
references for the whole-log ADIF. Custom QSL messages may use contact values.
|
|
201
|
+
Templates receive no withheld private or lookup values. File titles obey the
|
|
202
|
+
private-data choice; filename templates are labels for the operator’s files.
|
|
203
|
+
|
|
204
|
+
The `textTemplate` form field provides sample previews and an insertable
|
|
205
|
+
reference; see [forms.md](forms.md). Invalid Liquid reports an error rather
|
|
206
|
+
than silently replacing the operator’s template with a default.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ham2k/extension-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Write extensions for the Ham2K Logger: typed hook contracts and the host API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ham2k",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"sdk",
|
|
11
11
|
"logging"
|
|
12
12
|
],
|
|
13
|
-
"license": "
|
|
13
|
+
"license": "MIT",
|
|
14
14
|
"author": "Sebastian Delmont <sd@ham2k.com>",
|
|
15
15
|
"homepage": "https://ham2k.com",
|
|
16
16
|
"repository": {
|
|
@@ -25,8 +25,17 @@
|
|
|
25
25
|
"subpath, so a tool asking this package its own version is told the package",
|
|
26
26
|
"does not exist. Common enough that npm's own docs call it out."
|
|
27
27
|
],
|
|
28
|
+
"//ham2k-source": [
|
|
29
|
+
"A condition only this repo's own test run asks for (`--conditions=ham2k-source`),",
|
|
30
|
+
"so a test can import the SDK by name and get the TypeScript sources rather",
|
|
31
|
+
"than a build of them — the same thing esbuild's alias does when it bundles an",
|
|
32
|
+
"extension. Deliberately not the conventional `development`: the published",
|
|
33
|
+
"tarball ships `dist` and not `src`, and a consumer who happened to run with",
|
|
34
|
+
"that common condition would be pointed at files their install does not have."
|
|
35
|
+
],
|
|
28
36
|
"exports": {
|
|
29
37
|
".": {
|
|
38
|
+
"ham2k-source": "./src/index.ts",
|
|
30
39
|
"types": "./dist/index.d.ts",
|
|
31
40
|
"default": "./dist/index.js"
|
|
32
41
|
},
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
"version": "1.0.0",
|
|
6
6
|
"description": "Lake references and activation scoring, as a worked example",
|
|
7
7
|
"category": "activity",
|
|
8
|
-
"enabledByDefault": false,
|
|
9
8
|
"icon": "waves",
|
|
10
9
|
"accentColor": "#2F7FA6",
|
|
11
10
|
"api": 1,
|
|
12
11
|
"keywords": ["lakes", "activation", "hunting", "sample"],
|
|
13
12
|
"hooks": ["activity", "adifFields", "adifImport", "dataFile", "ref:k2hrcLlota", "ref:k2hrcLlotaActivation", "scoring"],
|
|
14
13
|
"domains": ["llota.app"],
|
|
14
|
+
"relevance": { "continents": ["SA"] },
|
|
15
15
|
"sharedDependencies": {
|
|
16
16
|
"@ham2k/lib-callsigns": "^1.0.0",
|
|
17
17
|
"@ham2k/lib-country-files": "^1.0.0",
|