veryfront 0.1.28 → 0.1.30

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/esm/deno.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  "name": "veryfront",
3
- "version": "0.1.28",
3
+ "version": "0.1.30",
4
4
  "license": "Apache-2.0",
5
5
  "nodeModulesDir": "auto",
6
6
  "exclude": [
@@ -1 +1 @@
1
- {"version":3,"file":"bridge-template.d.ts","sourceRoot":"","sources":["../../../src/src/studio/bridge-template.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,mBAAmB,GAAG,MAAM,CAy/H/E"}
1
+ {"version":3,"file":"bridge-template.d.ts","sourceRoot":"","sources":["../../../src/src/studio/bridge-template.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,mBAAmB,GAAG,MAAM,CAigI/E"}
@@ -69,6 +69,7 @@ export function generateStudioBridgeScript(options) {
69
69
  let markdownLatestPresenceUsers = [];
70
70
  let markdownLatestSelections = [];
71
71
  let markdownHasUnsavedChanges = false;
72
+ let markdownSaveInProgress = false;
72
73
 
73
74
  const MARKDOWN_SLASH_COMMANDS = [
74
75
  {
@@ -2916,6 +2917,7 @@ export function generateStudioBridgeScript(options) {
2916
2917
  if (!markdownHasUnsavedChanges) {
2917
2918
  return;
2918
2919
  }
2920
+ markdownSaveInProgress = true;
2919
2921
  setMarkdownPersistStatus('saving');
2920
2922
  if (markdownSyncTimer) {
2921
2923
  clearTimeout(markdownSyncTimer);
@@ -2980,7 +2982,7 @@ export function generateStudioBridgeScript(options) {
2980
2982
 
2981
2983
  let nextContent = '';
2982
2984
  update.editorState.read(function() {
2983
- nextContent = markdownModule.$convertToMarkdownString(markdownModule.TRANSFORMERS, true);
2985
+ nextContent = markdownModule.$convertToMarkdownString(markdownModule.TRANSFORMERS, undefined, true);
2984
2986
  });
2985
2987
  const restoredBody = restoreRawBlocksFromEditor(nextContent);
2986
2988
  const fullContent = composeMarkdownContent(restoredBody);
@@ -3068,7 +3070,8 @@ export function generateStudioBridgeScript(options) {
3068
3070
  return;
3069
3071
  }
3070
3072
 
3071
- if (markdownLexicalApi && markdownLexicalRenderedContent === content) {
3073
+ if (markdownLexicalApi && (markdownLexicalRenderedContent === content || markdownCurrentContent === content)) {
3074
+ console.debug('[StudioBridge] applyMarkdownContent: skipped (content unchanged)');
3072
3075
  markdownCurrentContent = content;
3073
3076
  scheduleMarkdownSelectionOverlayRender();
3074
3077
  scheduleMarkdownSlashMenuUpdate();
@@ -3077,6 +3080,8 @@ export function generateStudioBridgeScript(options) {
3077
3080
  return;
3078
3081
  }
3079
3082
 
3083
+ console.debug('[StudioBridge] applyMarkdownContent: rebuilding Lexical DOM, content length:', content.length, 'rendered match:', markdownLexicalRenderedContent === content, 'current match:', markdownCurrentContent === content);
3084
+
3080
3085
  const mdxImportMap = parseMdxImportMap(content);
3081
3086
  const parts = extractMarkdownParts(content);
3082
3087
  const extracted = extractRawBlocksForEditor(parts.body, mdxImportMap);
@@ -3100,7 +3105,7 @@ export function generateStudioBridgeScript(options) {
3100
3105
  const markdownModule = markdownLexicalApi.markdownModule;
3101
3106
  const root = lexicalModule.$getRoot();
3102
3107
  root.clear();
3103
- markdownModule.$convertFromMarkdownString(editorContent, markdownModule.TRANSFORMERS, true);
3108
+ markdownModule.$convertFromMarkdownString(editorContent, markdownModule.TRANSFORMERS, undefined, true);
3104
3109
  if (root.getChildrenSize() === 0) {
3105
3110
  root.append(lexicalModule.$createParagraphNode());
3106
3111
  }
@@ -3946,9 +3951,12 @@ export function generateStudioBridgeScript(options) {
3946
3951
  if (message.fileId && markdownFileId && message.fileId !== markdownFileId) {
3947
3952
  return;
3948
3953
  }
3949
- setMarkdownPersistStatus(message.status || 'saved');
3950
- if (message.status === 'saved') {
3951
- markdownHasUnsavedChanges = false;
3954
+ if (markdownSaveInProgress) {
3955
+ setMarkdownPersistStatus(message.status || 'saved');
3956
+ if (message.status === 'saved' || message.status === 'error') {
3957
+ markdownSaveInProgress = false;
3958
+ markdownHasUnsavedChanges = false;
3959
+ }
3952
3960
  }
3953
3961
  return;
3954
3962
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "veryfront",
3
- "version": "0.1.28",
3
+ "version": "0.1.30",
4
4
  "description": "The simplest way to build AI-powered apps",
5
5
  "keywords": [
6
6
  "react",
package/src/deno.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  "name": "veryfront",
3
- "version": "0.1.28",
3
+ "version": "0.1.30",
4
4
  "license": "Apache-2.0",
5
5
  "nodeModulesDir": "auto",
6
6
  "exclude": [
@@ -77,6 +77,7 @@ export function generateStudioBridgeScript(options: StudioBridgeOptions): string
77
77
  let markdownLatestPresenceUsers = [];
78
78
  let markdownLatestSelections = [];
79
79
  let markdownHasUnsavedChanges = false;
80
+ let markdownSaveInProgress = false;
80
81
 
81
82
  const MARKDOWN_SLASH_COMMANDS = [
82
83
  {
@@ -2924,6 +2925,7 @@ export function generateStudioBridgeScript(options: StudioBridgeOptions): string
2924
2925
  if (!markdownHasUnsavedChanges) {
2925
2926
  return;
2926
2927
  }
2928
+ markdownSaveInProgress = true;
2927
2929
  setMarkdownPersistStatus('saving');
2928
2930
  if (markdownSyncTimer) {
2929
2931
  clearTimeout(markdownSyncTimer);
@@ -2988,7 +2990,7 @@ export function generateStudioBridgeScript(options: StudioBridgeOptions): string
2988
2990
 
2989
2991
  let nextContent = '';
2990
2992
  update.editorState.read(function() {
2991
- nextContent = markdownModule.$convertToMarkdownString(markdownModule.TRANSFORMERS, true);
2993
+ nextContent = markdownModule.$convertToMarkdownString(markdownModule.TRANSFORMERS, undefined, true);
2992
2994
  });
2993
2995
  const restoredBody = restoreRawBlocksFromEditor(nextContent);
2994
2996
  const fullContent = composeMarkdownContent(restoredBody);
@@ -3076,7 +3078,8 @@ export function generateStudioBridgeScript(options: StudioBridgeOptions): string
3076
3078
  return;
3077
3079
  }
3078
3080
 
3079
- if (markdownLexicalApi && markdownLexicalRenderedContent === content) {
3081
+ if (markdownLexicalApi && (markdownLexicalRenderedContent === content || markdownCurrentContent === content)) {
3082
+ console.debug('[StudioBridge] applyMarkdownContent: skipped (content unchanged)');
3080
3083
  markdownCurrentContent = content;
3081
3084
  scheduleMarkdownSelectionOverlayRender();
3082
3085
  scheduleMarkdownSlashMenuUpdate();
@@ -3085,6 +3088,8 @@ export function generateStudioBridgeScript(options: StudioBridgeOptions): string
3085
3088
  return;
3086
3089
  }
3087
3090
 
3091
+ console.debug('[StudioBridge] applyMarkdownContent: rebuilding Lexical DOM, content length:', content.length, 'rendered match:', markdownLexicalRenderedContent === content, 'current match:', markdownCurrentContent === content);
3092
+
3088
3093
  const mdxImportMap = parseMdxImportMap(content);
3089
3094
  const parts = extractMarkdownParts(content);
3090
3095
  const extracted = extractRawBlocksForEditor(parts.body, mdxImportMap);
@@ -3108,7 +3113,7 @@ export function generateStudioBridgeScript(options: StudioBridgeOptions): string
3108
3113
  const markdownModule = markdownLexicalApi.markdownModule;
3109
3114
  const root = lexicalModule.$getRoot();
3110
3115
  root.clear();
3111
- markdownModule.$convertFromMarkdownString(editorContent, markdownModule.TRANSFORMERS, true);
3116
+ markdownModule.$convertFromMarkdownString(editorContent, markdownModule.TRANSFORMERS, undefined, true);
3112
3117
  if (root.getChildrenSize() === 0) {
3113
3118
  root.append(lexicalModule.$createParagraphNode());
3114
3119
  }
@@ -3954,9 +3959,12 @@ export function generateStudioBridgeScript(options: StudioBridgeOptions): string
3954
3959
  if (message.fileId && markdownFileId && message.fileId !== markdownFileId) {
3955
3960
  return;
3956
3961
  }
3957
- setMarkdownPersistStatus(message.status || 'saved');
3958
- if (message.status === 'saved') {
3959
- markdownHasUnsavedChanges = false;
3962
+ if (markdownSaveInProgress) {
3963
+ setMarkdownPersistStatus(message.status || 'saved');
3964
+ if (message.status === 'saved' || message.status === 'error') {
3965
+ markdownSaveInProgress = false;
3966
+ markdownHasUnsavedChanges = false;
3967
+ }
3960
3968
  }
3961
3969
  return;
3962
3970