@nesso-how/plugin-example 0.3.1 → 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/dist/index.js +5 -5
- package/package.json +2 -2
- package/src/index.ts +3 -3
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// package.json
|
|
2
2
|
var package_default = {
|
|
3
3
|
name: "@nesso-how/plugin-example",
|
|
4
|
-
version: "0.
|
|
4
|
+
version: "0.4.0",
|
|
5
5
|
description: "Uppercase concept labels in the invoked Nesso view",
|
|
6
6
|
license: "MIT",
|
|
7
7
|
repository: {
|
|
@@ -22,7 +22,7 @@ var package_default = {
|
|
|
22
22
|
registry: "https://registry.npmjs.org/"
|
|
23
23
|
},
|
|
24
24
|
devDependencies: {
|
|
25
|
-
"@nesso-how/plugin": "0.
|
|
25
|
+
"@nesso-how/plugin": "0.4.0",
|
|
26
26
|
esbuild: "^0.28.2",
|
|
27
27
|
typescript: "~7.0.2"
|
|
28
28
|
},
|
|
@@ -47,14 +47,14 @@ var create = () => {
|
|
|
47
47
|
const action = {
|
|
48
48
|
id: "uppercase-labels",
|
|
49
49
|
label: package_default.i18n.metadata.name,
|
|
50
|
-
run: async ({
|
|
51
|
-
const state =
|
|
50
|
+
run: async ({ document }) => {
|
|
51
|
+
const state = document.getState();
|
|
52
52
|
const operations = state.viewGraph.concepts.map(({ id, label }) => ({
|
|
53
53
|
kind: "concept.label",
|
|
54
54
|
id,
|
|
55
55
|
value: label.toUpperCase()
|
|
56
56
|
}));
|
|
57
|
-
await
|
|
57
|
+
await document.applyOperations(operations);
|
|
58
58
|
}
|
|
59
59
|
};
|
|
60
60
|
return [action];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nesso-how/plugin-example",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Uppercase concept labels in the invoked Nesso view",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"registry": "https://registry.npmjs.org/"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@nesso-how/plugin": "0.
|
|
24
|
+
"@nesso-how/plugin": "0.4.0",
|
|
25
25
|
"esbuild": "^0.28.2",
|
|
26
26
|
"typescript": "~7.0.2"
|
|
27
27
|
},
|
package/src/index.ts
CHANGED
|
@@ -5,8 +5,8 @@ export const create = (): readonly ActionContribution[] => {
|
|
|
5
5
|
const action: ActionContribution = {
|
|
6
6
|
id: 'uppercase-labels',
|
|
7
7
|
label: source.i18n.metadata.name,
|
|
8
|
-
run: async ({
|
|
9
|
-
const state =
|
|
8
|
+
run: async ({ document }) => {
|
|
9
|
+
const state = document.getState()
|
|
10
10
|
|
|
11
11
|
const operations: readonly NessoOperation[] = state.viewGraph.concepts.map(({ id, label }) => ({
|
|
12
12
|
kind: 'concept.label',
|
|
@@ -14,7 +14,7 @@ export const create = (): readonly ActionContribution[] => {
|
|
|
14
14
|
value: label.toUpperCase(),
|
|
15
15
|
}))
|
|
16
16
|
|
|
17
|
-
await
|
|
17
|
+
await document.applyOperations(operations)
|
|
18
18
|
},
|
|
19
19
|
}
|
|
20
20
|
|