@nodish/core 0.1.4 → 0.2.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.
Files changed (57) hide show
  1. package/dist/index.d.ts +519 -0
  2. package/dist/{vue.js → index.js} +1 -1
  3. package/package.json +7 -11
  4. package/dist/pack.d.ts +0 -326
  5. package/dist/pack.js +0 -43
  6. package/dist/src/components/AddNodePanel.vue.d.ts +0 -20
  7. package/dist/src/components/GraphInterfacePanel.vue.d.ts +0 -13
  8. package/dist/src/components/GraphNode.vue.d.ts +0 -26
  9. package/dist/src/components/GroupPanel.vue.d.ts +0 -13
  10. package/dist/src/components/InspectorPanel.vue.d.ts +0 -43
  11. package/dist/src/components/NodePanel.vue.d.ts +0 -18
  12. package/dist/src/components/NodePort.vue.d.ts +0 -21
  13. package/dist/src/components/NodeViewer.vue.d.ts +0 -14
  14. package/dist/src/components/WireLayer.vue.d.ts +0 -8
  15. package/dist/src/components/inspector/InspectorCheckboxField.vue.d.ts +0 -10
  16. package/dist/src/components/inspector/InspectorColorField.vue.d.ts +0 -12
  17. package/dist/src/components/inspector/InspectorError.vue.d.ts +0 -5
  18. package/dist/src/components/inspector/InspectorPositionField.vue.d.ts +0 -12
  19. package/dist/src/components/inspector/InspectorSection.vue.d.ts +0 -24
  20. package/dist/src/components/inspector/InspectorWidthField.vue.d.ts +0 -12
  21. package/dist/src/components/layout.d.ts +0 -26
  22. package/dist/src/components/types/NumberWidget.vue.d.ts +0 -15
  23. package/dist/src/components/types/PortValueWidget.vue.d.ts +0 -17
  24. package/dist/src/components/types/ReadonlyWidget.vue.d.ts +0 -9
  25. package/dist/src/components/types/TextWidget.vue.d.ts +0 -15
  26. package/dist/src/components/types/registerDefaultTypeWidgets.d.ts +0 -6
  27. package/dist/src/components/types/registry.d.ts +0 -13
  28. package/dist/src/pack/index.d.ts +0 -5
  29. package/dist/src/store/composite/editContext.d.ts +0 -14
  30. package/dist/src/store/composite/guards.d.ts +0 -7
  31. package/dist/src/store/composite/index.d.ts +0 -12
  32. package/dist/src/store/graph/connect.d.ts +0 -8
  33. package/dist/src/store/graph/createNodeMap.d.ts +0 -20
  34. package/dist/src/store/graph/document.d.ts +0 -25
  35. package/dist/src/store/graph/dynamicPorts.d.ts +0 -9
  36. package/dist/src/store/graph/evaluate.d.ts +0 -18
  37. package/dist/src/store/graph/expandIO.d.ts +0 -2
  38. package/dist/src/store/graph/instance.d.ts +0 -7
  39. package/dist/src/store/graph/pruneConnections.d.ts +0 -2
  40. package/dist/src/store/graph/removeNode.d.ts +0 -3
  41. package/dist/src/store/graph/stacking.d.ts +0 -5
  42. package/dist/src/store/graph/validateGraphTypes.d.ts +0 -2
  43. package/dist/src/store/interface/editor.d.ts +0 -5
  44. package/dist/src/store/interface/graphInterface.d.ts +0 -20
  45. package/dist/src/store/model.d.ts +0 -241
  46. package/dist/src/store/nodes/io.d.ts +0 -46
  47. package/dist/src/store/packs/installPack.d.ts +0 -4
  48. package/dist/src/store/registry/defineNode.d.ts +0 -50
  49. package/dist/src/store/registry/defineType.d.ts +0 -31
  50. package/dist/src/store/registry/groups.d.ts +0 -9
  51. package/dist/src/store/registry/index.d.ts +0 -39
  52. package/dist/src/store/types/effectiveWidget.d.ts +0 -4
  53. package/dist/src/store/utils/clonePlain.d.ts +0 -1
  54. package/dist/src/vue/attachLoadPack.d.ts +0 -2
  55. package/dist/src/vue/createNodeMap.d.ts +0 -11
  56. package/dist/src/vue/index.d.ts +0 -10
  57. /package/dist/{vue.css → index.css} +0 -0
