@3plate/graph-vue 0.1.12 → 0.1.14

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.cjs CHANGED
@@ -213,3 +213,4 @@ function shallowEqualSource(a, b) {
213
213
  Graph,
214
214
  Playground
215
215
  });
216
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/Graph.ts","../src/Playground.ts"],"sourcesContent":["/**\n * @3plate/graph-vue - Vue components for @3plate/graph graph visualization\n */\n\n// Components\nexport { Graph } from './Graph'\nexport { Playground } from './Playground'\n\n// Types\nexport type { GraphProps } from './Graph'\nexport type { PlaygroundProps } from './Playground'\n\n// Re-export types from core for convenience\nexport type {\n // API types\n API,\n APIArguments,\n APIOptions,\n Update,\n IngestionConfig,\n EventsOptions,\n // Callback parameter types\n NewNode,\n NewEdge,\n NodeProps,\n EdgeProps,\n PortProps,\n RenderNode,\n // Ingestion types\n IngestMessage,\n SnapshotMessage,\n UpdateMessage,\n HistoryMessage,\n // WebSocket types\n WebSocketStatus,\n WebSocketStatusListener,\n // Theming types\n ColorMode,\n ThemeVars,\n CanvasTheme,\n NodeTheme,\n PortTheme,\n EdgeTheme,\n // Common types\n Orientation,\n NodeAlign,\n PortStyle,\n} from '@3plate/graph-core'\n","/**\n * Vue Graph component for @3plate/graph\n */\n\nimport { defineComponent, ref, onMounted, onUnmounted, watch, h, type PropType } from 'vue'\nimport { graph, type API } from '@3plate/graph-core'\nimport type { APIArguments, Update, IngestionConfig } from '@3plate/graph-core'\n\nexport type GraphProps<N, E> = {\n /** Initial nodes */\n nodes?: N[]\n /** Initial edges */\n edges?: E[]\n /** Initial history */\n history?: Update<N, E>[]\n /** Ingestion source configuration (alternative to nodes/edges/history) */\n ingestion?: IngestionConfig\n /** Options */\n options?: APIArguments<N, E>['options']\n /** Events */\n events?: APIArguments<N, E>['events']\n}\n\n/**\n * Graph component - renders a graph visualization\n * Intelligently handles prop changes by diffing nodes, edges, and history\n */\nexport const Graph = defineComponent({\n name: 'Graph',\n props: {\n /** Initial nodes */\n nodes: {\n type: Array as PropType<any[]>,\n default: undefined,\n },\n /** Initial edges */\n edges: {\n type: Array as PropType<any[]>,\n default: undefined,\n },\n /** Initial history */\n history: {\n type: Array as PropType<Update<any, any>[]>,\n default: undefined,\n },\n /** Ingestion source configuration */\n ingestion: {\n type: Object as PropType<IngestionConfig>,\n default: undefined,\n },\n /** Options */\n options: {\n type: Object as PropType<APIArguments<any, any>['options']>,\n default: undefined,\n },\n /** Events */\n events: {\n type: Object as PropType<APIArguments<any, any>['events']>,\n default: undefined,\n },\n },\n setup(props) {\n const rootRef = ref<HTMLDivElement | null>(null)\n const apiRef = ref<API<any, any> | null>(null)\n const rootId = `graph-${Math.random().toString(36).slice(2, 11)}`\n\n // Initialize API on mount\n onMounted(async () => {\n if (!rootRef.value) return\n\n rootRef.value.id = rootId\n\n const api = await graph({\n root: rootId,\n nodes: props.nodes,\n edges: props.edges,\n history: props.history,\n ingestion: props.ingestion,\n options: props.options,\n events: props.events,\n })\n\n apiRef.value = api\n })\n\n // Cleanup on unmount\n onUnmounted(() => {\n if (apiRef.value) {\n apiRef.value.destroy()\n apiRef.value = null\n }\n if (rootRef.value) {\n const canvas = rootRef.value.querySelector('canvas, svg')\n if (canvas) {\n canvas.remove()\n }\n }\n })\n\n // Watch for prop changes using the centralized applyProps method\n watch(\n () => [props.nodes, props.edges, props.history, props.options],\n () => {\n if (!apiRef.value) return\n apiRef.value.applyProps({ nodes: props.nodes, edges: props.edges, history: props.history, options: props.options })\n },\n { deep: true }\n )\n\n return () =>\n h('div', {\n ref: rootRef,\n style: { width: '100%', height: '100%' },\n })\n },\n})\n","/**\n * Vue Playground component for @3plate/graph\n */\n\nimport { defineComponent, ref, onMounted, onUnmounted, watch, h, type PropType } from 'vue'\nimport { Playground as PlaygroundClass, type PlaygroundOptions, type Example } from '@3plate/graph-core'\n\nexport type PlaygroundProps = {\n /** Examples to display */\n examples: PlaygroundOptions['examples']\n /** Default example key */\n defaultExample?: string\n}\n\n/**\n * Playground component - renders the interactive playground with examples\n */\nexport const Playground = defineComponent({\n name: 'Playground',\n props: {\n /** Examples to display */\n examples: {\n type: Object as PropType<PlaygroundOptions['examples']>,\n required: true,\n },\n /** Default example key */\n defaultExample: {\n type: String,\n default: undefined,\n },\n },\n setup(props) {\n const rootRef = ref<HTMLDivElement | null>(null)\n const playgroundRef = ref<PlaygroundClass | null>(null)\n const rootId = `playground-${Math.random().toString(36).slice(2, 11)}`\n const prevExamples = ref<Record<string, Example>>({})\n\n // Initialize playground on mount\n onMounted(async () => {\n if (!rootRef.value) return\n\n rootRef.value.id = rootId\n\n const playground = new PlaygroundClass({\n root: rootId,\n examples: props.examples,\n defaultExample: props.defaultExample,\n })\n playgroundRef.value = playground\n prevExamples.value = { ...props.examples }\n await playground.init()\n })\n\n // Cleanup on unmount\n onUnmounted(() => {\n playgroundRef.value = null\n })\n\n // Watch for examples changes\n watch(\n () => props.examples,\n (current) => {\n if (!playgroundRef.value) return\n\n const playground = playgroundRef.value\n const prev = prevExamples.value\n\n // Get all keys from both previous and current\n const allKeys = new Set([...Object.keys(prev), ...Object.keys(current)])\n\n for (const key of allKeys) {\n const prevExample = prev[key]\n const currentExample = current[key]\n\n if (!prevExample && currentExample) {\n // Example was added\n playground.addExample(key, currentExample)\n } else if (prevExample && !currentExample) {\n // Example was removed\n playground.removeExample(key)\n } else if (prevExample && currentExample && !shallowEqualExample(prevExample, currentExample)) {\n // Example was modified\n playground.addExample(key, currentExample)\n }\n }\n\n prevExamples.value = { ...current }\n },\n { deep: true }\n )\n\n return () =>\n h('div', {\n ref: rootRef,\n style: { width: '100%', height: '100%' },\n })\n },\n})\n\n/**\n * Shallow comparison of two Example objects\n */\nfunction shallowEqualExample(a: Example, b: Example): boolean {\n if (a === b) return true\n if (a.name !== b.name) return false\n if (a.description !== b.description) return false\n if (!shallowEqualArray(a.nodes, b.nodes)) return false\n if (!shallowEqualArray(a.edges, b.edges)) return false\n if (!shallowEqualOptions(a.options, b.options)) return false\n if (!shallowEqualSource(a.source, b.source)) return false\n return true\n}\n\n/**\n * Shallow comparison of arrays\n */\nfunction shallowEqualArray<T>(a: T[] | undefined, b: T[] | undefined): boolean {\n if (a === b) return true\n if (!a || !b) return false\n if (a.length !== b.length) return false\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) return false\n }\n return true\n}\n\n/**\n * Shallow comparison of ExampleOptions\n */\nfunction shallowEqualOptions(\n a: Example['options'],\n b: Example['options']\n): boolean {\n if (a === b) return true\n if (!a || !b) return false\n return a === b\n}\n\n/**\n * Shallow comparison of ExampleSource\n */\nfunction shallowEqualSource(\n a: Example['source'],\n b: Example['source']\n): boolean {\n if (a === b) return true\n if (!a || !b) return false\n if (a.type !== b.type) return false\n if (a.type === 'file' && b.type === 'file') {\n return a.path === b.path\n }\n if (a.type === 'websocket' && b.type === 'websocket') {\n return a.url === b.url\n }\n return false\n}\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACIA,iBAAsF;AACtF,wBAAgC;AAsBzB,IAAM,YAAQ,4BAAgB;AAAA,EACnC,MAAM;AAAA,EACN,OAAO;AAAA;AAAA,IAEL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA;AAAA,IAEA,OAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA;AAAA,IAEA,SAAS;AAAA,MACP,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA;AAAA,IAEA,WAAW;AAAA,MACT,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA;AAAA,IAEA,SAAS;AAAA,MACP,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA;AAAA,IAEA,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EACA,MAAM,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AC,KAAK,CAAC,EAAG,QAAO;AACrB,MAAI,EAAE,SAAS,EAAE,KAAM,QAAO;AAC9B,MAAI,EAAE,SAAS,UAAU,EAAE,SAAS,QAAQ;AAC1C,WAAO,EAAE,SAAS,EAAE;AAAA,EACtB;AACA,MAAI,EAAE,SAAS,eAAe,EAAE,SAAS,aAAa;AACpD,WAAO,EAAE,QAAQ,EAAE;AAAA,EACrB;AACA,SAAO;AACT;","names":["import_vue","import_graph_core","PlaygroundClass"]}
package/dist/index.js CHANGED
@@ -185,3 +185,4 @@ export {
185
185
  Graph,
186
186
  Playground
187
187
  };
