@tinacms/app 0.0.0-d80714b-20241205222511 → 0.0.0-d94de9b-20250707010010

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,47 +1,47 @@
1
- /**
2
-
3
-
4
-
5
- */
6
- import React from 'react'
7
- import { XCircleIcon } from '@heroicons/react/solid'
8
1
  import {
9
2
  Popover,
10
3
  PopoverButton,
11
4
  PopoverPanel,
12
5
  Transition,
13
- } from '@headlessui/react'
14
- import { Fragment } from 'react'
6
+ } from '@headlessui/react';
7
+ import { XCircleIcon } from '@heroicons/react/solid';
8
+ /**
9
+
10
+
11
+
12
+ */
13
+ import React from 'react';
14
+ import { Fragment } from 'react';
15
15
  // import { InvalidMarkdownElement } from '@tinacms/mdx/src/parse/plate'
16
- export type EmptyTextElement = { type: 'text'; text: '' }
16
+ export type EmptyTextElement = { type: 'text'; text: '' };
17
17
  export type PositionItem = {
18
- line?: number | null
19
- column?: number | null
20
- offset?: number | null
21
- _index?: number | null
22
- _bufferIndex?: number | null
23
- }
18
+ line?: number | null;
19
+ column?: number | null;
20
+ offset?: number | null;
21
+ _index?: number | null;
22
+ _bufferIndex?: number | null;
23
+ };
24
24
  export type Position = {
25
- start: PositionItem
26
- end: PositionItem
27
- }
25
+ start: PositionItem;
26
+ end: PositionItem;
27
+ };
28
28
  export type InvalidMarkdownElement = {
29
- type: 'invalid_markdown'
30
- value: string
31
- message: string
32
- position?: Position
33
- children: [EmptyTextElement]
34
- }
29
+ type: 'invalid_markdown';
30
+ value: string;
31
+ message: string;
32
+ position?: Position;
33
+ children: [EmptyTextElement];
34
+ };
35
35
 
36
36
  type ErrorType = {
37
- message: string
37
+ message: string;
38
38
  position?: {
39
- startColumn: number
40
- endColumn: number
41
- startLineNumber: number
42
- endLineNumber: number
43
- }
44
- }
39
+ startColumn: number;
40
+ endColumn: number;
41
+ startLineNumber: number;
42
+ endLineNumber: number;
43
+ };
44
+ };
45
45
  export const buildError = (element: InvalidMarkdownElement): ErrorType => {
46
46
  return {
47
47
  message: element.message,
@@ -51,28 +51,28 @@ export const buildError = (element: InvalidMarkdownElement): ErrorType => {
51
51
  startLineNumber: element.position.start.line,
52
52
  endLineNumber: element.position.end.line,
53
53
  },
54
- }
55
- }
54
+ };
55
+ };
56
56
  export const buildErrorMessage = (element: InvalidMarkdownElement): string => {
57
57
  if (!element) {
58
- return ''
58
+ return '';
59
59
  }
60
- const errorMessage = buildError(element)
60
+ const errorMessage = buildError(element);
61
61
  const message = errorMessage
62
62
  ? `${errorMessage.message}${
63
63
  errorMessage.position
64
64
  ? ` at line: ${errorMessage.position.startLineNumber}, column: ${errorMessage.position.startColumn}`
65
65
  : ''
66
66
  }`
67
- : null
68
- return message
69
- }
67
+ : null;
68
+ return message;
69
+ };
70
70
 
