@nesso-how/plugin 1.0.0-beta.24 → 1.0.0-beta.26
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 +35 -35
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/node/index.d.ts +1 -1
- package/dist/node/runtime.d.ts +28 -28
- package/dist/node/runtime.js +23 -23
- package/dist/node/storage.d.ts +4 -4
- package/dist/node/storage.js +1 -1
- package/dist/package.d.ts +1 -1
- package/dist/package.js +1 -1
- package/dist/{runtime-ZHRz4_y1.js → runtime-BGO97h75.js} +55 -54
- package/dist/{runtime-BrbkQ4Oi.d.ts → runtime-C_IkTCNf.d.ts} +59 -59
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +1 -1
- package/example/README.md +3 -3
- package/example/package.json +4 -4
- package/example/src/Quiz.tsx +4 -4
- package/example/src/index.ts +1 -1
- package/package.json +1 -1
package/dist/runtime.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as pluginStorageLimits, B as LocalizedText, D as parsePluginStorageKey, F as parseFileOptions, G as parseDefinition, I as ImageRenderOptions, K as themeColors, L as RenderedImage, M as FileOpenResult, N as FileSaveOptions, O as parsePluginStorageRecord, P as fileTextLimit, R as PluginError, S as checkMessageSize, U as Definition, V as resolvePluginText, _ as parsePluginMessage, a as ActionDescriptor, b as sha256Hex, c as PluginI18n, d as badgeLimits, f as createPluginClient, g as parsePluginManifest, h as parsePluginI18n, i as ActionContribution, j as FileOpenOptions, k as parsePluginStorageSnapshot, l as PluginManifest, m as parseContribution, n as ActionBadgeResult, o as ActionIconName, p as parseActionBadgeResult, r as ActionContext, s as ActionState, t as ActionBadgeInput, u as actionIconNames, v as pluginApiVersion, x as themeTokens, y as runtimeLimits, z as parseOrThrow } from "./runtime-
|
|
1
|
+
import { A as pluginStorageLimits, B as LocalizedText, D as parsePluginStorageKey, F as parseFileOptions, G as parseDefinition, I as ImageRenderOptions, K as themeColors, L as RenderedImage, M as FileOpenResult, N as FileSaveOptions, O as parsePluginStorageRecord, P as fileTextLimit, R as PluginError, S as checkMessageSize, U as Definition, V as resolvePluginText, _ as parsePluginMessage, a as ActionDescriptor, b as sha256Hex, c as PluginI18n, d as badgeLimits, f as createPluginClient, g as parsePluginManifest, h as parsePluginI18n, i as ActionContribution, j as FileOpenOptions, k as parsePluginStorageSnapshot, l as PluginManifest, m as parseContribution, n as ActionBadgeResult, o as ActionIconName, p as parseActionBadgeResult, r as ActionContext, s as ActionState, t as ActionBadgeInput, u as actionIconNames, v as pluginApiVersion, x as themeTokens, y as runtimeLimits, z as parseOrThrow } from "./runtime-C_IkTCNf.js";
|
|
2
2
|
export { ActionBadgeInput, ActionBadgeResult, ActionContext, ActionContribution, ActionDescriptor, ActionIconName, ActionState, type Definition, type FileOpenOptions, type FileOpenResult, type FileSaveOptions, type ImageRenderOptions, type LocalizedText, PluginError, PluginI18n, PluginManifest, type RenderedImage, actionIconNames, badgeLimits, checkMessageSize, createPluginClient, fileTextLimit, parseActionBadgeResult, parseContribution, parseDefinition, parseFileOptions, parseOrThrow, parsePluginI18n, parsePluginManifest, parsePluginMessage, parsePluginStorageKey, parsePluginStorageRecord, parsePluginStorageSnapshot, pluginApiVersion, pluginStorageLimits, resolvePluginText, runtimeLimits, sha256Hex, themeColors, themeTokens };
|
package/dist/runtime.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { C as PluginError, t as actionIconNames, n as badgeLimits, _ as checkMessageSize, r as createPluginClient, x as fileTextLimit, i as parseActionBadgeResult, a as parseContribution, y as parseDefinition, S as parseFileOptions, w as parseOrThrow, o as parsePluginI18n, s as parsePluginManifest, c as parsePluginMessage, p as parsePluginStorageKey, m as parsePluginStorageRecord, h as parsePluginStorageSnapshot, l as pluginApiVersion, g as pluginStorageLimits, v as resolvePluginText, u as runtimeLimits, d as sha256Hex, b as themeColors, f as themeTokens } from "./runtime-
|
|
1
|
+
export { C as PluginError, t as actionIconNames, n as badgeLimits, _ as checkMessageSize, r as createPluginClient, x as fileTextLimit, i as parseActionBadgeResult, a as parseContribution, y as parseDefinition, S as parseFileOptions, w as parseOrThrow, o as parsePluginI18n, s as parsePluginManifest, c as parsePluginMessage, p as parsePluginStorageKey, m as parsePluginStorageRecord, h as parsePluginStorageSnapshot, l as pluginApiVersion, g as pluginStorageLimits, v as resolvePluginText, u as runtimeLimits, d as sha256Hex, b as themeColors, f as themeTokens } from "./runtime-BGO97h75.js";
|
package/example/README.md
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Two actions built with the Nesso SDK:
|
|
4
4
|
|
|
5
|
-
- **Uppercase labels** changes concept labels in the current
|
|
6
|
-
- **Concept Quiz** uses React to quiz you on the
|
|
5
|
+
- **Uppercase labels** changes concept labels in the current map. See [`src/index.ts`](src/index.ts).
|
|
6
|
+
- **Concept Quiz** uses React to quiz you on the map's relations and saves your progress. See [`src/Quiz.tsx`](src/Quiz.tsx).
|
|
7
7
|
|
|
8
8
|
## Install and try
|
|
9
9
|
|
|
10
10
|
In the desktop app, open Settings → Plugins, search for `@nesso-how/plugin-example`, and install it. Approve access to concept labels, panels, and private storage.
|
|
11
11
|
|
|
12
|
-
Run either action from a
|
|
12
|
+
Run either action from a map's context menu in the Explorer, or from its actions in the Inspector with nothing selected.
|
|
13
13
|
|
|
14
14
|
## Build your own
|
|
15
15
|
|
package/example/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nesso-how/plugin-example",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.26",
|
|
4
4
|
"description": "Official example showing how to build Nesso plugins with the SDK and plugin APIs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nesso-plugin"
|
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
"prepack": "npm run build"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@nesso-how/ui": "1.0.0-beta.
|
|
31
|
+
"@nesso-how/ui": "1.0.0-beta.26",
|
|
32
32
|
"react": "^19.2.8",
|
|
33
33
|
"react-dom": "^19.2.8"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@nesso-how/plugin": "1.0.0-beta.
|
|
36
|
+
"@nesso-how/plugin": "1.0.0-beta.26",
|
|
37
37
|
"@types/react": "^19.2.18",
|
|
38
38
|
"@types/react-dom": "^19.2.7",
|
|
39
39
|
"typescript": "~7.0.2",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
56
|
"nesso": {
|
|
57
|
-
"apiVersion":
|
|
57
|
+
"apiVersion": 7,
|
|
58
58
|
"kind": "actions",
|
|
59
59
|
"entry": "dist/index.js",
|
|
60
60
|
"writes": [
|
package/example/src/Quiz.tsx
CHANGED
|
@@ -3,10 +3,10 @@ import { Button } from '@nesso-how/ui'
|
|
|
3
3
|
import type { ActionContext } from '@nesso-how/plugin'
|
|
4
4
|
import './Quiz.css'
|
|
5
5
|
|
|
6
|
-
export function Quiz({ document, storage,
|
|
6
|
+
export function Quiz({ document, storage, mapId }: ActionContext) {
|
|
7
7
|
const [step, setStep] = useState<number | null>(null)
|
|
8
8
|
const [revealed, setRevealed] = useState(false)
|
|
9
|
-
const key = `quiz:${
|
|
9
|
+
const key = `quiz:${mapId ?? 'all'}`
|
|
10
10
|
|
|
11
11
|
useEffect(() => {
|
|
12
12
|
void storage.list().then((records) => {
|
|
@@ -26,7 +26,7 @@ export function Quiz({ document, storage, viewId }: ActionContext) {
|
|
|
26
26
|
|
|
27
27
|
if (step === null) return null
|
|
28
28
|
|
|
29
|
-
const { concepts, relations, relationTypes } = document.getState().
|
|
29
|
+
const { concepts, relations, relationTypes } = document.getState().mapGraph
|
|
30
30
|
const relation = relations[step]
|
|
31
31
|
const relationType = relationTypes.find(({ id }) => id === relation?.predicate)
|
|
32
32
|
const conceptLabel = (id: string) => concepts.find((item) => item.id === id)?.label || id
|
|
@@ -50,7 +50,7 @@ export function Quiz({ document, storage, viewId }: ActionContext) {
|
|
|
50
50
|
</>
|
|
51
51
|
) : (
|
|
52
52
|
<p data-result role="status">
|
|
53
|
-
{relations.length ? 'Quiz complete!' : 'This
|
|
53
|
+
{relations.length ? 'Quiz complete!' : 'This map has no relations.'}
|
|
54
54
|
</p>
|
|
55
55
|
)}
|
|
56
56
|
<footer>
|
package/example/src/index.ts
CHANGED
|
@@ -8,7 +8,7 @@ export const create = (): readonly ActionContribution[] => {
|
|
|
8
8
|
run: async ({ document }) => {
|
|
9
9
|
const state = document.getState()
|
|
10
10
|
|
|
11
|
-
const operations: readonly NessoOperation[] = state.
|
|
11
|
+
const operations: readonly NessoOperation[] = state.mapGraph.concepts.map(
|
|
12
12
|
({ id, label }) => ({
|
|
13
13
|
kind: 'concept.label',
|
|
14
14
|
id,
|