188
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/Graph.ts","../src/Playground.ts"],"sourcesContent":["/**\n * Vue Graph component for @3plate/graph\n */\n\nimport { defineComponent, ref, onMounted, onUnmounted, watch, h, type PropType } from 'vue'\nimport { graph, type API } from '@3plate/graph-core'\nimport type { APIArguments, Update, IngestionConfig } from '@3plate/graph-core'\n\nexport type GraphProps<N, E> = {\n /** Initial nodes */\n nodes?: N[]\n /** Initial edges */\n edges?: E[]\n /** Initial history */\n history?: Update<N, E>[]\n /** Ingestion source configuration (alternative to nodes/edges/history) */\n ingestion?: IngestionConfig\n /** Options */\n options?: APIArguments<N, E>['options']\n /** Events */\n events?: APIArguments<N, E>['events']\n}\n\n/**\n * Graph component - renders a graph visualization\n * Intelligently handles prop changes by diffing nodes, edges, and history\n */\nexport const Graph = defineComponent({\n name: 'Graph',\n props: {\n /** Initial nodes */\n nodes: {\n type: Array as PropType<any[]>,\n default: undefined,\n },\n /** Initial edges */\n edges: {\n type: Array as PropType<any[]>,\n default: undefined,\n },\n /** Initial history */\n history: {\n type: Array as PropType<Update<any, any>[]>,\n default: undefined,\n },\n /** Ingestion source configuration */\n ingestion: {\n type: Object as PropType<IngestionConfig>,\n default: undefined,\n },\n /** Options */\n options: {\n type: Object as PropType<APIArguments<any, any>['options']>,\n default: undefined,\n },\n /** Events */\n events: {\n type: Object as PropType<APIArguments<any, any>['events']>,\n default: undefined,\n },\n },\n setup(props) {\n const rootRef = ref<HTMLDivElement | null>(null)\n const apiRef = ref<API<any, any> | null>(null)\n const rootId = `graph-${Math.random().toString(36).slice(2, 11)}`\n\n // Initialize API on mount\n onMounted(async () => {\n if (!rootRef.value) return\n\n rootRef.value.id = rootId\n\n const api = await graph({\n root: rootId,\n nodes: props.nodes,\n edges: props.edges,\n history: props.history,\n ingestion: props.ingestion,\n options: props.options,\n events: props.events,\n })\n\n apiRef.value = api\n })\n\n // Cleanup on unmount\n onUnmounted(() => {\n if (apiRef.value) {\n apiRef.value.destroy()\n apiRef.value = null\n }\n if (rootRef.value) {\n const canvas = rootRef.value.querySelector('canvas, svg')\n if (canvas) {\n canvas.remove()\n }\n }\n })\n\n // Watch for prop changes using the centralized applyProps method\n watch(\n () => [props.nodes, props.edges, props.history, props.options],\n () => {\n if (!apiRef.value) return\n apiRef.value.applyProps({ nodes: props.nodes, edges: props.edges, history: props.history, options: props.options })\n },\n { deep: true }\n )\n\n return () =>\n h('div', {\n ref: rootRef,\n style: { width: '100%', height: '100%' },\n })\n },\n})\n","/**\n * Vue Playground component for @3plate/graph\n */\n\nimport { defineComponent, ref, onMounted, onUnmounted, watch, h, type PropType } from 'vue'\nimport { Playground as PlaygroundClass, type PlaygroundOptions, type Example } from '@3plate/graph-core'\n\nexport type PlaygroundProps = {\n /** Examples to display */\n examples: PlaygroundOptions['examples']\n /** Default example key */\n defaultExample?: string\n}\n\n/**\n * Playground component - renders the interactive playground with examples\n */\nexport const Playground = defineComponent({\n name: 'Playground',\n props: {\n /** Examples to display */\n examples: {\n type: Object as PropType<PlaygroundOptions['examples']>,\n required: true,\n },\n /** Default example key */\n defaultExample: {\n type: String,\n default: undefined,\n },\n },\n setup(props) {\n const rootRef = ref<HTMLDivElement | null>(null)\n const playgroundRef = ref<PlaygroundClass | null>(null)\n const rootId = `playground-${Math.random().toString(36).slice(2, 11)}`\n const prevExamples = ref<Record<string, Example>>({})\n\n // Initialize playground on mount\n onMounted(async () => {\n if (!rootRef.value) return\n\n rootRef.value.id = rootId\n\n const playground = new PlaygroundClass({\n root: rootId,\n examples: props.examples,\n defaultExample: props.defaultExample,\n })\n playgroundRef.value = playground\n prevExamples.value = { ...props.examples }\n await playground.init()\n })\n\n // Cleanup on unmount\n onUnmounted(() => {\n playgroundRef.value = null\n })\n\n // Watch for examples changes\n watch(\n () => props.examples,\n (current) => {\n if (!playgroundRef.value) return\n\n const playground = playgroundRef.value\n const prev = prevExamples.value\n\n // Get all keys from both previous and current\n const allKeys = new Set([...Object.keys(prev), ...Object.keys(current)])\n\n for (const key of allKeys) {\n const prevExample = prev[key]\n const currentExample = current[key]\n\n if (!prevExample && currentExample) {\n // Example was added\n playground.addExample(key, currentExample)\n } else if (prevExample && !currentExample) {\n // Example was removed\n playground.removeExample(key)\n } else if (prevExample && currentExample && !shallowEqualExample(prevExample, currentExample)) {\n // Example was modified\n playground.addExample(key, currentExample)\n }\n }\n\n prevExamples.value = { ...current }\n },\n { deep: true }\n )\n\n return () =>\n h('div', {\n ref: rootRef,\n style: { width: '100%', height: '100%' },\n })\n },\n})\n\n/**\n * Shallow comparison of two Example objects\n */\nfunction shallowEqualExample(a: Example, b: Example): boolean {\n if (a === b) return true\n if (a.name !== b.name) return false\n if (a.description !== b.description) return false\n if (!shallowEqualArray(a.nodes, b.nodes)) return false\n if (!shallowEqualArray(a.edges, b.edges)) return false\n if (!shallowEqualOptions(a.options, b.options)) return false\n if (!shallowEqualSource(a.source, b.source)) return false\n return true\n}\n\n/**\n * Shallow comparison of arrays\n */\nfunction shallowEqualArray<T>(a: T[] | undefined, b: T[] | undefined): boolean {\n if (a === b) return true\n if (!a || !b) return false\n if (a.length !== b.length) return false\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) return false\n }\n return true\n}\n\n/**\n * Shallow comparison of ExampleOptions\n */\nfunction shallowEqualOptions(\n a: Example['options'],\n b: Example['options']\n): boolean {\n if (a === b) return true\n if (!a || !b) return false\n return a === b\n}\n\n/**\n * Shallow comparison of ExampleSource\n */\nfunction shallowEqualSource(\n a: Example['source'],\n b: Example['source']\n): boolean {\n if (a === b) return true\n if (!a || !b) return false\n if (a.type !== b.type) return false\n if (a.type === 'file' && b.type === 'file') {\n return a.path === b.path\n }\n if (a.type === 'websocket' && b.type === 'websocket') {\n return a.url === b.url\n }\n return false\n}\n\n"],"mappings":";AAIA,SAAS,iBAAiB,KAAK,WAAW,aAAa,OAAO,SAAwB;AACtF,SAAS,aAAuB;AAsBzB,IAAM,QAAQ,gBAAgB;AAAA,EACnC,MAAM;AAAA,EACN,OAAO;AAAA;AAAA,IAEL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA;AAAA,IAEA,OAAO;AAAA,MACL,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA;AAAA,IAEA,SAAS;AAAA,MACP,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA;AAAA,IAEA,WAAW;AAAA,MACT,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA;AAAA,IAEA,SAAS;AAAA,MACP,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA;AAAA,IAEA,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EACA,MAAM,OAAO;AACX,UAAM,UAAU,IAA2B,IAAI;AAC/C,UAAM,SAAS,IAA0B,IAAI;AAC7C,UAAM,SAAS,SAAS,KAAK,OAAO,EAAE,SAAS,EAAE,EAAE,MAAM,GAAG,EAAE,CAAC;AAG/D,cAAU,YAAY;AACpB,UAAI,CAAC,QAAQ,MAAO;AAEpB,cAAQ,MAAM,KAAK;AAEnB,YAAM,MAAM,MAAM,MAAM;AAAA,QACtB,MAAM;AAAA,QACN,OAAO,MAAM;AAAA,QACb,OAAO,MAAM;AAAA,QACb,SAAS,MAAM;AAAA,QACf,WAAW,MAAM;AAAA,QACjB,SA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","watch","h"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@3plate/graph-vue",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
4
4
  "type": "module",
5
5
  "license": "GPL-3.0",
6
6
  "repository": {
@@ -28,7 +28,7 @@
28
28
  "vue": "^3.3.0"
29
29
  },
30
30
  "dependencies": {
31
- "@3plate/graph-core": "0.1.12"
31
+ "@3plate/graph-core": "0.1.14"
32
32
  },
33
33
  "devDependencies": {
34
34
  "tsup": "^8.5.1",
@@ -36,7 +36,7 @@
36
36
  "vue": "^3.5.25"
37
37
  },
38
38
  "scripts": {
39
- "build": "tsup src/index.ts --format cjs,esm --dts --external vue",
40
- "dev": "tsup src/index.ts --format cjs,esm --dts --watch --external vue"
39
+ "build": "tsup src/index.ts --format cjs,esm --dts --sourcemap --external vue",
40
+ "dev": "tsup src/index.ts --format cjs,esm --dts --sourcemap --watch --external vue"
41
41
  }
42
42
  }