71
71
  export function ErrorMessage({ error }: { error: InvalidMarkdownElement }) {
72
- const message = buildErrorMessage(error)
72
+ const message = buildErrorMessage(error);
73
73
 
74
74
  return (
75
- <Popover className="relative">
75
+ <Popover className='relative'>
76
76
  {() => (
77
77
  <>
78
78
  <PopoverButton
@@ -80,29 +80,29 @@ export function ErrorMessage({ error }: { error: InvalidMarkdownElement }) {
80
80
  error ? '' : ' opacity-0 hidden '
81
81
  }`}
82
82
  >
83
- <span className="sr-only">Errors</span>
84
- <XCircleIcon className="h-5 w-5 text-red-400" aria-hidden="true" />
83
+ <span className='sr-only'>Errors</span>
84
+ <XCircleIcon className='h-5 w-5 text-red-400' aria-hidden='true' />
85
85
  </PopoverButton>
86
86
  <Transition
87
- enter="transition ease-out duration-200"
88
- enterFrom="opacity-0 translate-y-1"
89
- enterTo="opacity-100 translate-y-0"
90
- leave="transition ease-in duration-150"
91
- leaveFrom="opacity-100 translate-y-0"
92
- leaveTo="opacity-0 translate-y-1"
87
+ enter='transition ease-out duration-200'
88
+ enterFrom='opacity-0 translate-y-1'
89
+ enterTo='opacity-100 translate-y-0'
90
+ leave='transition ease-in duration-150'
91
+ leaveFrom='opacity-100 translate-y-0'
92
+ leaveTo='opacity-0 translate-y-1'
93
93
  >
94
- <PopoverPanel className="absolute top-8 w-[300px] -right-3 z-10 mt-3 px-4 sm:px-0">
95
- <div className="overflow-hidden rounded-lg shadow-lg ring-1 ring-black ring-opacity-5">
96
- <div className="rounded-md bg-red-50 p-4 overflow-scroll">
97
- <div className="flex">
98
- <div className="flex-shrink-0">
94
+ <PopoverPanel className='absolute top-8 w-[300px] -right-3 z-10 mt-3 px-4 sm:px-0'>
95
+ <div className='overflow-hidden rounded-lg shadow-lg ring-1 ring-black ring-opacity-5'>
96
+ <div className='rounded bg-red-50 p-4 overflow-scroll'>
97
+ <div className='flex'>
98
+ <div className='flex-shrink-0'>
99
99
  <XCircleIcon
100
- className="h-5 w-5 text-red-400"
101
- aria-hidden="true"
100
+ className='h-5 w-5 text-red-400'
101
+ aria-hidden='true'
102
102
  />
103
103
  </div>
104
- <div className="ml-3">
105
- <h3 className="text-sm font-medium text-red-800 whitespace-pre-wrap">
104
+ <div className='ml-3'>
105
+ <h3 className='text-sm font-medium text-red-800 whitespace-pre-wrap'>
106
106
  {message}
107
107
  </h3>
108
108
  </div>
@@ -114,5 +114,5 @@ export function ErrorMessage({ error }: { error: InvalidMarkdownElement }) {
114
114
  </>
115
115
  )}
116
116
  </Popover>
117
- )
117
+ );
118
118
  }
@@ -4,23 +4,23 @@
4
4
 
5
5
  */
6
6
 
7
- import React from 'react'
8
- import MonacoEditor, { useMonaco, loader } from '@monaco-editor/react'
7
+ import MonacoEditor, { useMonaco, loader } from '@monaco-editor/react';
9
8
  /**
10
9
  * MDX is built directly to the app because of how we load dependencies.
11
10
  * Since we drop the package.json in to the end users folder, we can't
12
11
  * easily install the current version of the mdx package in all scenarios
13
12
  * (when we're working in the monorepo, or working with a tagged npm version)
14
13
  */
15
- import { parseMDX, stringifyMDX } from '@tinacms/mdx'
16
- import { useDebounce } from './use-debounce'
17
- import type * as monaco from 'monaco-editor'
14
+ import { parseMDX, serializeMDX } from '@tinacms/mdx';
15
+ import type * as monaco from 'monaco-editor';
16
+ import React from 'react';
17
+ import { RichTextType } from 'tinacms';
18
18
  import {
19
- buildError,
20
19
  ErrorMessage,
21
20
  InvalidMarkdownElement,
22
- } from './error-message'
23
- import { RichTextType } from 'tinacms'
21
+ buildError,
22
+ } from './error-message';
23
+ import { useDebounce } from './use-debounce';
24
24
 
25
25
  export const uuid = () => {
26
26
  // @ts-ignore
@@ -29,15 +29,15 @@ export const uuid = () => {
29
29
  c ^
30
30
  (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))
31
31
  ).toString(16)
32
- )
33
- }
32
+ );
33
+ };
34
34
 
35
- type Monaco = typeof monaco
35
+ type Monaco = typeof monaco;
36
36
 
37
37
  // 0.33.0 has a bug https://github.com/microsoft/monaco-editor/issues/2947
38
38
  loader.config({
39
39
  paths: { vs: 'https://cdn.jsdelivr.net/npm/monaco-editor@0.31.1/min/vs' },
40
- })
40
+ });
41
41
 
42
42
  /**
43
43
  * Since monaco lazy-loads we may have a delay from when the block is inserted
@@ -45,81 +45,81 @@ loader.config({
45
45
  *
46
46
  * Will try for 3 seconds before moving on
47
47
  */
48
- let retryCount = 0
48
+ let retryCount = 0;
49
49
  const retryFocus = (ref) => {
50
50
  if (ref.current) {
51
- ref.current.focus()
51
+ ref.current.focus();
52
52
  } else {
53
53
  if (retryCount < 30) {
54
54
  setTimeout(() => {
55
- retryCount = retryCount + 1
56
- retryFocus(ref)
57
- }, 100)
55
+ retryCount = retryCount + 1;
56
+ retryFocus(ref);
57
+ }, 100);
58
58
  }
59
59
  }
60
- }
60
+ };
61
61
 
62
62
  export const RawEditor = (props: RichTextType) => {
63
- const monaco = useMonaco() as Monaco
63
+ const monaco = useMonaco() as Monaco;
64
64
  const monacoEditorRef =
65
- React.useRef<monaco.editor.IStandaloneCodeEditor>(null)
66
- const [height, setHeight] = React.useState(100)
67
- const id = React.useMemo(() => uuid(), [])
68
- const field = props.field
65
+ React.useRef<monaco.editor.IStandaloneCodeEditor>(null);
66
+ const [height, setHeight] = React.useState(100);
67
+ const id = React.useMemo(() => uuid(), []);
68
+ const field = props.field;
69
69
  const inputValue = React.useMemo(() => {
70
70
  // @ts-ignore no access to the rich-text type from this package
71
- const res = stringifyMDX(props.input.value, field, (value) => value)
72
- return typeof props.input.value === 'string' ? props.input.value : res
73
- }, [])
74
- const [value, setValue] = React.useState(inputValue)
75
- const [error, setError] = React.useState<InvalidMarkdownElement>(null)
71
+ const res = serializeMDX(props.input.value, field, (value) => value);
72
+ return typeof props.input.value === 'string' ? props.input.value : res;
73
+ }, []);
74
+ const [value, setValue] = React.useState(inputValue);
75
+ const [error, setError] = React.useState<InvalidMarkdownElement>(null);
76
76
 
77
- const debouncedValue = useDebounce(value, 500)
77
+ const debouncedValue = useDebounce(value, 500);
78
78
 
79
79
  React.useEffect(() => {
80
80
  // @ts-ignore no access to the rich-text type from this package
81
- const parsedValue = parseMDX(value, field, (value) => value)
81
+ const parsedValue = parseMDX(value, field, (value) => value);
82
82
  if (
83
83
  parsedValue.children[0] &&
84
84
  parsedValue.children[0].type === 'invalid_markdown'
85
85
  ) {
86
- const invalidMarkdown = parsedValue.children[0]
87
- setError(invalidMarkdown)
86
+ const invalidMarkdown = parsedValue.children[0];
87
+ setError(invalidMarkdown);
88
88
  } else {
89
- setError(null)
89
+ setError(null);
90
90
  }
91
- props.input.onChange(parsedValue)
92
- }, [JSON.stringify(debouncedValue)])
91
+ props.input.onChange(parsedValue);
92
+ }, [JSON.stringify(debouncedValue)]);
93
93
 
94
94
  React.useEffect(() => {
95
95
  if (monacoEditorRef.current) {
96
96
  if (error) {
97
- const errorMessage = buildError(error)
97
+ const errorMessage = buildError(error);
98
98
  monaco.editor.setModelMarkers(monacoEditorRef.current.getModel(), id, [
99
99
  {
100
100
  ...errorMessage.position,
101
101
  message: errorMessage.message,
102
102
  severity: 8,
103
103
  },
104
- ])
104
+ ]);
105
105
  } else {
106
106
  monaco.editor.setModelMarkers(
107
107
  monacoEditorRef.current.getModel(),
108
108
  id,
109
109
  []
110
- )
110
+ );
111
111
  }
112
112
  }
113
- }, [JSON.stringify(error), monacoEditorRef.current])
113
+ }, [JSON.stringify(error), monacoEditorRef.current]);
114
114
 
115
115
  React.useEffect(() => {
116
116
  if (monaco) {
117
- monaco.languages.typescript.typescriptDefaults.setEagerModelSync(true)
117
+ monaco.languages.typescript.typescriptDefaults.setEagerModelSync(true);
118
118
  monaco.languages.typescript.typescriptDefaults.setDiagnosticsOptions({
119
119
  // disable errors
120
120
  noSemanticValidation: true,
121
121
  noSyntaxValidation: true,
122
- })
122
+ });
123
123
  // TODO: autocomplete suggestions
124
124
  // monaco.languages.registerCompletionItemProvider('markdown', {
125
125
  // provideCompletionItems: function (model, position) {
@@ -143,24 +143,24 @@ export const RawEditor = (props: RichTextType) => {
143
143
  // },
144
144
  // })
145
145
  }
146
- }, [monaco])
146
+ }, [monaco]);
147
147
 
148
148
  function handleEditorDidMount(
149
149
  monacoEditor: monaco.editor.IStandaloneCodeEditor,
150
150
  monaco: Monaco
151
151
  ) {
152
- monacoEditorRef.current = monacoEditor
152
+ monacoEditorRef.current = monacoEditor;
153
153
  monacoEditor.onDidContentSizeChange(() => {
154
154
  // FIXME: if the window is too tall the performance degrades, come up with a nice
155
155
  // balance between the two
156
- setHeight(Math.min(Math.max(100, monacoEditor.getContentHeight()), 1000))
157
- monacoEditor.layout()
158
- })
156
+ setHeight(Math.min(Math.max(100, monacoEditor.getContentHeight()), 1000));
157
+ monacoEditor.layout();
158
+ });
159
159
  }
160
160
 
161
161
  return (
162
- <div className="relative">
163
- <div className="sticky top-1 w-full flex justify-between mb-2 z-50 max-w-full bg-white">
162
+ <div className='relative'>
163
+ <div className='sticky top-1 w-full flex justify-between mb-2 z-50 max-w-full bg-white'>
164
164
  <Button onClick={() => props.setRawMode(false)}>
165
165
  View in rich-text editor 📝
166
166
  </Button>
@@ -204,33 +204,31 @@ export const RawEditor = (props: RichTextType) => {
204
204
  value={value}
205
205
  onChange={(value) => {
206
206
  try {
207
- setValue(value)
207
+ setValue(value);
208
208
  } catch (e) {
209
- console.log('error', e)
209
+ console.log('error', e);
210
210
  }
211
211
  }}
212
212
  />
213
213
  </div>
214
214
  </div>
215
- )
216
- }
215
+ );
216
+ };
217
217
 
218
218
  const Button = (props) => {
219
219
  return (
220
220
  <button
221
221
  className={`${
222
- props.align === 'left'
223
- ? 'rounded-l-md border-r-0'
224
- : 'rounded-r-md border-l-0'
225
- } flex justify-center w-full shadow rounded-md bg-white cursor-pointer relative inline-flex items-center px-2 py-2 border border-gray-200 hover:text-white text-sm font-medium transition-all ease-out duration-150 hover:bg-blue-500 focus:z-10 focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500`}
226
- type="button"
222
+ props.align === 'left' ? 'rounded-l border-r-0' : 'rounded-r border-l-0'
223
+ } flex justify-center w-full shadow rounded bg-white cursor-pointer relative inline-flex items-center px-2 py-2 border border-gray-200 hover:text-white text-sm font-medium transition-all ease-out duration-150 hover:bg-blue-500 focus:z-10 focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500`}
224
+ type='button'
227
225
  onClick={props.onClick}
228
226
  >
229
- <span className="text-sm font-semibold tracking-wide align-baseline mr-1">
227
+ <span className='text-sm font-semibold tracking-wide align-baseline mr-1'>
230
228
  {props.children}
231
229
  </span>
232
230
  </button>
233
- )
234
- }
231
+ );
232
+ };
235
233
 
