@nesso-how/plugin 1.0.0-beta.23 → 1.0.0-beta.24
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 +5 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/node/runtime.d.ts +8 -3
- package/dist/node/runtime.js +3 -1
- package/dist/package.d.ts +1 -1
- package/dist/package.js +1 -1
- package/dist/{runtime-BgIX6ayx.d.ts → runtime-BrbkQ4Oi.d.ts} +31 -4
- package/dist/{runtime-BXlQ2vrU.js → runtime-ZHRz4_y1.js} +36 -6
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +1 -1
- package/example/package.json +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -80,7 +80,7 @@ Keep the example's build configuration and set these fields in `package.json`:
|
|
|
80
80
|
"version": "1.0.0",
|
|
81
81
|
"keywords": ["nesso-plugin"],
|
|
82
82
|
"nesso": {
|
|
83
|
-
"apiVersion":
|
|
83
|
+
"apiVersion": 6,
|
|
84
84
|
"kind": "actions",
|
|
85
85
|
"entry": "dist/index.js",
|
|
86
86
|
"writes": ["concept.label"],
|
|
@@ -222,7 +222,7 @@ Runs in an isolated Worker with no action APIs and a 2-second calculation limit.
|
|
|
222
222
|
|
|
223
223
|
The graph snapshot provides:
|
|
224
224
|
|
|
225
|
-
- `viewGraph`: `{ concepts, relations, relationTypes }` for the invoked view. In a saved view, concepts carry its `position`, `color`, `bold`, `italic`, and `strikethrough`. `color` is a preset id such as `sand`, shown with `var(--preset-sand)`, or a fixed `#rrggbb` value.
|
|
225
|
+
- `viewGraph`: `{ concepts, relations, relationTypes }` for the invoked view. In a saved view, concepts carry its `position`, `color`, `bold`, `italic`, and `strikethrough`; relations may carry a view-local `bend`. `color` is a preset id such as `sand`, shown with `var(--preset-sand)`, or a fixed `#rrggbb` value.
|
|
226
226
|
- `selected`: the invoked view's selection.
|
|
227
227
|
- `targetViewId`: the invoked view's ID, or `null` for All; fixed for each invocation. Headless actions keep their target during navigation; panels restart with a new invocation when the active view changes.
|
|
228
228
|
- `activeVocab`: the current vocabulary, or `null`.
|
|
@@ -252,11 +252,14 @@ Call helpers on `document` and declare their operation kinds in `nesso.writes`:
|
|
|
252
252
|
| `setRelationType(id, typeId)` | `relation.type` |
|
|
253
253
|
| `createRelationType(id, label)` | `relation.type.create` |
|
|
254
254
|
| `removeRelation(id)` | `relation.remove` |
|
|
255
|
+
| `setRelationBend(id, value)` | `relation.bend` |
|
|
255
256
|
| `setSelection([{ kind, id }])` | `selection.set` |
|
|
256
257
|
| `setViewMembership(viewId, conceptId, included)` | `view.membership` |
|
|
257
258
|
|
|
258
259
|
Position, color, and style helpers edit the invoked saved view; they reject the batch in All, after navigation, or for concepts outside the view. `addConcept` returns the new IRI. New concepts join the active saved view, at the given position or near the single selected concept, and link to that concept, if any. These links and `connect` use the vocabulary's default relation type. `createRelationType` creates and assigns a type to the given relation. The selection keeps only concepts and relations visible in the active view.
|
|
259
260
|
|
|
261
|
+
`setRelationBend` follows the same active-view guard. Its finite value is the signed midpoint displacement as a fraction of the endpoint segment's length; `0` restores the automatic curve. Both endpoints must belong to the active view, and self-relations cannot be bent. Removing or reconnecting a relation clears its bends; changing only its predicate preserves them.
|
|
262
|
+
|
|
260
263
|
For related edits, use `document.applyOperations(operations)` as in the quickstart. The entire batch succeeds or changes nothing. Editing, reconnecting, retyping, or removing an unknown concept or relation rejects the batch, as does reconnecting or retyping onto an existing relation; removing an item already removed earlier in the same batch, such as a relation of a removed concept, is allowed. Separate calls are separate transactions. Raw `concept.add` operations require an explicit new absolute IRI.
|
|
261
264
|
|
|
262
265
|
Every write checks against the last snapshot you read, or the initial snapshot if you haven't read one. Successful writes advance that baseline, so awaited sequential writes work normally. Incoming updates alone do not advance it. A conflict rejects with `stale-state`; let the failure propagate so Nesso can ask the user to run the action again. Never retry mutations automatically or read a new snapshot just to submit edits calculated from old data.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as VocabDefinition, B as LocalizedText, C as PluginStorage, E as PluginStorageScope, H as ColorScheme, I as ImageRenderOptions, J as GraphSnapshot, L as RenderedImage, Q as ViewGraphSnapshot, R as PluginError, T as PluginStorageRecord, W as ThemeDefinition, X as SavedView, Y as NessoOperation, Z as Selection, a as ActionDescriptor, c as PluginI18n, i as ActionContribution, l as PluginManifest, n as ActionBadgeResult, o as ActionIconName, q as resolveRelationTypeLabel, r as ActionContext, s as ActionState, t as ActionBadgeInput, u as actionIconNames, w as PluginStorageKey } from "./runtime-
|
|
1
|
+
import { $ as VocabDefinition, B as LocalizedText, C as PluginStorage, E as PluginStorageScope, H as ColorScheme, I as ImageRenderOptions, J as GraphSnapshot, L as RenderedImage, Q as ViewGraphSnapshot, R as PluginError, T as PluginStorageRecord, W as ThemeDefinition, X as SavedView, Y as NessoOperation, Z as Selection, a as ActionDescriptor, c as PluginI18n, i as ActionContribution, l as PluginManifest, n as ActionBadgeResult, o as ActionIconName, q as resolveRelationTypeLabel, r as ActionContext, s as ActionState, t as ActionBadgeInput, u as actionIconNames, w as PluginStorageKey } from "./runtime-BrbkQ4Oi.js";
|
|
2
2
|
export { type ActionBadgeInput, type ActionBadgeResult, type ActionContext, type ActionContribution, type ActionDescriptor, type ActionIconName, type ActionState, type ColorScheme, type GraphSnapshot, type ImageRenderOptions, type LocalizedText, type NessoOperation, PluginError, type PluginI18n, type PluginManifest, type PluginStorage, type PluginStorageKey, type PluginStorageRecord, type PluginStorageScope, type RenderedImage, type SavedView, type Selection, type ThemeDefinition, type ViewGraphSnapshot, type VocabDefinition, actionIconNames, resolveRelationTypeLabel };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as PluginError, t as actionIconNames } from "./runtime-
|
|
1
|
+
import { C as PluginError, t as actionIconNames } from "./runtime-ZHRz4_y1.js";
|
|
2
2
|
//#region ../core/dist/vocab.js
|
|
3
3
|
function resolveRelationTypeLabel(type, vocabs, locale) {
|
|
4
4
|
for (const vocab of vocabs) {
|
package/dist/node/runtime.d.ts
CHANGED
|
@@ -66,9 +66,9 @@ export type PluginI18n = DeepReadonly<{
|
|
|
66
66
|
[key: string]: LocalizedText | z.infer<typeof metadata>;
|
|
67
67
|
}>;
|
|
68
68
|
export declare function parsePluginI18n(value: unknown): PluginI18n;
|
|
69
|
-
export declare const pluginApiVersion =
|
|
69
|
+
export declare const pluginApiVersion = 6;
|
|
70
70
|
declare const manifest: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
71
|
-
apiVersion: z.ZodLiteral<
|
|
71
|
+
apiVersion: z.ZodLiteral<6>;
|
|
72
72
|
kind: z.ZodLiteral<"actions">;
|
|
73
73
|
entry: z.ZodString;
|
|
74
74
|
writes: z.ZodArray<z.ZodEnum<{
|
|
@@ -82,6 +82,7 @@ declare const manifest: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
82
82
|
"concept.positions": "concept.positions";
|
|
83
83
|
"concept.remove": "concept.remove";
|
|
84
84
|
"concept.strikethrough": "concept.strikethrough";
|
|
85
|
+
"relation.bend": "relation.bend";
|
|
85
86
|
"relation.connect": "relation.connect";
|
|
86
87
|
"relation.reconnect": "relation.reconnect";
|
|
87
88
|
"relation.remove": "relation.remove";
|
|
@@ -99,7 +100,7 @@ declare const manifest: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
99
100
|
ui: "ui";
|
|
100
101
|
}>>;
|
|
101
102
|
}, z.core.$strict>, ...z.ZodObject<{
|
|
102
|
-
apiVersion: z.ZodLiteral<
|
|
103
|
+
apiVersion: z.ZodLiteral<6>;
|
|
103
104
|
kind: z.ZodLiteral<"theme" | "vocab">;
|
|
104
105
|
entry: z.ZodString;
|
|
105
106
|
writes: z.ZodTuple<[], null>;
|
|
@@ -188,6 +189,10 @@ declare const message: z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
188
189
|
}, z.core.$strict>, z.ZodObject<{
|
|
189
190
|
kind: z.ZodLiteral<"relation.remove">;
|
|
190
191
|
id: z.ZodString;
|
|
192
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
193
|
+
kind: z.ZodLiteral<"relation.bend">;
|
|
194
|
+
id: z.ZodString;
|
|
195
|
+
value: z.ZodNumber;
|
|
191
196
|
}, z.core.$strict>, z.ZodObject<{
|
|
192
197
|
kind: z.ZodLiteral<"document.reset">;
|
|
193
198
|
id: z.ZodString;
|
package/dist/node/runtime.js
CHANGED
|
@@ -72,6 +72,7 @@ const operation = z.discriminatedUnion('kind', [
|
|
|
72
72
|
z.strictObject({ kind: z.literal('relation.type'), id, typeId: id }),
|
|
73
73
|
z.strictObject({ kind: z.literal('relation.type.create'), id, typeId: id, label: z.string() }),
|
|
74
74
|
z.strictObject({ kind: z.literal('relation.remove'), id }),
|
|
75
|
+
z.strictObject({ kind: z.literal('relation.bend'), id, value: z.number() }),
|
|
75
76
|
z.strictObject({ kind: z.literal('document.reset'), id }),
|
|
76
77
|
z.strictObject({ kind: z.literal('history.undo') }),
|
|
77
78
|
z.strictObject({ kind: z.literal('history.redo') }),
|
|
@@ -118,7 +119,7 @@ export function parsePluginI18n(value) {
|
|
|
118
119
|
checkMessageSize(value, 64 * 1024);
|
|
119
120
|
return parseOrThrow(pluginI18n, value, 'i18n.');
|
|
120
121
|
}
|
|
121
|
-
export const pluginApiVersion =
|
|
122
|
+
export const pluginApiVersion = 6;
|
|
122
123
|
const manifestFields = {
|
|
123
124
|
apiVersion: z.literal(pluginApiVersion),
|
|
124
125
|
};
|
|
@@ -146,6 +147,7 @@ const pluginWriteKinds = [
|
|
|
146
147
|
'relation.type',
|
|
147
148
|
'relation.type.create',
|
|
148
149
|
'relation.remove',
|
|
150
|
+
'relation.bend',
|
|
149
151
|
'selection.set',
|
|
150
152
|
'view.create',
|
|
151
153
|
'view.membership',
|
package/dist/package.d.ts
CHANGED
package/dist/package.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as PluginError, _ as checkMessageSize, d as sha256Hex, o as parsePluginI18n, s as parsePluginManifest, w as parseOrThrow, y as parseDefinition } from "./runtime-
|
|
1
|
+
import { C as PluginError, _ as checkMessageSize, d as sha256Hex, o as parsePluginI18n, s as parsePluginManifest, w as parseOrThrow, y as parseDefinition } from "./runtime-ZHRz4_y1.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import parseVersion from "semver/functions/parse.js";
|
|
4
4
|
import validateName from "validate-npm-package-name";
|
|
@@ -64,6 +64,17 @@ declare const relationTypeSchema: z.ZodObject<{
|
|
|
64
64
|
id: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
65
65
|
label: z.ZodString;
|
|
66
66
|
}, z.core.$strict>;
|
|
67
|
+
declare const relationSchema: z.ZodObject<{
|
|
68
|
+
source: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
69
|
+
predicate: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
70
|
+
target: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
71
|
+
}, z.core.$strict>;
|
|
72
|
+
declare const relationBendSchema: z.ZodObject<{
|
|
73
|
+
source: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
74
|
+
predicate: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
75
|
+
target: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
76
|
+
bend: z.ZodNumber;
|
|
77
|
+
}, z.core.$strict>;
|
|
67
78
|
declare const graphSchema: z.ZodObject<{
|
|
68
79
|
concepts: z.ZodArray<z.ZodObject<{
|
|
69
80
|
id: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
@@ -85,6 +96,8 @@ type Concept = z.infer<typeof conceptSchema>;
|
|
|
85
96
|
type Presentation = z.infer<typeof presentationSchema>;
|
|
86
97
|
type ViewMember = z.infer<typeof viewMemberSchema>;
|
|
87
98
|
type RelationType = z.infer<typeof relationTypeSchema>;
|
|
99
|
+
type Relation = z.infer<typeof relationSchema>;
|
|
100
|
+
type RelationBend = z.infer<typeof relationBendSchema>;
|
|
88
101
|
type Graph = z.infer<typeof graphSchema>;
|
|
89
102
|
//#endregion
|
|
90
103
|
//#region ../i18n/dist/locale.d.ts
|
|
@@ -98,8 +111,11 @@ type Selection = readonly {
|
|
|
98
111
|
readonly id: string;
|
|
99
112
|
}[];
|
|
100
113
|
type GraphSnapshot = DeepReadonly<Graph>;
|
|
101
|
-
type ViewGraphSnapshot = DeepReadonly<Omit<Graph, 'concepts'> & {
|
|
114
|
+
type ViewGraphSnapshot = DeepReadonly<Omit<Graph, 'concepts' | 'relations'> & {
|
|
102
115
|
concepts: (Concept & Partial<Presentation>)[];
|
|
116
|
+
relations: (Relation & {
|
|
117
|
+
bend?: number;
|
|
118
|
+
})[];
|
|
103
119
|
}>;
|
|
104
120
|
type NessoOperation = {
|
|
105
121
|
readonly kind: 'concept.label';
|
|
@@ -164,6 +180,10 @@ type NessoOperation = {
|
|
|
164
180
|
} | {
|
|
165
181
|
readonly kind: 'relation.remove';
|
|
166
182
|
readonly id: string;
|
|
183
|
+
} | {
|
|
184
|
+
readonly kind: 'relation.bend';
|
|
185
|
+
readonly id: string;
|
|
186
|
+
readonly value: number;
|
|
167
187
|
} | {
|
|
168
188
|
readonly kind: 'document.reset';
|
|
169
189
|
readonly id: string;
|
|
@@ -237,6 +257,7 @@ type SavedView = {
|
|
|
237
257
|
readonly id: string;
|
|
238
258
|
readonly name: string;
|
|
239
259
|
readonly members: readonly DeepReadonly<ViewMember>[];
|
|
260
|
+
readonly relationBends?: readonly DeepReadonly<RelationBend>[];
|
|
240
261
|
readonly pinned: boolean;
|
|
241
262
|
};
|
|
242
263
|
type Viewport = {
|
|
@@ -306,6 +327,7 @@ type NessoStore = {
|
|
|
306
327
|
readonly createRelationType: (id: string, label: string) => void;
|
|
307
328
|
readonly removeConcept: (id: string) => void;
|
|
308
329
|
readonly removeRelation: (id: string) => void;
|
|
330
|
+
readonly setRelationBend: (id: string, value: number, historyGroup?: string) => void;
|
|
309
331
|
readonly applyOperations: (operations: readonly NessoOperation[], options?: {
|
|
310
332
|
readonly historyGroup?: string;
|
|
311
333
|
}) => void;
|
|
@@ -586,9 +608,9 @@ type PluginI18n = DeepReadonly<{
|
|
|
586
608
|
[key: string]: LocalizedText | z.infer<typeof metadata>;
|
|
587
609
|
}>;
|
|
588
610
|
declare function parsePluginI18n(value: unknown): PluginI18n;
|
|
589
|
-
declare const pluginApiVersion =
|
|
611
|
+
declare const pluginApiVersion = 6;
|
|
590
612
|
declare const manifest: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
591
|
-
apiVersion: z.ZodLiteral<
|
|
613
|
+
apiVersion: z.ZodLiteral<6>;
|
|
592
614
|
kind: z.ZodLiteral<"actions">;
|
|
593
615
|
entry: z.ZodString;
|
|
594
616
|
writes: z.ZodArray<z.ZodEnum<{
|
|
@@ -602,6 +624,7 @@ declare const manifest: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
602
624
|
"concept.positions": "concept.positions";
|
|
603
625
|
"concept.remove": "concept.remove";
|
|
604
626
|
"concept.strikethrough": "concept.strikethrough";
|
|
627
|
+
"relation.bend": "relation.bend";
|
|
605
628
|
"relation.connect": "relation.connect";
|
|
606
629
|
"relation.reconnect": "relation.reconnect";
|
|
607
630
|
"relation.remove": "relation.remove";
|
|
@@ -619,7 +642,7 @@ declare const manifest: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
619
642
|
ui: "ui";
|
|
620
643
|
}>>;
|
|
621
644
|
}, z.core.$strict>, ...z.ZodObject<{
|
|
622
|
-
apiVersion: z.ZodLiteral<
|
|
645
|
+
apiVersion: z.ZodLiteral<6>;
|
|
623
646
|
kind: z.ZodLiteral<"theme" | "vocab">;
|
|
624
647
|
entry: z.ZodString;
|
|
625
648
|
writes: z.ZodTuple<[], null>;
|
|
@@ -708,6 +731,10 @@ declare const message: z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
708
731
|
}, z.core.$strict>, z.ZodObject<{
|
|
709
732
|
kind: z.ZodLiteral<"relation.remove">;
|
|
710
733
|
id: z.ZodString;
|
|
734
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
735
|
+
kind: z.ZodLiteral<"relation.bend">;
|
|
736
|
+
id: z.ZodString;
|
|
737
|
+
value: z.ZodNumber;
|
|
711
738
|
}, z.core.$strict>, z.ZodObject<{
|
|
712
739
|
kind: z.ZodLiteral<"document.reset">;
|
|
713
740
|
id: z.ZodString;
|
|
@@ -67,10 +67,12 @@ const relationSchema = z.strictObject({
|
|
|
67
67
|
predicate: iriSchema,
|
|
68
68
|
target: iriSchema
|
|
69
69
|
});
|
|
70
|
+
const relationBendSchema = relationSchema.extend({ bend: z.number().refine((value) => value !== 0, "Manual bend must be nonzero") }).refine((relation) => relation.source !== relation.target, "Self-relations cannot be bent");
|
|
70
71
|
const viewSchema = z.strictObject({
|
|
71
72
|
id: iriSchema,
|
|
72
73
|
name: z.string(),
|
|
73
|
-
members: z.array(viewMemberSchema)
|
|
74
|
+
members: z.array(viewMemberSchema),
|
|
75
|
+
relationBends: z.array(relationBendSchema).optional()
|
|
74
76
|
});
|
|
75
77
|
const graphShape = {
|
|
76
78
|
concepts: z.array(conceptSchema),
|
|
@@ -132,10 +134,12 @@ const checkReferences = (graph, context) => {
|
|
|
132
134
|
const graphSchema = z.strictObject(graphShape).superRefine(checkReferences);
|
|
133
135
|
const viewGraphSchema = z.strictObject({
|
|
134
136
|
...graphShape,
|
|
135
|
-
concepts: z.array(conceptSchema.extend(presentationSchema.partial().shape))
|
|
137
|
+
concepts: z.array(conceptSchema.extend(presentationSchema.partial().shape)),
|
|
138
|
+
relations: z.array(relationSchema.extend({ bend: z.number().optional() }))
|
|
136
139
|
}).superRefine(checkReferences);
|
|
137
140
|
const viewsSchema = (graph) => z.array(viewSchema).superRefine((views, context) => {
|
|
138
141
|
const concepts = new Set(graph.concepts.map(({ id }) => id));
|
|
142
|
+
const relations = new Set(graph.relations.map(relationKey));
|
|
139
143
|
const taken = /* @__PURE__ */ new Set([...concepts, ...graph.relationTypes.map(({ id }) => id)]);
|
|
140
144
|
for (const [index, view] of views.entries()) {
|
|
141
145
|
if (taken.has(view.id)) context.addIssue({
|
|
@@ -158,6 +162,20 @@ const viewsSchema = (graph) => z.array(viewSchema).superRefine((views, context)
|
|
|
158
162
|
});
|
|
159
163
|
members.add(member.id);
|
|
160
164
|
}
|
|
165
|
+
const bends = /* @__PURE__ */ new Set();
|
|
166
|
+
for (const [position, relation] of (view.relationBends ?? []).entries()) {
|
|
167
|
+
const key = relationKey(relation);
|
|
168
|
+
if (bends.has(key) || !relations.has(key) || !members.has(relation.source) || !members.has(relation.target)) context.addIssue({
|
|
169
|
+
code: "custom",
|
|
170
|
+
path: [
|
|
171
|
+
index,
|
|
172
|
+
"relationBends",
|
|
173
|
+
position
|
|
174
|
+
],
|
|
175
|
+
message: "Duplicate or invalid relation bend"
|
|
176
|
+
});
|
|
177
|
+
bends.add(key);
|
|
178
|
+
}
|
|
161
179
|
}
|
|
162
180
|
});
|
|
163
181
|
//#endregion
|
|
@@ -182,7 +200,7 @@ function validateGraph(graph, views = []) {
|
|
|
182
200
|
//#region ../schema/dist/jsonld.js
|
|
183
201
|
const jsonObject = z.record(z.string(), z.unknown());
|
|
184
202
|
z.strictObject({
|
|
185
|
-
schemaVersion: z.literal(
|
|
203
|
+
schemaVersion: z.literal(3),
|
|
186
204
|
"@context": jsonObject,
|
|
187
205
|
"@graph": z.array(jsonObject)
|
|
188
206
|
});
|
|
@@ -200,7 +218,8 @@ z.strictObject({
|
|
|
200
218
|
"@id": iriSchema,
|
|
201
219
|
"@type": z.literal("View"),
|
|
202
220
|
"rdfs:label": z.string(),
|
|
203
|
-
members: z.array(presentationSchema.extend({ concept: z.strictObject({ "@id": iriSchema }) }))
|
|
221
|
+
members: z.array(presentationSchema.extend({ concept: z.strictObject({ "@id": iriSchema }) })),
|
|
222
|
+
relationBends: z.array(relationBendSchema).optional()
|
|
204
223
|
});
|
|
205
224
|
//#endregion
|
|
206
225
|
//#region ../core/dist/commands.js
|
|
@@ -293,6 +312,11 @@ function createWriteCommands(applyOperations, created) {
|
|
|
293
312
|
kind: "relation.remove",
|
|
294
313
|
id
|
|
295
314
|
}]),
|
|
315
|
+
setRelationBend: (id, value, historyGroup) => applyOperations([{
|
|
316
|
+
kind: "relation.bend",
|
|
317
|
+
id,
|
|
318
|
+
value
|
|
319
|
+
}], historyGroup ? { historyGroup } : void 0),
|
|
296
320
|
setActiveVocab: (id) => applyOperations([{
|
|
297
321
|
kind: "preferences.vocab",
|
|
298
322
|
id
|
|
@@ -800,6 +824,11 @@ const operation = z.discriminatedUnion("kind", [
|
|
|
800
824
|
kind: z.literal("relation.remove"),
|
|
801
825
|
id
|
|
802
826
|
}),
|
|
827
|
+
z.strictObject({
|
|
828
|
+
kind: z.literal("relation.bend"),
|
|
829
|
+
id,
|
|
830
|
+
value: z.number()
|
|
831
|
+
}),
|
|
803
832
|
z.strictObject({
|
|
804
833
|
kind: z.literal("document.reset"),
|
|
805
834
|
id
|
|
@@ -880,8 +909,8 @@ function parsePluginI18n(value) {
|
|
|
880
909
|
checkMessageSize(value, 65536);
|
|
881
910
|
return parseOrThrow(pluginI18n, value, "i18n.");
|
|
882
911
|
}
|
|
883
|
-
const pluginApiVersion =
|
|
884
|
-
const manifestFields = { apiVersion: z.literal(
|
|
912
|
+
const pluginApiVersion = 6;
|
|
913
|
+
const manifestFields = { apiVersion: z.literal(6) };
|
|
885
914
|
const jsEntry = z.string().max(240).regex(/^(?:[\w-]+\/)*[\w-]+\.js$/);
|
|
886
915
|
const jsonEntry = z.string().max(240).regex(/^(?:[\w-]+\/)*[\w-]+\.json$/);
|
|
887
916
|
const operationDeclarations = z.array(z.enum([
|
|
@@ -900,6 +929,7 @@ const operationDeclarations = z.array(z.enum([
|
|
|
900
929
|
"relation.type",
|
|
901
930
|
"relation.type.create",
|
|
902
931
|
"relation.remove",
|
|
932
|
+
"relation.bend",
|
|
903
933
|
"selection.set",
|
|
904
934
|
"view.create",
|
|
905
935
|
"view.membership"
|
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-BrbkQ4Oi.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-ZHRz4_y1.js";
|
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.24",
|
|
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.24",
|
|
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.24",
|
|
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": 6,
|
|
58
58
|
"kind": "actions",
|
|
59
59
|
"entry": "dist/index.js",
|
|
60
60
|
"writes": [
|