@braincrew-lab/langchain-canvas 0.6.0 → 0.6.2

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.
@@ -1,5 +1,5 @@
1
- import { useArtifactPatch } from './chunk-H74O2AEA.js';
2
- import './chunk-AHDFQGCX.js';
1
+ import { useArtifactPatch } from './chunk-N5JW2BKI.js';
2
+ import './chunk-RAPTQ6VH.js';
3
3
  import { useState, useRef, useMemo, useEffect } from 'react';
4
4
  import * as echarts from 'echarts/core';
5
5
  import { BarChart, LineChart, PieChart } from 'echarts/charts';
@@ -1,7 +1,7 @@
1
- import { useAssetUrl } from './chunk-W4W5Q7HF.js';
1
+ import { useAssetUrl } from './chunk-HCF2DXCR.js';
2
2
  import './chunk-7T5DRR3F.js';
3
- import { useArtifactPatch } from './chunk-H74O2AEA.js';
4
- import './chunk-AHDFQGCX.js';
3
+ import { useArtifactPatch } from './chunk-N5JW2BKI.js';
4
+ import './chunk-RAPTQ6VH.js';
5
5
  import { useState, useRef } from 'react';
6
6
  import ReactMarkdown, { defaultUrlTransform } from 'react-markdown';
7
7
  import remarkGfm from 'remark-gfm';
@@ -1,5 +1,5 @@
1
1
  import { isAssetReference, resolveAssetUrl } from './chunk-7T5DRR3F.js';
2
- import { useCanvasStore } from './chunk-AHDFQGCX.js';
2
+ import { useCanvasStore } from './chunk-RAPTQ6VH.js';
3
3
  import { jsxs, jsx } from 'react/jsx-runtime';
4
4
 