236
- export default RawEditor
234
+ export default RawEditor;
@@ -3,23 +3,23 @@
3
3
 
4
4
 
5
5
  */
6
- import { useState, useEffect } from 'react'
6
+ import { useState, useEffect } from 'react';
7
7
  export function useDebounce(value, delay) {
8
- const [debouncedValue, setDebouncedValue] = useState(value)
8
+ const [debouncedValue, setDebouncedValue] = useState(value);
9
9
  useEffect(
10
10
  () => {
11
11
  // Update debounced value after delay
12
12
  const handler = setTimeout(() => {
13
- setDebouncedValue(value)
14
- }, delay)
13
+ setDebouncedValue(value);
14
+ }, delay);
15
15
  // Cancel the timeout if value changes (also on delay change or unmount)
16
16
  // This is how we prevent debounced value from updating if value is changed ...
17
17
  // .. within the delay period. Timeout gets cleared and restarted.
18
18
  return () => {
19
- clearTimeout(handler)
20
- }
19
+ clearTimeout(handler);
20
+ };
21
21
  },
22
22
  [value, delay] // Only re-call effect if value or delay changes
23
- )
24
- return debouncedValue
23
+ );
24
+ return debouncedValue;
25
25
  }
package/src/global.css CHANGED
@@ -40,13 +40,13 @@
40
40
  --tina-font-size-7: 26px;
