tinacms 1.5.17 → 1.5.18
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/auth/TinaCloudProvider.d.ts +3 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +13064 -1819
- package/dist/index.mjs +27834 -16567
- 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/utils/index.d.ts +1 -0
- package/package.json +60 -14
- package/dist/style.css +0 -1536
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This package defines the plugin system of TinaCMS.
|
|
3
|
+
*
|
|
4
|
+
* The management of plugins is a core part of a content
|
|
5
|
+
* management system. The API for managing plugins in TinaCMS is quite
|
|
6
|
+
* powerful, although the implementation is a bit awkward.
|
|
7
|
+
*
|
|
8
|
+
* [[Plugin|Plugins]] are objects used to extend and modify the
|
|
9
|
+
* behaviour of the CMS. Each plugin has a `__type` field that is used
|
|
10
|
+
* to group plugins by their purpose.
|
|
11
|
+
*
|
|
12
|
+
* The [[PluginType]] class is responsible for managing a collection of
|
|
13
|
+
* plugins with the same `__type` value. Plugins can be added and removed from
|
|
14
|
+
* the `PluginType` over the life of the application.
|
|
15
|
+
*
|
|
16
|
+
* A new [[CMS]] is not initialized with any `PluginTypes`.
|
|
17
|
+
* Instead it has a single [[PluginTypeManager]] which is responsible for
|
|
18
|
+
* creating and managing different `PluginType` instances.
|
|
19
|
+
*
|
|
20
|
+
* Although somewhat confusing from the maintainers perspective, this
|
|
21
|
+
* structure results in a pretty easy to use interface for the clients.
|
|
22
|
+
* The concept of `PluginType` and `PluginTypeManager` are not really
|
|
23
|
+
* meant to be exposed to developers using TinaCMS in their projects.
|
|
24
|
+
*
|
|
25
|
+
* @packageDocumentation
|
|
26
|
+
*/
|
|
27
|
+
import { EventBus, Callback } from './event';
|
|
28
|
+
/**
|
|
29
|
+
* An object used to extend or modify the behaviour of the content management system.
|
|
30
|
+
*/
|
|
31
|
+
export interface Plugin {
|
|
32
|
+
/**
|
|
33
|
+
* Used to organize plugins with a common purpose.
|
|
34
|
+
*/
|
|
35
|
+
__type: string;
|
|
36
|
+
/**
|
|
37
|
+
* A unique identifier for the plugin.
|
|
38
|
+
*
|
|
39
|
+
* @todo Rename to `id`.
|
|
40
|
+
*/
|
|
41
|
+
name: string;
|
|
42
|
+
/**
|
|
43
|
+
* A string referencing an icon.
|
|
44
|
+
*
|
|
45
|
+
* ### !DEPRECATED!
|
|
46
|
+
*
|
|
47
|
+
* This shouldn't be here. Please assume it isn't.
|
|
48
|
+
*/
|
|
49
|
+
icon?: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Manages all of the [[PluginType|PluginTypes]] on a [[CMS]].
|
|
53
|
+
*/
|
|
54
|
+
export declare class PluginTypeManager {
|
|
55
|
+
private events;
|
|
56
|
+
/**
|
|
57
|
+
* @ignore
|
|
58
|
+
*/
|
|
59
|
+
private plugins;
|
|
60
|
+
constructor(events: EventBus);
|
|
61
|
+
/**
|
|
62
|
+
* Gets the [[PluginType|collection of plugins]] for the given type.
|
|
63
|
+
*
|
|
64
|
+
* #### Example: Basic Usage
|
|
65
|
+
*
|
|
66
|
+
* ```ts
|
|
67
|
+
* const colorPlugins = cms.plugins.get("color")
|
|
68
|
+
* ```
|
|
69
|
+
*
|
|
70
|
+
* #### Example: Advanced Types
|
|
71
|
+
*
|
|
72
|
+
* A type param can be added to specify the kind of Plugin
|
|
73
|
+
* that is being listed.
|
|
74
|
+
*
|
|
75
|
+
* ```ts
|
|
76
|
+
* const colorPlugins = cms.plugins.get<ColorPlugin>("color")
|
|
77
|
+
* ```
|
|
78
|
+
*
|
|
79
|
+
* @param type The type of plugins to be retrieved
|
|
80
|
+
* @typeparam P A subclass of Plugin. Optional.
|
|
81
|
+
*/
|
|
82
|
+
getType<P extends Plugin = Plugin>(type: P['__type']): PluginType<P>;
|
|
83
|
+
/**
|
|
84
|
+
* An alias to [[get]]
|
|
85
|
+
*
|
|
86
|
+
* ### !DEPRECATED!
|
|
87
|
+
*
|
|
88
|
+
* This name is unnecessarily verbose and weird.
|
|
89
|
+
*/
|
|
90
|
+
findOrCreateMap<P extends Plugin = Plugin>(type: P['__type']): PluginType<P>;
|
|
91
|
+
/**
|
|
92
|
+
* Adds a Plugin to the CMS.
|
|
93
|
+
*
|
|
94
|
+
* #### Example: Basic Usage
|
|
95
|
+
*
|
|
96
|
+
* ```js
|
|
97
|
+
* cms.plugins.add({ __type: "color", name: "red" })
|
|
98
|
+
* ```
|
|
99
|
+
*
|
|
100
|
+
* #### Example: Advanced Types
|
|
101
|
+
*
|
|
102
|
+
* ```ts
|
|
103
|
+
* interface ColorPlugin extends Plugin {
|
|
104
|
+
* __type: "color"
|
|
105
|
+
* hex: string
|
|
106
|
+
* rgb: string
|
|
107
|
+
* }
|
|
108
|
+
*
|
|
109
|
+
* cms.plugins.add<ColorPlugin>({
|
|
110
|
+
* __type: "color",
|
|
111
|
+
* name: "red",
|
|
112
|
+
* hex: "#FF0000",
|
|
113
|
+
* rgb: "RGBA(255, 0, 0, 1)"
|
|
114
|
+
* })
|
|
115
|
+
* ```
|
|
116
|
+
*
|
|
117
|
+
* @typeparam P A subclass of Plugin. Optional.
|
|
118
|
+
* @param plugin
|
|
119
|
+
* @todo Consider returning the plugin which was just added.
|
|
120
|
+
*/
|
|
121
|
+
add<P extends Plugin = Plugin>(plugin: P): void;
|
|
122
|
+
/**
|
|
123
|
+
* Removes the given plugin from the CMS.
|
|
124
|
+
*
|
|
125
|
+
* #### Example
|
|
126
|
+
*
|
|
127
|
+
* In this example a plugin is added to the CMS and removed
|
|
128
|
+
* 5 seconds later.
|
|
129
|
+
*
|
|
130
|
+
* ```ts
|
|
131
|
+
* const redPlugin = {
|
|
132
|
+
* __type: "color",
|
|
133
|
+
* name: "red",
|
|
134
|
+
* hex: "#FF0000",
|
|
135
|
+
* rgb: "RGBA(255, 0, 0, 1)"
|
|
136
|
+
* }
|
|
137
|
+
*
|
|
138
|
+
* cms.plugins.add(redPlugin)
|
|
139
|
+
*
|
|
140
|
+
* setTimeout(() => {
|
|
141
|
+
* cms.plugins.remove(redPlugin)
|
|
142
|
+
* }, 5000)
|
|
143
|
+
* ```
|
|
144
|
+
*
|
|
145
|
+
* @typeparam P A subclass of Plugin. Optional.
|
|
146
|
+
* @param plugin The plugin to be removed from the CMS.
|
|
147
|
+
*/
|
|
148
|
+
remove<P extends Plugin = Plugin>(plugin: P): void;
|
|
149
|
+
/**
|
|
150
|
+
* Returns a list of all the plugins of the given type.
|
|
151
|
+
*
|
|
152
|
+
* #### Example: Basic Usage
|
|
153
|
+
*
|
|
154
|
+
* ```ts
|
|
155
|
+
* cms.plugins.all("color").forEach(color => {
|
|
156
|
+
* console.log(color.name)
|
|
157
|
+
* })
|
|
158
|
+
* ```
|
|
159
|
+
*
|
|
160
|
+
* #### Example: Advanced Types
|
|
161
|
+
*
|
|
162
|
+
* A generic can be added to specify the type of plugins
|
|
163
|
+
* that are being retrieved.
|
|
164
|
+
*
|
|
165
|
+
* ```ts
|
|
166
|
+
* cms.plugins.all<ColorPlugin>("color").forEach(color => {
|
|
167
|
+
* console.log(color.name, color.hex)
|
|
168
|
+
* })
|
|
169
|
+
* ```
|
|
170
|
+
*
|
|
171
|
+
* @typeparam P A subclass of Plugin. Optional.
|
|
172
|
+
* @param type The name of the plugin
|
|
173
|
+
* @returns An array of all plugins of the given type.
|
|
174
|
+
*/
|
|
175
|
+
all<P extends Plugin = Plugin>(type: string): P[];
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* @ignore
|
|
179
|
+
*/
|
|
180
|
+
interface Map<T> {
|
|
181
|
+
[key: string]: T;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* @ignore
|
|
185
|
+
*/
|
|
186
|
+
declare type PluginMap<T extends Plugin = Plugin> = Map<T>;
|
|
187
|
+
/**
|
|
188
|
+
* A collection of plugins with the same `__type` value.
|
|
189
|
+
*/
|
|
190
|
+
export declare class PluginType<T extends Plugin = Plugin> {
|
|
191
|
+
private __type;
|
|
192
|
+
private events;
|
|
193
|
+
/**
|
|
194
|
+
* @ignore
|
|
195
|
+
*/
|
|
196
|
+
__plugins: PluginMap<T>;
|
|
197
|
+
/**
|
|
198
|
+
*
|
|
199
|
+
* @param __type The `__type` of plugin being managed.
|
|
200
|
+
*/
|
|
201
|
+
constructor(__type: string, events: EventBus);
|
|
202
|
+
/**
|
|
203
|
+
* Adds a new plugin to the collection.
|
|
204
|
+
*
|
|
205
|
+
* ### Example
|
|
206
|
+
*
|
|
207
|
+
* ```ts
|
|
208
|
+
* interface ColorPlugin extends Plugin {
|
|
209
|
+
* hex: string
|
|
210
|
+
* }
|
|
211
|
+
*
|
|
212
|
+
* const colorPlugins = new PluginType<ColorPlugin>("color")
|
|
213
|
+
*
|
|
214
|
+
* colorPlugins.add({ name: "red", hex: "#f00" })
|
|
215
|
+
* ```
|
|
216
|
+
*
|
|
217
|
+
* @param plugin A new plugin. The `__type` is optional and will be added if it's missing.
|
|
218
|
+
*/
|
|
219
|
+
add(plugin: T | Omit<T, '__type'>): void;
|
|
220
|
+
all(): T[];
|
|
221
|
+
/**
|
|
222
|
+
*
|
|
223
|
+
* Looks up a plugin by it's `name`.
|
|
224
|
+
*
|
|
225
|
+
* ### Example
|
|
226
|
+
*
|
|
227
|
+
* ```ts
|
|
228
|
+
* const colorPlugins = new PluginType<ColorPlugin>("color")
|
|
229
|
+
*
|
|
230
|
+
* colorPlugins.add({ name: "red", hex: "#f00" })
|
|
231
|
+
*
|
|
232
|
+
* colorPlugins.find("red") // { __type: "color", name: "red", hex: "#f00" }
|
|
233
|
+
* colorPlugin.find("large") // undefined
|
|
234
|
+
* ```
|
|
235
|
+
*
|
|
236
|
+
* @param name The `name` of the plugin to be retrieved.
|
|
237
|
+
*/
|
|
238
|
+
find(name: string): T | undefined;
|
|
239
|
+
/**
|
|
240
|
+
* Pass this function a plugin or the `name` of a plugin to have
|
|
241
|
+
* it be removed from the CMS.
|
|
242
|
+
*
|
|
243
|
+
* @param pluginOrName The `name` of a plugin, or the plugin itself.
|
|
244
|
+
* @returns The plugin that was removed, or `undefined` if it was not found.
|
|
245
|
+
*/
|
|
246
|
+
remove(pluginOrName: string | T): T | undefined;
|
|
247
|
+
subscribe(cb: Callback): () => void;
|
|
248
|
+
}
|
|
249
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This package provides an abstract class for making objects Subscribable.
|
|
3
|
+
*
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* @ignore
|
|
8
|
+
*/
|
|
9
|
+
export declare type Unsubscribe = () => void;
|
|
10
|
+
/**
|
|
11
|
+
* A basic class that can be subscribed to.
|
|
12
|
+
*/
|
|
13
|
+
export declare class Subscribable {
|
|
14
|
+
/**
|
|
15
|
+
* @ignore
|
|
16
|
+
*/
|
|
17
|
+
protected __subscribers: Function[];
|
|
18
|
+
/**
|
|
19
|
+
* Adds a listener to the Subscribable object.
|
|
20
|
+
*
|
|
21
|
+
* ### Example
|
|
22
|
+
*
|
|
23
|
+
* ```ts
|
|
24
|
+
* const unsubscribe = someSubscribable.add(() => {
|
|
25
|
+
* console.log("Update Received")
|
|
26
|
+
* })
|
|
27
|
+
*
|
|
28
|
+
* setTimeout(unsubscribe, 5000)
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
*
|
|
32
|
+
* @param listener A function to be called when the `Subscribable` is updated.
|
|
33
|
+
* @returns A function that will unsubscribe the listener.
|
|
34
|
+
*/
|
|
35
|
+
subscribe(listener: Function): Unsubscribe;
|
|
36
|
+
/**
|
|
37
|
+
* Removes the given listener from the `Subscribable` object.
|
|
38
|
+
*
|
|
39
|
+
* @param listener The functioni to be removed.
|
|
40
|
+
*/
|
|
41
|
+
unsubscribe(listener: Function): void;
|
|
42
|
+
/**
|
|
43
|
+
* Notifies subscribers that the `Subscribable` has changed.
|
|
44
|
+
*
|
|
45
|
+
* ### Example
|
|
46
|
+
*
|
|
47
|
+
* ```ts
|
|
48
|
+
* class Cup extends Subscribable {
|
|
49
|
+
* isFull: boolean = false
|
|
50
|
+
*
|
|
51
|
+
* fill() {
|
|
52
|
+
* this.isFull = true
|
|
53
|
+
* this.notifySubscribers()
|
|
54
|
+
* }
|
|
55
|
+
*
|
|
56
|
+
* empty() {
|
|
57
|
+
* this.isFull = false
|
|
58
|
+
* this.notifySubscribers()
|
|
59
|
+
* }
|
|
60
|
+
*
|
|
61
|
+
* }
|
|
62
|
+
*
|
|
63
|
+
* const cup = new Cup()
|
|
64
|
+
*
|
|
65
|
+
* cup.subscribe(() => console.log(cup.isFull))
|
|
66
|
+
*
|
|
67
|
+
* cup.fill() // Logs: true
|
|
68
|
+
* cup.empty() // Logs: false
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
protected notifiySubscribers(): void;
|
|
72
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare type Option = {
|
|
3
|
+
value: string;
|
|
4
|
+
label?: string;
|
|
5
|
+
icon?: React.ComponentType<any>;
|
|
6
|
+
};
|
|
7
|
+
interface ButtonToggleFieldProps {
|
|
8
|
+
label?: string;
|
|
9
|
+
name: string;
|
|
10
|
+
component: string;
|
|
11
|
+
options: (Option | string)[];
|
|
12
|
+
direction?: 'horizontal' | 'vertical';
|
|
13
|
+
}
|
|
14
|
+
export interface ButtonToggleProps {
|
|
15
|
+
name: string;
|
|
16
|
+
input: any;
|
|
17
|
+
field: ButtonToggleFieldProps;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
options?: (Option | string)[];
|
|
20
|
+
direction?: 'horizontal' | 'vertical';
|
|
21
|
+
}
|
|
22
|
+
export declare const ButtonToggle: React.FC<ButtonToggleProps>;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare type Option = {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
};
|
|
6
|
+
export interface CheckboxGroupFieldProps {
|
|
7
|
+
name: string;
|
|
8
|
+
label?: string;
|
|
9
|
+
component: string;
|
|
10
|
+
options: (Option | string)[];
|
|
11
|
+
direction?: 'horizontal' | 'vertical';
|
|
12
|
+
}
|
|
13
|
+
export interface CheckboxGroupProps {
|
|
14
|
+
name: string;
|
|
15
|
+
input: any;
|
|
16
|
+
field: CheckboxGroupFieldProps;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
options?: (Option | string)[];
|
|
19
|
+
direction?: 'horizontal' | 'vertical';
|
|
20
|
+
}
|
|
21
|
+
export declare const CheckboxGroup: React.FC<CheckboxGroupProps>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface ColorRGBA {
|
|
2
|
+
r: number;
|
|
3
|
+
g: number;
|
|
4
|
+
b: number;
|
|
5
|
+
a: number;
|
|
6
|
+
}
|
|
7
|
+
export declare enum ColorFormat {
|
|
8
|
+
Hex = "hex",
|
|
9
|
+
RGB = "rgb"
|
|
10
|
+
}
|
|
11
|
+
interface ColorFormatHandler {
|
|
12
|
+
getLabel(color: ColorRGBA): string;
|
|
13
|
+
getValue(color: ColorRGBA): string;
|
|
14
|
+
parse(color?: string): ColorRGBA | null;
|
|
15
|
+
}
|
|
16
|
+
interface ColorFormatHandlers {
|
|
17
|
+
[key: string]: ColorFormatHandler;
|
|
18
|
+
}
|
|
19
|
+
export declare const ColorFormatter: ColorFormatHandlers;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ColorFormat } from './color-formatter';
|
|
3
|
+
declare type WrappedFieldProps = any;
|
|
4
|
+
interface Props {
|
|
5
|
+
colorFormat: ColorFormat;
|
|
6
|
+
userColors: string[];
|
|
7
|
+
widget?: 'sketch' | 'block';
|
|
8
|
+
input: WrappedFieldProps['input'];
|
|
9
|
+
}
|
|
10
|
+
export declare const ColorPicker: React.FC<Props>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './color-picker';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
|
|
3
|
+
*/
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
interface ImageUploadProps {
|
|
6
|
+
onDrop: (files: any, fileRejections: any) => Promise<void>;
|
|
7
|
+
onClear?: () => void;
|
|
8
|
+
onClick?: () => void;
|
|
9
|
+
value?: string;
|
|
10
|
+
src?: string;
|
|
11
|
+
loading?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const StyledImage: ({ src }: {
|
|
14
|
+
src: any;
|
|
15
|
+
}) => JSX.Element;
|
|
16
|
+
export declare const StyledFile: ({ src }: {
|
|
17
|
+
src: any;
|
|
18
|
+
}) => JSX.Element;
|
|
19
|
+
export declare const ImageUpload: React.ForwardRefExoticComponent<ImageUploadProps & React.RefAttributes<HTMLButtonElement>>;
|
|
20
|
+
export declare const DeleteImageButton: ({ onClick, }: {
|
|
21
|
+
onClick: (_event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
22
|
+
}) => JSX.Element;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './image-upload';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from './text-field';
|
|
2
|
+
export * from './textarea';
|
|
3
|
+
export * from './color-picker';
|
|
4
|
+
export * from './toggle';
|
|
5
|
+
export * from './select';
|
|
6
|
+
export * from './radio-group';
|
|
7
|
+
export * from './checkbox-group';
|
|
8
|
+
export * from './number-input';
|
|
9
|
+
export * from './image-upload';
|
|
10
|
+
export * from './input';
|
|
11
|
+
export * from './reference';
|
|
12
|
+
export * from './button-toggle';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare type a = React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
|
|
3
|
+
export interface NumberProps extends a {
|
|
4
|
+
step?: string | number;
|
|
5
|
+
}
|
|
6
|
+
export declare const NumberInput: React.FC<NumberProps>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare type Option = {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
};
|
|
6
|
+
interface RadioGroupFieldProps {
|
|
7
|
+
label?: string;
|
|
8
|
+
name: string;
|
|
9
|
+
component: string;
|
|
10
|
+
options: (Option | string)[];
|
|
11
|
+
direction?: 'horizontal' | 'vertical';
|
|
12
|
+
}
|
|
13
|
+
export interface RadioGroupProps {
|
|
14
|
+
name: string;
|
|
15
|
+
input: any;
|
|
16
|
+
field: RadioGroupFieldProps;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
options?: (Option | string)[];
|
|
19
|
+
}
|
|
20
|
+
export declare const RadioGroup: React.FC<RadioGroupProps>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare type Option = {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
};
|
|
6
|
+
export interface ReferenceFieldProps {
|
|
7
|
+
label?: string;
|
|
8
|
+
name: string;
|
|
9
|
+
component: string;
|
|
10
|
+
collections: string[];
|
|
11
|
+
options: (Option | string)[];
|
|
12
|
+
}
|
|
13
|
+
export interface ReferenceProps {
|
|
14
|
+
name: string;
|
|
15
|
+
input: any;
|
|
16
|
+
field: ReferenceFieldProps;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
options?: (Option | string)[];
|
|
19
|
+
}
|
|
20
|
+
export declare const Reference: React.FC<ReferenceProps>;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { TinaCMS } from '../../../tina-cms';
|
|
3
|
+
import type { ReferenceFieldProps } from './index';
|
|
4
|
+
import { Field } from '../../../forms';
|
|
5
|
+
interface ReferenceSelectProps {
|
|
6
|
+
cms: TinaCMS;
|
|
7
|
+
input: any;
|
|
8
|
+
field: ReferenceFieldProps & Field;
|
|
9
|
+
}
|
|
10
|
+
declare const ReferenceSelect: React.FC<ReferenceSelectProps>;
|
|
11
|
+
export default ReferenceSelect;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { Field } from '../../forms';
|
|
3
|
+
declare type Option = {
|
|
4
|
+
value: string;
|
|
5
|
+
label: string;
|
|
6
|
+
};
|
|
7
|
+
interface SelectFieldProps {
|
|
8
|
+
label?: string;
|
|
9
|
+
name: string;
|
|
10
|
+
component: string;
|
|
11
|
+
options: (Option | string)[];
|
|
12
|
+
}
|
|
13
|
+
export interface SelectProps {
|
|
14
|
+
name: string;
|
|
15
|
+
input: React.SelectHTMLAttributes<HTMLSelectElement>;
|
|
16
|
+
field?: SelectFieldProps & Field;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
options?: (Option | string)[];
|
|
19
|
+
className?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare const selectFieldClasses = "shadow appearance-none bg-white block pl-3 pr-8 py-2 truncate w-full text-base cursor-pointer border border-gray-200 focus:outline-none focus:shadow-outline focus:ring-blue-500 focus:border-blue-500 sm:text-sm rounded-md";
|
|
22
|
+
export declare const Select: React.FC<SelectProps>;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare type a = React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
|
|
3
|
+
export interface TextFieldProps extends a {
|
|
4
|
+
error?: boolean;
|
|
5
|
+
ref?: any;
|
|
6
|
+
}
|
|
7
|
+
export declare const textFieldClasses = "shadow-inner focus:shadow-outline focus:border-blue-500 focus:outline-none block text-base placeholder:text-gray-300 px-3 py-2 text-gray-600 w-full bg-white border border-gray-200 transition-all ease-out duration-150 focus:text-gray-900 rounded-md";
|
|
8
|
+
export declare const BaseTextField: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof React.InputHTMLAttributes<HTMLInputElement>> & React.RefAttributes<HTMLInputElement>>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare type a = React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
|
|
3
|
+
export interface TextAreaProps extends a {
|
|
4
|
+
error?: boolean;
|
|
5
|
+
ref?: any;
|
|
6
|
+
}
|
|
7
|
+
export declare const TextArea: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "key" | keyof React.TextareaHTMLAttributes<HTMLTextAreaElement>> & React.RefAttributes<HTMLTextAreaElement>>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Field } from '../../forms';
|
|
4
|
+
export interface ToggleProps {
|
|
5
|
+
name: string;
|
|
6
|
+
input: any;
|
|
7
|
+
field: ToggleFieldDefinition;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
onBlur: <T>(_event?: React.FocusEvent<T>) => void;
|
|
10
|
+
onChange: <T>(_event: React.ChangeEvent<T> | any) => void;
|
|
11
|
+
onFocus: <T>(_event?: React.FocusEvent<T>) => void;
|
|
12
|
+
}
|
|
13
|
+
interface ToggleFieldDefinition extends Field {
|
|
14
|
+
component: 'toggle';
|
|
15
|
+
toggleLabels?: boolean | FieldLabels;
|
|
16
|
+
}
|
|
17
|
+
declare type FieldLabels = {
|
|
18
|
+
true: string;
|
|
19
|
+
false: string;
|
|
20
|
+
};
|
|
21
|
+
export declare const Toggle: FC<ToggleProps>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CMSEvent } from '../core/event';
|
|
2
|
+
export interface FieldHoverEvent extends CMSEvent {
|
|
3
|
+
type: 'field:hover';
|
|
4
|
+
fieldName: string | null;
|
|
5
|
+
id: string;
|
|
6
|
+
}
|
|
7
|
+
export interface FieldFocusEvent extends CMSEvent {
|
|
8
|
+
type: 'field:focus';
|
|
9
|
+
fieldName: string;
|
|
10
|
+
id: string;
|
|
11
|
+
}
|