tinacms 1.5.17 → 1.5.19
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/admin/pages/CollectionListPage.d.ts +1 -1
- package/dist/auth/TinaCloudProvider.d.ts +3 -1
- package/dist/client.js +5 -3
- package/dist/client.mjs +5 -3
- package/dist/index.d.ts +2 -1
- package/dist/index.js +13065 -1820
- package/dist/index.mjs +27835 -16568
- package/dist/internalClient/index.d.ts +15 -3
- package/dist/tina-cms.d.ts +0 -3
- package/dist/toolkit/alerts/alerts.d.ts +34 -0
- package/dist/toolkit/alerts/index.d.ts +1 -0
- package/dist/toolkit/browser-storage/browser-storage-client.d.ts +12 -0
- package/dist/toolkit/browser-storage/get-flattened-form-values.d.ts +2 -0
- package/dist/toolkit/browser-storage/index.d.ts +2 -0
- package/dist/toolkit/browser-storage/use-form-browser-cache.d.ts +2 -0
- package/dist/toolkit/components/active-field-indicator.d.ts +2 -0
- package/dist/toolkit/components/media/breadcrumb.d.ts +7 -0
- package/dist/toolkit/components/media/copy-field.d.ts +8 -0
- package/dist/toolkit/components/media/index.d.ts +6 -0
- package/dist/toolkit/components/media/media-item.d.ts +12 -0
- package/dist/toolkit/components/media/media-manager.d.ts +10 -0
- package/dist/toolkit/components/media/modal.d.ts +13 -0
- package/dist/toolkit/components/media/pagination.d.ts +9 -0
- package/dist/toolkit/components/media/utils.d.ts +4 -0
- package/dist/toolkit/components/mutation-signal.d.ts +12 -0
- package/dist/toolkit/components/tina-cms-provider.d.ts +8 -0
- package/dist/toolkit/components/tina-provider.d.ts +14 -0
- package/dist/toolkit/components/tina-ui.d.ts +13 -0
- package/dist/toolkit/core/cms.d.ts +156 -0
- package/dist/toolkit/core/event.d.ts +17 -0
- package/dist/toolkit/core/flags.d.ts +13 -0
- package/dist/toolkit/core/index.d.ts +7 -0
- package/dist/toolkit/core/media-store.default.d.ts +45 -0
- package/dist/toolkit/core/media.d.ts +138 -0
- package/dist/toolkit/core/plugins.d.ts +249 -0
- package/dist/toolkit/core/subscribable.d.ts +72 -0
- package/dist/toolkit/fields/components/button-toggle.d.ts +23 -0
- package/dist/toolkit/fields/components/checkbox-group.d.ts +22 -0
- package/dist/toolkit/fields/components/color-picker/color-formatter.d.ts +20 -0
- package/dist/toolkit/fields/components/color-picker/color-picker.d.ts +11 -0
- package/dist/toolkit/fields/components/color-picker/index.d.ts +1 -0
- package/dist/toolkit/fields/components/image-upload/image-upload.d.ts +23 -0
- package/dist/toolkit/fields/components/image-upload/index.d.ts +1 -0
- package/dist/toolkit/fields/components/index.d.ts +12 -0
- package/dist/toolkit/fields/components/input.d.ts +10 -0
- package/dist/toolkit/fields/components/number-input.d.ts +7 -0
- package/dist/toolkit/fields/components/radio-group.d.ts +21 -0
- package/dist/toolkit/fields/components/reference/index.d.ts +21 -0
- package/dist/toolkit/fields/components/reference/reference-link.d.ts +8 -0
- package/dist/toolkit/fields/components/reference/reference-select.d.ts +11 -0
- package/dist/toolkit/fields/components/select.d.ts +23 -0
- package/dist/toolkit/fields/components/text-field.d.ts +9 -0
- package/dist/toolkit/fields/components/textarea.d.ts +8 -0
- package/dist/toolkit/fields/components/toggle.d.ts +22 -0
- package/dist/toolkit/fields/field-events.d.ts +11 -0
- package/dist/toolkit/fields/index.d.ts +3 -0
- package/dist/toolkit/fields/plugins/blocks-field-plugin/block-selector-big.d.ts +9 -0
- package/dist/toolkit/fields/plugins/blocks-field-plugin/block-selector.d.ts +8 -0
- package/dist/toolkit/fields/plugins/blocks-field-plugin/index.d.ts +47 -0
- package/dist/toolkit/fields/plugins/button-toggle-field-plugin.d.ts +6 -0
- package/dist/toolkit/fields/plugins/checkbox-group-field-plugin.d.ts +7 -0
- package/dist/toolkit/fields/plugins/color-field-plugin.d.ts +14 -0
- package/dist/toolkit/fields/plugins/date-field-plugin.d.ts +14 -0
- package/dist/toolkit/fields/plugins/date-format.d.ts +5 -0
- package/dist/toolkit/fields/plugins/field-props.d.ts +6 -0
- package/dist/toolkit/fields/plugins/group-field-plugin.d.ts +36 -0
- package/dist/toolkit/fields/plugins/group-list-field-plugin.d.ts +57 -0
- package/dist/toolkit/fields/plugins/hidden-field-plugin.d.ts +7 -0
- package/dist/toolkit/fields/plugins/image-field-plugin.d.ts +15 -0
- package/dist/toolkit/fields/plugins/index.d.ts +19 -0
- package/dist/toolkit/fields/plugins/list-field-meta.d.ts +32 -0
- package/dist/toolkit/fields/plugins/list-field-plugin.d.ts +44 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/index.d.ts +20 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/monaco/error-message.d.ts +38 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/monaco/index.d.ts +4 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/monaco/use-debounce.d.ts +1 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/editor-context.d.ts +20 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/hooks/embed-hooks.d.ts +7 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/hooks/use-resize.d.ts +1 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/index.d.ts +3 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/nested-form.d.ts +10 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/autoformat/autoformat-block.d.ts +2 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/autoformat/autoformat-lists.d.ts +2 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/autoformat/autoformat-marks.d.ts +2 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/autoformat/autoformat-rules.d.ts +1 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/autoformat/autoformat-utils.d.ts +6 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/common.d.ts +11 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/formatting.d.ts +2 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/index.d.ts +2 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/core/with-correct-void-behavior.d.ts +8 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-code-block/index.d.ts +3 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-img-plugin/component.d.ts +9 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-img-plugin/index.d.ts +5 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-invalid-markdown-plugin/index.d.ts +6 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-link-plugin/index.d.ts +14 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-mdx-plugins/component.d.ts +15 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/create-mdx-plugins/index.d.ts +9 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/soft-break/create-soft-break-plugin.d.ts +7 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/soft-break/index.d.ts +6 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/soft-break/on-key-down-soft-break.d.ts +5 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/soft-break/types.d.ts +11 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/autocomplete.d.ts +14 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/code-block/index.d.ts +9 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/components.d.ts +140 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/dropdown.d.ts +9 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/helpers.d.ts +2 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/icons.d.ts +24 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/toolbar/floating-toolbar.d.ts +5 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/toolbar/index.d.ts +10 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/toolbar/overflow-menu.d.ts +6 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/toolbar/toolbar-item.d.ts +19 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/transforms/insert-empty-block.d.ts +2 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/types.d.ts +9 -0
- package/dist/toolkit/fields/plugins/number-field-plugin.d.ts +15 -0
- package/dist/toolkit/fields/plugins/number-format.d.ts +1 -0
- package/dist/toolkit/fields/plugins/radio-group-field-plugin.d.ts +7 -0
- package/dist/toolkit/fields/plugins/reference-field-plugin.d.ts +9 -0
- package/dist/toolkit/fields/plugins/select-field-plugin.d.ts +9 -0
- package/dist/toolkit/fields/plugins/tags-field-plugin.d.ts +12 -0
- package/dist/toolkit/fields/plugins/text-field-plugin.d.ts +14 -0
- package/dist/toolkit/fields/plugins/text-format.d.ts +1 -0
- package/dist/toolkit/fields/plugins/textarea-field-plugin.d.ts +13 -0
- package/dist/toolkit/fields/plugins/toggle-field-plugin.d.ts +8 -0
- package/dist/toolkit/fields/plugins/wrap-field-with-meta.d.ts +36 -0
- package/dist/toolkit/form-builder/field-plugin.d.ts +14 -0
- package/dist/toolkit/form-builder/fields-builder.d.ts +13 -0
- package/dist/toolkit/form-builder/form-actions.d.ts +11 -0
- package/dist/toolkit/form-builder/form-builder.d.ts +32 -0
- package/dist/toolkit/form-builder/form-legacy.d.ts +8 -0
- package/dist/toolkit/form-builder/form-portal.d.ts +8 -0
- package/dist/toolkit/form-builder/form.d.ts +28 -0
- package/dist/toolkit/form-builder/index.d.ts +10 -0
- package/dist/toolkit/form-builder/loading-dots.d.ts +7 -0
- package/dist/toolkit/form-builder/reset-form.d.ts +10 -0
- package/dist/toolkit/forms/content-creator-plugin.d.ts +13 -0
- package/dist/toolkit/forms/field.d.ts +26 -0
- package/dist/toolkit/forms/form.d.ts +138 -0
- package/dist/toolkit/forms/index.d.ts +4 -0
- package/dist/toolkit/git-client/git-client.d.ts +92 -0
- package/dist/toolkit/git-client/git-file.d.ts +16 -0
- package/dist/toolkit/git-client/git-media-store.d.ts +11 -0
- package/dist/toolkit/git-client/index.d.ts +4 -0
- package/dist/toolkit/git-client/use-git-file.d.ts +2 -0
- package/dist/toolkit/hooks/use-field-reference.d.ts +12 -0
- package/dist/toolkit/hooks/use-local-storage.d.ts +1 -0
- package/dist/toolkit/icons/Add.d.ts +9 -0
- package/dist/toolkit/icons/Alert.d.ts +9 -0
- package/dist/toolkit/icons/AlignCenter.d.ts +9 -0
- package/dist/toolkit/icons/AlignLeft.d.ts +9 -0
- package/dist/toolkit/icons/AlignRight.d.ts +9 -0
- package/dist/toolkit/icons/Bold.d.ts +9 -0
- package/dist/toolkit/icons/ChevronDown.d.ts +9 -0
- package/dist/toolkit/icons/ChevronLeft.d.ts +9 -0
- package/dist/toolkit/icons/ChevronRight.d.ts +9 -0
- package/dist/toolkit/icons/ChevronUp.d.ts +9 -0
- package/dist/toolkit/icons/Circle.d.ts +9 -0
- package/dist/toolkit/icons/CircleCheck.d.ts +9 -0
- package/dist/toolkit/icons/Close.d.ts +9 -0
- package/dist/toolkit/icons/Code.d.ts +9 -0
- package/dist/toolkit/icons/Drag.d.ts +9 -0
- package/dist/toolkit/icons/Duplicate.d.ts +9 -0
- package/dist/toolkit/icons/Edit.d.ts +9 -0
- package/dist/toolkit/icons/EllipsisVertical.d.ts +9 -0
- package/dist/toolkit/icons/Error.d.ts +9 -0
- package/dist/toolkit/icons/Exit.d.ts +9 -0
- package/dist/toolkit/icons/File.d.ts +9 -0
- package/dist/toolkit/icons/Folder.d.ts +9 -0
- package/dist/toolkit/icons/Hamburger.d.ts +9 -0
- package/dist/toolkit/icons/Heading.d.ts +9 -0
- package/dist/toolkit/icons/Info.d.ts +9 -0
- package/dist/toolkit/icons/Italic.d.ts +9 -0
- package/dist/toolkit/icons/LeftArrow.d.ts +9 -0
- package/dist/toolkit/icons/Link.d.ts +9 -0
- package/dist/toolkit/icons/Lock.d.ts +9 -0
- package/dist/toolkit/icons/Markdown.d.ts +9 -0
- package/dist/toolkit/icons/Media.d.ts +9 -0
- package/dist/toolkit/icons/OrderedList.d.ts +9 -0
- package/dist/toolkit/icons/PullRequest.d.ts +9 -0
- package/dist/toolkit/icons/Quote.d.ts +9 -0
- package/dist/toolkit/icons/Redo.d.ts +9 -0
- package/dist/toolkit/icons/Reorder.d.ts +9 -0
- package/dist/toolkit/icons/ReorderRow.d.ts +9 -0
- package/dist/toolkit/icons/Reset.d.ts +9 -0
- package/dist/toolkit/icons/RightArrow.d.ts +9 -0
- package/dist/toolkit/icons/Settings.d.ts +9 -0
- package/dist/toolkit/icons/Strikethrough.d.ts +9 -0
- package/dist/toolkit/icons/Table.d.ts +9 -0
- package/dist/toolkit/icons/Tina.d.ts +9 -0
- package/dist/toolkit/icons/Trash.d.ts +9 -0
- package/dist/toolkit/icons/Underline.d.ts +9 -0
- package/dist/toolkit/icons/Undo.d.ts +9 -0
- package/dist/toolkit/icons/UnorderedList.d.ts +9 -0
- package/dist/toolkit/icons/Upload.d.ts +9 -0
- package/dist/toolkit/icons/Warning.d.ts +9 -0
- package/dist/toolkit/icons/index.d.ts +54 -0
- package/dist/toolkit/index.d.ts +40 -0
- package/dist/toolkit/plugin-branch-switcher/branch-banner.d.ts +2 -0
- package/dist/toolkit/plugin-branch-switcher/branch-button.d.ts +2 -0
- package/dist/toolkit/plugin-branch-switcher/branch-data.d.ts +11 -0
- package/dist/toolkit/plugin-branch-switcher/branch-modal.d.ts +6 -0
- package/dist/toolkit/plugin-branch-switcher/branch-switcher-legacy.d.ts +11 -0
- package/dist/toolkit/plugin-branch-switcher/branch-switcher.d.ts +6 -0
- package/dist/toolkit/plugin-branch-switcher/index.d.ts +6 -0
- package/dist/toolkit/plugin-branch-switcher/plugin.d.ts +14 -0
- package/dist/toolkit/plugin-branch-switcher/types.d.ts +30 -0
- package/dist/toolkit/plugin-fields/index.d.ts +1 -0
- package/dist/toolkit/plugin-fields/markdown.d.ts +11 -0
- package/dist/toolkit/plugin-form-meta/index.d.ts +7 -0
- package/dist/toolkit/plugin-screens/index.d.ts +16 -0
- package/dist/toolkit/plugin-screens/media-manager-screen.d.ts +3 -0
- package/dist/toolkit/react-alerts/alerts.d.ts +6 -0
- package/dist/toolkit/react-alerts/index.d.ts +1 -0
- package/dist/toolkit/react-cloud-config/cloud-config-plugin.d.ts +37 -0
- package/dist/toolkit/react-cloud-config/index.d.ts +2 -0
- package/dist/toolkit/react-cloud-config/use-cloud-config-plugin.d.ts +3 -0
- package/dist/toolkit/react-core/index.d.ts +7 -0
- package/dist/toolkit/react-core/tina-error-boundary.d.ts +21 -0
- package/dist/toolkit/react-core/use-cms-event.d.ts +8 -0
- package/dist/toolkit/react-core/use-cms.d.ts +10 -0
- package/dist/toolkit/react-core/use-form.d.ts +14 -0
- package/dist/toolkit/react-core/use-plugin.d.ts +12 -0
- package/dist/toolkit/react-core/use-subscribable.d.ts +10 -0
- package/dist/toolkit/react-core/use-watch-form-values.d.ts +6 -0
- package/dist/toolkit/react-core/with-plugin.d.ts +18 -0
- package/dist/toolkit/react-datetime/DateTime.d.ts +126 -0
- package/dist/toolkit/react-datetime/parts/ViewNavigation.d.ts +8 -0
- package/dist/toolkit/react-datetime/views/DaysView.d.ts +15 -0
- package/dist/toolkit/react-datetime/views/MonthsView.d.ts +11 -0
- package/dist/toolkit/react-datetime/views/TimeView.d.ts +23 -0
- package/dist/toolkit/react-datetime/views/YearsView.d.ts +16 -0
- package/dist/toolkit/react-dismissible/dismissible.d.ts +32 -0
- package/dist/toolkit/react-dismissible/index.d.ts +1 -0
- package/dist/toolkit/react-forms/form-modal.d.ts +2 -0
- package/dist/toolkit/react-forms/index.d.ts +1 -0
- package/dist/toolkit/react-modals/fullscreen-modal.d.ts +15 -0
- package/dist/toolkit/react-modals/index.d.ts +4 -0
- package/dist/toolkit/react-modals/modal/index.d.ts +5 -0
- package/dist/toolkit/react-modals/modal/modal-actions.d.ts +4 -0
- package/dist/toolkit/react-modals/modal/modal-body.d.ts +6 -0
- package/dist/toolkit/react-modals/modal/modal-header.d.ts +6 -0
- package/dist/toolkit/react-modals/modal/modal-overlay.d.ts +4 -0
- package/dist/toolkit/react-modals/modal/modal.d.ts +3 -0
- package/dist/toolkit/react-modals/modal-provider.d.ts +6 -0
- package/dist/toolkit/react-modals/popup-modal.d.ts +15 -0
- package/dist/toolkit/react-screens/components/screen-plugin-modal.d.ts +7 -0
- package/dist/toolkit/react-screens/index.d.ts +3 -0
- package/dist/toolkit/react-screens/screen-plugin.d.ts +42 -0
- package/dist/toolkit/react-screens/use-screen-plugin.d.ts +3 -0
- package/dist/toolkit/react-sidebar/components/form-list.d.ts +25 -0
- package/dist/toolkit/react-sidebar/components/local-warning.d.ts +3 -0
- package/dist/toolkit/react-sidebar/components/nav.d.ts +34 -0
- package/dist/toolkit/react-sidebar/components/no-forms-placeholder.d.ts +8 -0
- package/dist/toolkit/react-sidebar/components/resize-handle.d.ts +7 -0
- package/dist/toolkit/react-sidebar/components/sidebar-body.d.ts +19 -0
- package/dist/toolkit/react-sidebar/components/sidebar.d.ts +26 -0
- package/dist/toolkit/react-sidebar/components/sync-status.d.ts +31 -0
- package/dist/toolkit/react-sidebar/index.d.ts +5 -0
- package/dist/toolkit/react-sidebar/sidebar.d.ts +34 -0
- package/dist/toolkit/react-tinacms/index.d.ts +10 -0
- package/dist/toolkit/react-tinacms/use-cms.d.ts +3 -0
- package/dist/toolkit/react-tinacms/use-form.d.ts +12 -0
- package/dist/toolkit/react-tinacms/use-plugin.d.ts +1 -0
- package/dist/toolkit/react-tinacms/use-subscribable.d.ts +1 -0
- package/dist/toolkit/react-tinacms/use-watch-form-values.d.ts +1 -0
- package/dist/toolkit/react-tinacms/with-plugin.d.ts +1 -0
- package/dist/toolkit/react-tinacms/with-tina.d.ts +3 -0
- package/dist/toolkit/styles/button.d.ts +15 -0
- package/dist/toolkit/styles/container.d.ts +7 -0
- package/dist/toolkit/styles/font-loader.d.ts +1 -0
- package/dist/toolkit/styles/index.d.ts +4 -0
- package/dist/toolkit/styles/message.d.ts +9 -0
- package/dist/toolkit/styles/overflow-menu.d.ts +6 -0
- package/dist/toolkit/tina-cms.d.ts +41 -0
- package/dist/toolkit/tina-state.d.ts +84 -0
- package/dist/types/cms.d.ts +2 -1
- package/dist/unifiedClient/index.d.ts +0 -3
- package/dist/utils/index.d.ts +1 -0
- package/package.json +60 -14
- package/dist/style.css +0 -1536
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { FormApi, Config, FormState } from 'final-form';
|
|
2
|
+
import type { FormSubscription } from 'final-form';
|
|
3
|
+
import type { Plugin } from '../core';
|
|
4
|
+
import { Field, AnyField } from './field';
|
|
5
|
+
export type { FormApi };
|
|
6
|
+
declare type GlobalOptions = {
|
|
7
|
+
global: true;
|
|
8
|
+
icon?: any;
|
|
9
|
+
layout?: 'fullscreen' | 'popup';
|
|
10
|
+
};
|
|
11
|
+
export interface FormOptions<S, F extends Field = AnyField> extends Config<S> {
|
|
12
|
+
id: any;
|
|
13
|
+
label: string;
|
|
14
|
+
fields?: F[];
|
|
15
|
+
__type?: string;
|
|
16
|
+
reset?(): void;
|
|
17
|
+
actions?: any[];
|
|
18
|
+
global?: GlobalOptions;
|
|
19
|
+
buttons?: {
|
|
20
|
+
save: string;
|
|
21
|
+
reset: string;
|
|
22
|
+
};
|
|
23
|
+
loadInitialValues?: () => Promise<S>;
|
|
24
|
+
onChange?(values: FormState<S>): void;
|
|
25
|
+
extraSubscribeValues?: FormSubscription;
|
|
26
|
+
queries?: string[];
|
|
27
|
+
crudType?: 'create' | 'update';
|
|
28
|
+
relativePath?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare class Form<S = any, F extends Field = AnyField> implements Plugin {
|
|
31
|
+
private _reset;
|
|
32
|
+
__type: string;
|
|
33
|
+
id: any;
|
|
34
|
+
label: string;
|
|
35
|
+
fields: F[];
|
|
36
|
+
finalForm: FormApi<S>;
|
|
37
|
+
actions: any[];
|
|
38
|
+
buttons: {
|
|
39
|
+
save: string;
|
|
40
|
+
reset: string;
|
|
41
|
+
};
|
|
42
|
+
queries: string[];
|
|
43
|
+
global: GlobalOptions | null;
|
|
44
|
+
loading: boolean;
|
|
45
|
+
relativePath: string;
|
|
46
|
+
crudType?: 'create' | 'update';
|
|
47
|
+
constructor({ id, label, fields, actions, buttons, global, reset, loadInitialValues, onChange, queries, ...options }: FormOptions<S, F>);
|
|
48
|
+
/**
|
|
49
|
+
* A unique identifier for Forms.
|
|
50
|
+
*
|
|
51
|
+
* @deprecated use id instead
|
|
52
|
+
*/
|
|
53
|
+
get name(): any;
|
|
54
|
+
/**
|
|
55
|
+
* Returns the current values of the form.
|
|
56
|
+
*
|
|
57
|
+
* if the form is still loading it returns `undefined`.
|
|
58
|
+
*/
|
|
59
|
+
get values(): S | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* The values the form was initialized with.
|
|
62
|
+
*/
|
|
63
|
+
get initialValues(): Partial<S>;
|
|
64
|
+
get pristine(): boolean;
|
|
65
|
+
get dirty(): boolean;
|
|
66
|
+
get submitting(): boolean;
|
|
67
|
+
get valid(): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Resets the values back to the initial values the form was initialized with.
|
|
70
|
+
* Or empties all the values if the form was not initialized.
|
|
71
|
+
*/
|
|
72
|
+
reset(): Promise<void>;
|
|
73
|
+
/**
|
|
74
|
+
* @deprecated Unnecessary indirection
|
|
75
|
+
*/
|
|
76
|
+
updateFields(fields: F[]): void;
|
|
77
|
+
/**
|
|
78
|
+
* Subscribes to changes to the form. The subscriber will only be called when
|
|
79
|
+
* values specified in subscription change. A form can have many subscribers.
|
|
80
|
+
*/
|
|
81
|
+
subscribe: FormApi<S>['subscribe'];
|
|
82
|
+
onSubmit: Config<S>['onSubmit'];
|
|
83
|
+
private handleSubmit;
|
|
84
|
+
/**
|
|
85
|
+
* Submits the form if there are currently no validation errors. It may
|
|
86
|
+
* return undefined or a Promise depending on the nature of the onSubmit
|
|
87
|
+
* configuration value given to the form when it was created.
|
|
88
|
+
*/
|
|
89
|
+
submit: FormApi<S>['submit'];
|
|
90
|
+
/**
|
|
91
|
+
* Changes the value of the given field.
|
|
92
|
+
*
|
|
93
|
+
* @param name
|
|
94
|
+
* @param value
|
|
95
|
+
*/
|
|
96
|
+
change(name: keyof S, value?: any): void;
|
|
97
|
+
get mutators(): Record<string, (...args: any[]) => any>;
|
|
98
|
+
addQuery(queryId: string): void;
|
|
99
|
+
removeQuery(queryId: string): void;
|
|
100
|
+
/**
|
|
101
|
+
* Updates multiple fields in the form.
|
|
102
|
+
*
|
|
103
|
+
* The updates are batched so that it only triggers one `onChange` event.
|
|
104
|
+
*
|
|
105
|
+
* In order to prevent disruptions to the user's editing experience this
|
|
106
|
+
* function will _not_ update the value of any field that is currently
|
|
107
|
+
* being edited.
|
|
108
|
+
*
|
|
109
|
+
* @param values
|
|
110
|
+
*/
|
|
111
|
+
updateValues(values: S): void;
|
|
112
|
+
/**
|
|
113
|
+
* Replaces the initialValues of the form without deleting the current values.
|
|
114
|
+
*
|
|
115
|
+
* This function is helpful when the initialValues are loaded asynchronously.
|
|
116
|
+
*
|
|
117
|
+
* @param initialValues
|
|
118
|
+
*/
|
|
119
|
+
updateInitialValues(initialValues: S): void;
|
|
120
|
+
/**
|
|
121
|
+
* Based on field's name this function will
|
|
122
|
+
* return an array of fields for the give form along
|
|
123
|
+
* with the path that it was found at top nearest
|
|
124
|
+
* object-like group
|
|
125
|
+
*
|
|
126
|
+
* So if you have a field named blocks.3.title
|
|
127
|
+
* It will return the fields from the 3rd "block"
|
|
128
|
+
* along with the path it was found at
|
|
129
|
+
* fields: [{type: 'string', name: 'title'}, ... other fields]
|
|
130
|
+
* activePath: ['blocks', '3']
|
|
131
|
+
*/
|
|
132
|
+
getActiveField(fieldName: string | null): {
|
|
133
|
+
label?: string;
|
|
134
|
+
name?: string;
|
|
135
|
+
fields: Field[];
|
|
136
|
+
};
|
|
137
|
+
private getFieldGroup;
|
|
138
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
export declare class GitClient {
|
|
2
|
+
private baseUrl;
|
|
3
|
+
constructor(baseUrl: string);
|
|
4
|
+
/**
|
|
5
|
+
* An alias to `commit`
|
|
6
|
+
*
|
|
7
|
+
* @deprecated
|
|
8
|
+
*/
|
|
9
|
+
onSubmit(data: any): Promise<any>;
|
|
10
|
+
/**
|
|
11
|
+
* An alias to `writeToDisk`
|
|
12
|
+
*
|
|
13
|
+
* @deprecated
|
|
14
|
+
*/
|
|
15
|
+
onChange(data: any): Promise<any>;
|
|
16
|
+
/**
|
|
17
|
+
* An alias to `writeMediaToDisk`
|
|
18
|
+
*
|
|
19
|
+
* @deprecated
|
|
20
|
+
*/
|
|
21
|
+
onUploadMedia(data: any): Promise<any>;
|
|
22
|
+
/**
|
|
23
|
+
* An alias to `deleteFromDisk`
|
|
24
|
+
*
|
|
25
|
+
* @deprecated
|
|
26
|
+
*/
|
|
27
|
+
onDelete(data: any): Promise<any>;
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated
|
|
30
|
+
*/
|
|
31
|
+
isAuthenticated(): boolean;
|
|
32
|
+
commit(data: {
|
|
33
|
+
files: string[];
|
|
34
|
+
message?: string;
|
|
35
|
+
name?: string;
|
|
36
|
+
email?: string;
|
|
37
|
+
}): Promise<Response>;
|
|
38
|
+
/**
|
|
39
|
+
*
|
|
40
|
+
* TODO: Add return type.
|
|
41
|
+
* TODO: Remove `catch`
|
|
42
|
+
*/
|
|
43
|
+
push(): Promise<any>;
|
|
44
|
+
/**
|
|
45
|
+
*
|
|
46
|
+
* TODO: Add return type.
|
|
47
|
+
* TODO: Remove `catch`
|
|
48
|
+
*/
|
|
49
|
+
writeToDisk(data: {
|
|
50
|
+
fileRelativePath: string;
|
|
51
|
+
content: string;
|
|
52
|
+
}): Promise<any>;
|
|
53
|
+
/**
|
|
54
|
+
* Uploads a File to disk
|
|
55
|
+
* TODO: Remove `catch`
|
|
56
|
+
*/
|
|
57
|
+
writeMediaToDisk(data: {
|
|
58
|
+
directory: string;
|
|
59
|
+
content: File;
|
|
60
|
+
}): Promise<any>;
|
|
61
|
+
/**
|
|
62
|
+
* TODO: rename `data.relPath` to `data.fileRelativePath`
|
|
63
|
+
* TODO: Add return type.
|
|
64
|
+
* TODO: Remove `catch`
|
|
65
|
+
*/
|
|
66
|
+
deleteFromDisk(data: {
|
|
67
|
+
relPath: string;
|
|
68
|
+
}): Promise<any>;
|
|
69
|
+
/**
|
|
70
|
+
* Resets the given files.
|
|
71
|
+
*/
|
|
72
|
+
reset(data: {
|
|
73
|
+
files: string[];
|
|
74
|
+
}): Promise<Response>;
|
|
75
|
+
/**
|
|
76
|
+
* Get the contents of a file or directory on disk.
|
|
77
|
+
*/
|
|
78
|
+
getFile(fileRelativePath: string): Promise<any>;
|
|
79
|
+
/**
|
|
80
|
+
* Get the contents of a file for the most recent commit.
|
|
81
|
+
*/
|
|
82
|
+
show(fileRelativePath: string): Promise<any>;
|
|
83
|
+
/**
|
|
84
|
+
* Get information about a local branch by name, or the current branch if no
|
|
85
|
+
* name is specified.
|
|
86
|
+
*/
|
|
87
|
+
branch(name?: string): Promise<any>;
|
|
88
|
+
/**
|
|
89
|
+
* Get a list of the names of all local branches.
|
|
90
|
+
*/
|
|
91
|
+
branches(): Promise<any>;
|
|
92
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CMS } from '../core';
|
|
2
|
+
export declare class GitFile {
|
|
3
|
+
private cms;
|
|
4
|
+
relativePath: string;
|
|
5
|
+
format: (file: any) => string;
|
|
6
|
+
parse: (content: string) => any;
|
|
7
|
+
constructor(cms: CMS, relativePath: string, format: (file: any) => string, parse: (content: string) => any);
|
|
8
|
+
/**
|
|
9
|
+
* Load the contents of this file at HEAD
|
|
10
|
+
*/
|
|
11
|
+
show: () => Promise<any>;
|
|
12
|
+
commit: () => Promise<void>;
|
|
13
|
+
reset: () => void;
|
|
14
|
+
write: (values: any) => void;
|
|
15
|
+
private get git();
|
|
16
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MediaStore, MediaUploadOptions, Media, MediaListOptions, MediaList } from '../core';
|
|
2
|
+
import { GitClient } from './git-client';
|
|
3
|
+
export declare class GitMediaStore implements MediaStore {
|
|
4
|
+
private client;
|
|
5
|
+
accept: string;
|
|
6
|
+
constructor(client: GitClient);
|
|
7
|
+
persist(files: MediaUploadOptions[]): Promise<Media[]>;
|
|
8
|
+
list(options?: MediaListOptions): Promise<MediaList>;
|
|
9
|
+
delete(media: Media): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
export declare const nextOffset: (offset: number, limit: number, count: number) => number;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* If the DOM wrapped by Tina contains an element with a
|
|
3
|
+
* `data-tinafield` attribute matching `fieldName`,
|
|
4
|
+
* `useFieldReference` will find it by querying the dom and return
|
|
5
|
+
* the matched DOM element.
|
|
6
|
+
*
|
|
7
|
+
* `useFieldReference` is connected to a MutationObserver higher in the DOM,
|
|
8
|
+
* and will cause components that use it to rerender any time content in the DOM
|
|
9
|
+
* changes. This ensures reliable tracking of the referenced DOM element, but
|
|
10
|
+
* may cause problems if `useFieldReference` is called in expensive renders.
|
|
11
|
+
*/
|
|
12
|
+
export declare const useFieldReference: (fieldName: string | null) => HTMLElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useLocalStorage(key: any, initialValue: any): any[];
|