41
41
  --tina-font-size-8: 32px;
42
42
 
43
- --tina-font-family: 'Inter', sans-serif;
43
+ --tina-font-family: "Inter", sans-serif;
44
44
 
45
45
  --tina-font-weight-regular: 400;
46
46
  --tina-font-weight-bold: 600;
47
47
 
48
- --tina-shadow-big: 0px 2px 3px rgba(0, 0, 0, 0.05),
49
- 0 4px 12px rgba(0, 0, 0, 0.1);
48
+ --tina-shadow-big: 0px 2px 3px rgba(0, 0, 0, 0.05), 0 4px 12px
49
+ rgba(0, 0, 0, 0.1);
50
50
  --tina-shadow-small: 0px 2px 3px rgba(0, 0, 0, 0.12);
51
51
 
52
52
  --tina-timing-short: 85ms;
package/src/index.css CHANGED
@@ -1,5 +1,5 @@
1
- @import 'global.css';
2
- @import 'preflight.css';
1
+ @import "global.css";
2
+ @import "preflight.css";
3
3
  @tailwind base;
4
4
  @tailwind components;
5
5
  @tailwind utilities;
@@ -16,15 +16,15 @@
16
16
  body {
17
17
  margin: 0;
18
18
  padding: 0;
19
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
20
- 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
19
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
20
+ "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
21
21
  sans-serif;
22
22
  -webkit-font-smoothing: antialiased;
23
23
  -moz-osx-font-smoothing: grayscale;
24
24
  }