@@ -1,31 +0,0 @@
1
- import { PortTypeDefinition, PortTypeId, TypeWidgetSpec } from '../model';
2
- /**
3
- * Authoring format for a data type. {@link defineType} expands this into a full
4
- * {@link PortTypeDefinition} (default label, color, and widget lifecycle hooks).
5
- */
6
- export interface TypeSpec {
7
- /** Unique type id (e.g. `"number"`, `"my-pack/label"`). */
8
- id: PortTypeId;
9
- label?: string;
10
- color?: string;
11
- validate: (value: unknown) => boolean;
12
- /**
13
- * Whether an output of type `from` may connect into ports of this type.
14
- * Omitted means strict identity.
15
- */
16
- accepts?: (from: PortTypeId) => boolean;
17
- /** Fallback when a port of this type omits its own default. */
18
- defaultValue?: unknown;
19
- /** Viewer widget descriptor for ports of this type. */
20
- widget?: TypeWidgetSpec;
21
- /** Override default parse behaviour for this type's widget. */
22
- parse?: (raw: string) => unknown;
23
- /** Override default format behaviour for this type's widget. */
24
- format?: (value: unknown) => string;
25
- /** Override default coerce behaviour for this type's widget. */
26
- coerce?: (value: unknown) => unknown;
27
- }
28
- /**
29
- * Turn a {@link TypeSpec} into a complete {@link PortTypeDefinition}.
30
- */
31
- export declare function defineType(spec: TypeSpec): PortTypeDefinition;
@@ -1,9 +0,0 @@
1
- import { IndefiniteNode, NodeRegistry } from '../model';
2
- export interface NodeGroup {
3
- name: string;
4
- path: string[];
5
- subgroups: NodeGroup[];
6
- nodes: IndefiniteNode[];
7
- }
8
- export declare function buildNodeGroupTree(registry: NodeRegistry, filter?: (node: IndefiniteNode) => boolean): NodeGroup;
9
- export declare function sortNodeGroupTree(group: NodeGroup): NodeGroup;
@@ -1,39 +0,0 @@
1
- import { Component } from 'vue';
2
- import { NodeMap, TypeRegistry } from '../model';
3
- import { NodeSpecRegistry } from './defineNode';
4
- /**
5
- * A publishable bundle of custom types and/or node types (npm package contents).
6
- * Load onto a {@link NodeMap} with {@link NodeMap.loadPack}.
7
- */
8
- export interface NodePack {
9
- /** Unique pack id (e.g. `"@my-org/my-pack"`). Recorded in {@link GraphDocument.extensions}. */
10
- id: string;
11
- /** Custom {@link PortTypeDefinition}s to register. */
12
- types?: TypeRegistry;
13
- /** Custom node definitions to register (authoring form). */
14
- nodeTypes?: NodeSpecRegistry;
15
- /**
16
- * Optional hook to register Vue widgets after types and nodes are merged.
17
- * Runs once per pack load.
18
- */
19
- setup?: (ctx: PackSetupContext) => void;
20
- }
21
- /** Context passed to {@link NodePack.setup} for widget registration. */
22
- export interface PackSetupContext {
23
- /**
24
- * Bind a Vue component to all editable ports of a type id.
25
- * Overrides the generic widget for that type.
26
- */
27
- registerTypeWidget: (typeId: string, component: Component) => void;
28
- /**
29
- * Bind a Vue component to a custom widget id
30
- * ({@link TypeWidgetSpec} `kind: "custom"`).
31
- */
32
- registerComponentWidget: (componentId: string, component: Component) => void;
33
- }
34
- export declare function registerTypes(map: NodeMap, types: TypeRegistry): void;
35
- /** Merge node specs into the runtime registry, expanding ports and defaults. */
36
- export declare function registerNodeTypes(map: NodeMap, nodeTypes: NodeSpecRegistry): void;
37
- export declare function registerNodePack(map: NodeMap, pack: NodePack): void;
38
- export declare function unregisterNodePack(map: NodeMap, packId: string): void;
39
- export type { NodeSpecRegistry } from './defineNode';
@@ -1,4 +0,0 @@
1
- import { Port, PortTypeDefinition, TypeWidgetSpec } from '../model';
2
- export declare function effectiveWidget(typeDef: PortTypeDefinition | undefined, port: Port): TypeWidgetSpec | undefined;
3
- /** Height in px implied by a widget spec (before port.customProps.rowHeight override). */
4
- export declare function widgetRowHeight(widget: TypeWidgetSpec | undefined, defaultRowH: number): number;
@@ -1 +0,0 @@
1
- export declare function clonePlain<T>(value: T): T;
@@ -1,2 +0,0 @@
1
- import { NodeMap } from '../store/model';
2
- export declare function attachLoadPack(map: NodeMap): void;
@@ -1,11 +0,0 @@
1
- import { CreateNodeMapInit } from '../store/graph/createNodeMap';
2
- import { GraphDocument } from '../store/model';
3
- export type { CreateNodeMapInit, GraphDocument };
4
- /**
5
- * Create an in-memory graph workspace with registries, boundary nodes, and
6
- * {@link NodeMap.loadPack} wired for widget setup.
7
- *
8
- * Registers built-in `number`/`string` widgets on first call (for packs that
9
- * use those conventional type ids).
10
- */
11
- export declare function createNodeMap(init?: CreateNodeMapInit): import('.').NodeMap;
@@ -1,10 +0,0 @@
1
- export { default as NodeViewer } from '../components/NodeViewer.vue';
2
- export { createNodeMap } from './createNodeMap';
3
- export type { CreateNodeMapInit } from './createNodeMap';
4
- export { applyDocument, exportGraph, importGraph, parseGraphDocument, serializeDocument, validateDocument, } from '../store/graph/document';
5
- export { runGraph, type GraphRunResult, type Values, } from '../store/graph/evaluate';
6
- export { instantiate } from '../store/graph/instance';
7
- export { boundaryNodes, INPUT_TYPE, OUTPUT_TYPE } from '../store/nodes/io';
8
- export { registerComponentWidget, registerDefaultTypeWidgets, registerTypeWidget, } from '../components/types/registerDefaultTypeWidgets';
9
- export type { Connection, ConnectionId, DefiniteNode, GraphDocument, GraphInterface, IndefiniteNode, NodeGraph, NodeId, NodeMap, NodeRegistry, Port, PortRef, PortTypeDefinition, PortTypeId, TypeRegistry, } from '../store/model';
10
- export * from '../pack/index';
File without changes