@jhits/plugin-newsletter 0.0.12 → 0.0.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jhits/plugin-newsletter",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "description": "Newsletter management and email delivery plugin for the JHITS ecosystem",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -48,6 +48,7 @@ export async function GET_NEWSLETTERS(
48
48
 
49
49
  const filter = {
50
50
  ...query,
51
+ type: { $ne: 'welcome_email' },
51
52
  $or: [
52
53
  { hidden: { $exists: false } },
53
54
  { hidden: { $eq: false } }
@@ -25,7 +25,7 @@ export interface EditorProviderProps {
25
25
  /** Initial state (optional) */
26
26
  initialState?: Partial<EditorState>;
27
27
  /** Callback when save is triggered */
28
- onSave?: (state: EditorState) => Promise<void>;
28
+ onSave?: (state: EditorState, extraData?: { language?: string }) => Promise<void>;
29
29
  /**
30
30
  * Custom blocks from client application
31
31
  * These blocks will be registered in the BlockRegistry on mount
@@ -178,9 +178,9 @@ export function EditorProvider({
178
178
  dispatch({ type: 'RESET_EDITOR' });
179
179
  }, []);
180
180
 
181
- const save = useCallback(async () => {
181
+ const save = useCallback(async (extraData?: { language?: string }) => {
182
182
  if (onSave) {
183
- await onSave(stateRef.current);
183
+ await onSave(stateRef.current, extraData);
184
184
  dispatch({ type: 'MARK_CLEAN' });
185
185
  }
186
186
  }, [onSave]);
@@ -218,7 +218,7 @@ export function CanvasEditorView({ newsletterId, darkMode, backgroundColors: pro
218
218
  setIsSaving(true);
219
219
  setSaveError(null);
220
220
  try {
221
- await helpers.save();
221
+ await helpers.save(isWelcomeEmail ? { language: currentLanguage } : undefined);
222
222
  setIsSaving(false);
223
223
  } catch (error: any) {
224
224
  console.error('[CanvasEditorView] Save error:', error);