25
25
 
26
26
  code {
27
- font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
27
+ font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
28
28
  monospace;
29
29
  }
30
30
 
@@ -38,32 +38,32 @@ div.graphiql-explorer-root > div:last-child {
38
38
  }
39
39
 
40
40
  /* if the last block has margin-bottom it makes the text box larger but some of it isn't clickable */
41
- .tina-prose [data-slate-editor='true'] {
41
+ .tina-prose [data-slate-editor="true"] {
42
42
  padding-bottom: 0.5em;
43
43
  /* Outline is placed on the parent element for styling consistency with other elements */
44
44
  outline: none;
45
45
  }
46
46
  /* prose adds backticks, which look like they should be editable */
47
- .tina-prose [data-slate-editor='true'] .slate-code::before {
48
- content: '';
47
+ .tina-prose [data-slate-editor="true"] .slate-code::before {
48
+ content: "";
49
49
  }
50
- .tina-prose [data-slate-editor='true'] .slate-code::after {
51
- content: '';
50
+ .tina-prose [data-slate-editor="true"] .slate-code::after {
51
+ content: "";
52
52
  }
53
- .tina-prose [data-slate-editor='true'] .slate-code_block {
53
+ .tina-prose [data-slate-editor="true"] .slate-code_block {
54
54
  margin: 0;
55
55
  }
56
56
  /* code lines as part of a block don't need the same background formatting */
57
- .tina-prose [data-slate-editor='true'] .slate-code_block .slate-code {
57
+ .tina-prose [data-slate-editor="true"] .slate-code_block .slate-code {
58
58
  background: none;
59
59
  }
60
60
  /* prose makes the first p in a block slightly larger */
61
- .tina-prose [data-slate-editor='true'] p:first-of-type {
61
+ .tina-prose [data-slate-editor="true"] p:first-of-type {
62
62
  font-size: 1em;
63
63
  }
64
64
 
65
65
  /* experimental floating toolbar doesn't need a large text area */
66
- .with-toolbar [data-slate-editor='true'] {
66
+ .with-toolbar [data-slate-editor="true"] {
67
67
  min-height: 72px;
68
68
  }
69
69
 
@@ -190,7 +190,7 @@ div.graphiql-explorer-root > div:last-child {
190
190
  }
191
191
 
192
192
  .tina-date-field .rdtPicker td.rdtToday:before {
193
- content: '';
193
+ content: "";
194
194
  display: inline-block;
195
195
  border-left: 7px solid transparent;
196
196
  border-bottom: 7px solid var(--tina-color-primary);
@@ -1,42 +1,42 @@
1
- import { Field, Form, FormOptions, TinaCMS, TinaField } from 'tinacms'
1
+ import { Field, Form, FormOptions, TinaCMS, TinaField } from 'tinacms';
2
2
 
3
- export type FieldType = Field & TinaField
4
- export type FormValues = Record<string, unknown>
5
- export type FormType = Form<FormValues, FieldType>
3
+ export type FieldType = Field & TinaField;
4
+ export type FormValues = Record<string, unknown>;
5
+ export type FormType = Form<FormValues, FieldType>;
6
6
 
7
- type FormCreator = (formConfig: FormOptions<any>) => Form
7
+ type FormCreator = (formConfig: FormOptions<any>) => Form;
8
8
  interface GlobalFormOptions {
9
- icon?: any
10
- layout: 'fullscreen' | 'popup'
9
+ icon?: any;
10
+ layout: 'fullscreen' | 'popup';
11
11
  }
12
12
  type GlobalFormCreator = (
13
13
  formConfig: FormOptions<any>,
14
14
  options?: GlobalFormOptions
15
- ) => Form
15
+ ) => Form;
16
16
  interface GlobalFormOptions {
17
- icon?: any
18
- layout: 'fullscreen' | 'popup'
17
+ icon?: any;
18
+ layout: 'fullscreen' | 'popup';
19
19
  }
20
20
  export interface FormifyArgs {
21
- formConfig: FormOptions<any>
22
- createForm: FormCreator
23
- createGlobalForm: FormCreator
24
- skip?: () => void
21
+ formConfig: FormOptions<any>;
22
+ createForm: FormCreator;
23
+ createGlobalForm: FormCreator;
24
+ skip?: () => void;
25
25
  }
26
26
 
27
- export type FormifyCallback = (args: FormifyArgs, cms: TinaCMS) => Form | void
27
+ export type FormifyCallback = (args: FormifyArgs, cms: TinaCMS) => Form | void;
28
28
  export type onSubmitArgs = {
29
29
  /**
30
30
  * @deprecated queryString is actually a mutation string, use `mutationString` instead
31
31
  */
32
- queryString: string
33
- mutationString: string
34
- variables: object
35
- }
32
+ queryString: string;
33
+ mutationString: string;
34
+ variables: object;
35
+ };
36
36
 
37
37
  export const createForm = (formConfig: FormOptions<any, any>) => {
38
- return new Form(formConfig)
39
- }
38
+ return new Form(formConfig);
39
+ };
40
40
  export const createGlobalForm: GlobalFormCreator = (
41
41
  formConfig,
42
42
  options?: { icon?: any; layout: 'fullscreen' | 'popup' }
@@ -44,6 +44,6 @@ export const createGlobalForm: GlobalFormCreator = (
44
44
  const form = new Form({
45
45
  ...formConfig,
46
46
  global: { global: true, ...options },
47
- })
48
- return form
49
- }
47
+ });
48
+ return form;
49
+ };
@@ -1,8 +1,8 @@
1
- import React from 'react'
2
- import { TinaCMS } from 'tinacms'
1
+ import React from 'react';
2
+ import { TinaCMS } from 'tinacms';
3
3
 
4
4
  const ErrorModalContent = (props: { title: string; errors: string[] }) => {
5
- const { title, errors } = props
5
+ const { title, errors } = props;
6
6
  return (
7
7
  <>
8
8
  <div>{title}</div>
@@ -12,13 +12,13 @@ const ErrorModalContent = (props: { title: string; errors: string[] }) => {
12
12
  ))}
13
13
  </ul>
14
14
  </>
15
- )
16
- }
15
+ );
16
+ };
17
17
 
18
18
  export const showErrorModal = (
19
19
  title: string,
20
20
  errors: string[],
21
21
  cms: TinaCMS
22
22
  ) => {
23
- cms.alerts.error(() => <ErrorModalContent title={title} errors={errors} />)
24
- }
23
+ cms.alerts.error(() => <ErrorModalContent title={title} errors={errors} />);
24
+ };