@daisychainapp/maily-to-core 0.0.25 → 0.1.3

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.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { Editor as Editor$1, Range, Extension, FocusPosition } from '@tiptap/core';
2
+ import { Editor as Editor$1, Range, AnyExtension, FocusPosition } from '@tiptap/core';
3
3
  import { JSONContent } from '@tiptap/react';
4
4
 
5
5
  interface CommandProps {
@@ -8,11 +8,27 @@ interface CommandProps {
8
8
  }
9
9
  type BlockItem = {
10
10
  title: string;
11
- description: string;
11
+ description?: string;
12
12
  searchTerms: string[];
13
- icon: JSX.Element;
14
- shouldBeHidden?: (editor: Editor$1) => boolean;
13
+ icon?: JSX.Element;
14
+ render?: (editor: Editor$1) => JSX.Element | null | true;
15
+ preview?: string | ((editor: Editor$1) => JSX.Element | null);
16
+ } & ({
15
17
  command: (options: CommandProps) => void;
18
+ id?: never;
19
+ commands?: never;
20
+ } | {
21
+ /**
22
+ * id to be used for the slash command query
23
+ * `headers.` will go inside the header subcommand
24
+ */
25
+ id: string;
26
+ command?: never;
27
+ commands: BlockItem[];
28
+ });
29
+ type BlockGroupItem = {
30
+ title: string;
31
+ commands: BlockItem[];
16
32
  };
17
33
 
18
34
  type Variable = {
@@ -22,7 +38,7 @@ type Variable = {
22
38
  };
23
39
  type VariableFunctionOptions = {
24
40
  query: string;
25
- from: 'content-variable' | 'bubble-variable' | 'for-variable';
41
+ from: 'content-variable' | 'bubble-variable' | 'repeat-variable';
26
42
  editor: Editor$1;
27
43
  };
28
44
  type VariablesFunction = (opts: VariableFunctionOptions) => Array<Variable>;
@@ -38,7 +54,7 @@ type MailyContextType = {
38
54
  placeholderUrl?: string;
39
55
  variableTriggerCharacter?: string;
40
56
  variables?: Variables;
41
- blocks?: BlockItem[];
57
+ blocks?: BlockGroupItem[];
42
58
  renderVariable?: RenderVariableFunction;
43
59
  };
44
60
 
@@ -48,7 +64,7 @@ type EditorProps = {
48
64
  contentJson?: JSONContent;
49
65
  onUpdate?: (editor: Editor$1) => void;
50
66
  onCreate?: (editor: Editor$1) => void;
51
- extensions?: Extension[];
67
+ extensions?: AnyExtension[];
52
68
  config?: {
53
69
  hasMenuBar?: boolean;
54
70
  spellCheck?: boolean;
@@ -59,6 +75,7 @@ type EditorProps = {
59
75
  autofocus?: FocusPosition;
60
76
  immediatelyRender?: boolean;
61
77
  };
78
+ editable?: boolean;
62
79
  } & ParitialMailContextType;
63
80
  declare function Editor(props: EditorProps): react_jsx_runtime.JSX.Element | null;
64
81
 
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { Editor as Editor$1, Range, Extension, FocusPosition } from '@tiptap/core';
2
+ import { Editor as Editor$1, Range, AnyExtension, FocusPosition } from '@tiptap/core';
3
3
  import { JSONContent } from '@tiptap/react';
4
4
 
5
5
  interface CommandProps {
@@ -8,11 +8,27 @@ interface CommandProps {
8
8
  }
9
9
  type BlockItem = {
10
10
  title: string;
11
- description: string;
11
+ description?: string;
12
12
  searchTerms: string[];
13
- icon: JSX.Element;
14
- shouldBeHidden?: (editor: Editor$1) => boolean;
13
+ icon?: JSX.Element;
14
+ render?: (editor: Editor$1) => JSX.Element | null | true;
15
+ preview?: string | ((editor: Editor$1) => JSX.Element | null);
16
+ } & ({
15
17
  command: (options: CommandProps) => void;
18
+ id?: never;
19
+ commands?: never;
20
+ } | {
21
+ /**
22
+ * id to be used for the slash command query
23
+ * `headers.` will go inside the header subcommand
24
+ */
25
+ id: string;
26
+ command?: never;
27
+ commands: BlockItem[];
28
+ });
29
+ type BlockGroupItem = {
30
+ title: string;
31
+ commands: BlockItem[];
16
32
  };
17
33
 
18
34
  type Variable = {
@@ -22,7 +38,7 @@ type Variable = {
22
38
  };
23
39
  type VariableFunctionOptions = {
24
40
  query: string;
25
- from: 'content-variable' | 'bubble-variable' | 'for-variable';
41
+ from: 'content-variable' | 'bubble-variable' | 'repeat-variable';
26
42
  editor: Editor$1;
27
43
  };
28
44
  type VariablesFunction = (opts: VariableFunctionOptions) => Array<Variable>;
@@ -38,7 +54,7 @@ type MailyContextType = {
38
54
  placeholderUrl?: string;
39
55
  variableTriggerCharacter?: string;
40
56
  variables?: Variables;
41
- blocks?: BlockItem[];
57
+ blocks?: BlockGroupItem[];
42
58
  renderVariable?: RenderVariableFunction;
43
59
  };
44
60
 
@@ -48,7 +64,7 @@ type EditorProps = {
48
64
  contentJson?: JSONContent;
49
65
  onUpdate?: (editor: Editor$1) => void;
50
66
  onCreate?: (editor: Editor$1) => void;
51
- extensions?: Extension[];
67
+ extensions?: AnyExtension[];
52
68
  config?: {
53
69
  hasMenuBar?: boolean;
54
70
  spellCheck?: boolean;
@@ -59,6 +75,7 @@ type EditorProps = {
59
75
  autofocus?: FocusPosition;
60
76
  immediatelyRender?: boolean;
61
77
  };
78
+ editable?: boolean;
62
79
  } & ParitialMailContextType;
63
80
  declare function Editor(props: EditorProps): react_jsx_runtime.JSX.Element | null;
64
81