5
5
  function formatSize(size) {
@@ -1,8 +1,8 @@
1
1
  import { deckPage, pageAspect, DEFAULT_SLIDE_PAGE_IN, resolveElements, fontScaleFor } from './chunk-SE6AP3A7.js';
2
- import { useAssetUrl } from './chunk-W4W5Q7HF.js';
2
+ import { useAssetUrl } from './chunk-HCF2DXCR.js';
3
3
  import './chunk-7T5DRR3F.js';
4
- import { useArtifactPatch } from './chunk-H74O2AEA.js';
5
- import './chunk-AHDFQGCX.js';
4
+ import { useArtifactPatch } from './chunk-N5JW2BKI.js';
5
+ import './chunk-RAPTQ6VH.js';
6
6
  import { useState, useRef, useEffect } from 'react';
7
7
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
8
8
 
@@ -1,7 +1,7 @@
1
1
  import { mergeRowsIntoSheet } from './chunk-IFNRLN4Y.js';
2
2
  import { computeFormulas } from './chunk-SGOPRUQ4.js';
3
3
  import './chunk-YZZSJJMQ.js';
4
- import { useCanvasStore } from './chunk-AHDFQGCX.js';
4
+ import { useCanvasStore } from './chunk-RAPTQ6VH.js';
5
5
  import { lazy, useMemo, useState, useRef, useEffect, useCallback, Suspense } from 'react';
6
6
  import '@fortune-sheet/react/dist/index.css';
7
7
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -1,5 +1,5 @@
1
1
  import { isAssetReference, resolveAssetUrl } from './chunk-7T5DRR3F.js';
2
- import { useCanvasStore } from './chunk-AHDFQGCX.js';
2
+ import { useCanvasStore } from './chunk-RAPTQ6VH.js';
3
3
  import { useCallback } from 'react';
4
4
 
5
5
  function useAssetUrl() {
@@ -1,4 +1,4 @@
1
- import { useCanvasStore } from './chunk-AHDFQGCX.js';
1
+ import { useCanvasStore } from './chunk-RAPTQ6VH.js';
2
2
  import { useCallback } from 'react';
3
3
 
4
4
  function useArtifactPatch(id) {
@@ -58,7 +58,9 @@ function reduceCanvas(state, event) {
58
58
  ...event.revision ? { revision: event.revision } : {}
59
59
  }
60
60
  };
61
- const keep = event.amends && versions.length > 1 ? -2 : -1;
61
+ const tail = versions[versions.length - 1];
62
+ const working = tail && typeof tail.meta?.commitDescription !== "string";
63
+ const keep = event.amends && working && versions.length > 1 ? -2 : -1;
62
64
  return {
63
65
  ...state,
64
66
  artifacts: { ...state.artifacts, [event.id]: committed },
package/dist/index.js CHANGED
@@ -2,12 +2,12 @@
2
2
  import { projectSheetIntoRows, mergeRowsIntoSheet } from './chunk-IFNRLN4Y.js';
3
3
  import { loadOptional } from './chunk-YZZSJJMQ.js';
4
4
  import { deckPage, resolveElements } from './chunk-SE6AP3A7.js';
5
- export { useAssetUrl } from './chunk-W4W5Q7HF.js';
5
+ export { useAssetUrl } from './chunk-HCF2DXCR.js';
6
6
  import { inlineArtifactAssets, inlineHtmlAssets } from './chunk-7T5DRR3F.js';
7
7
  export { ASSET_REFERENCE_PREFIXES, fetchAssetDataUri, inlineArtifactAssets, inlineHtmlAssets, isAssetReference, normalizeAssetReference, resolveAssetUrl } from './chunk-7T5DRR3F.js';
8
- export { useArtifactPatch } from './chunk-H74O2AEA.js';
9
- import { useCanvasStoreApi, useCanvasStore } from './chunk-AHDFQGCX.js';
10
- export { CanvasProvider, createCanvasStore, emptyCanvasState, isCanvasEvent, isChatEvent, mergePatch, reduceCanvas, useCanvasStore, useCanvasStoreApi } from './chunk-AHDFQGCX.js';
8
+ export { useArtifactPatch } from './chunk-N5JW2BKI.js';
9
+ import { useCanvasStoreApi, useCanvasStore } from './chunk-RAPTQ6VH.js';
10
+ export { CanvasProvider, createCanvasStore, emptyCanvasState, isCanvasEvent, isChatEvent, mergePatch, reduceCanvas, useCanvasStore, useCanvasStoreApi } from './chunk-RAPTQ6VH.js';
11
11
  import { createContext, lazy, useMemo, useRef, useCallback, useEffect, useContext, useState, Suspense, Component } from 'react';
12
12
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
13
13
 
@@ -2255,11 +2255,11 @@ function HtmlRenderer({ artifact: artifact2 }) {
2255
2255
  }
2256
2256
 
2257
2257
  // src/components/renderers/index.ts
2258
- var ChartRenderer = lazy(() => import('./ChartRenderer-KQ25Q3YG.js').then((m) => ({ default: m.ChartRenderer })));
2259
- var DocumentRenderer = lazy(() => import('./DocumentRenderer-VSVQSVJE.js').then((m) => ({ default: m.DocumentRenderer })));
2260
- var TableRenderer = lazy(() => import('./TableRenderer-C4RZRE52.js').then((m) => ({ default: m.TableRenderer })));
2261
- var SlidesRenderer = lazy(() => import('./SlidesRenderer-SZO3OVXV.js').then((m) => ({ default: m.SlidesRenderer })));
2262
- var FileRenderer = lazy(() => import('./FileRenderer-RW6JR5FL.js').then((m) => ({ default: m.FileRenderer })));
2258
+ var ChartRenderer = lazy(() => import('./ChartRenderer-TBTWNPV7.js').then((m) => ({ default: m.ChartRenderer })));
2259
+ var DocumentRenderer = lazy(() => import('./DocumentRenderer-ER5TSNA6.js').then((m) => ({ default: m.DocumentRenderer })));
2260
+ var TableRenderer = lazy(() => import('./TableRenderer-YTOF2ZIC.js').then((m) => ({ default: m.TableRenderer })));
2261
+ var SlidesRenderer = lazy(() => import('./SlidesRenderer-IHVLXQ45.js').then((m) => ({ default: m.SlidesRenderer })));
2262
+ var FileRenderer = lazy(() => import('./FileRenderer-2CDJYZ7I.js').then((m) => ({ default: m.FileRenderer })));
2263
2263
  var builtinRenderers = {
2264
2264
  html: HtmlRenderer,
2265
2265
  document: DocumentRenderer,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@braincrew-lab/langchain-canvas",
3
- "version": "0.6.0",
3
+ "version": "0.6.2",
4
4
  "description": "A live canvas for LangChain agents — stream documents, charts, and rich artifacts into a React panel.",
5
5
  "license": "MIT",
6
6
  "author": "Brain Crew (https://github.com/braincrew-lab)",