tinacms 0.0.0-b012b6c-20250808011625 → 0.0.0-b0f55b5-20251228232811
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/api.d.ts +1 -1
- package/dist/auth/AuthModal.d.ts +1 -4
- package/dist/auth/TinaCloudProvider.d.ts +0 -1
- package/dist/cache/node-cache.d.ts +6 -2
- package/dist/client.js +240 -181
- package/dist/index.js +118272 -117469
- package/dist/internalClient/index.d.ts +1 -1
- package/dist/react.js +297 -206
- package/dist/rich-text/index.d.ts +6 -0
- package/dist/rich-text/index.js +234 -230
- package/dist/rich-text/prism.js +16 -18
- package/dist/rich-text/static.d.ts +6 -0
- package/dist/rich-text/static.js +229 -225
- package/dist/tina-cms.d.ts +1 -1
- package/dist/toolkit/components/active-field-indicator.d.ts +1 -0
- package/dist/toolkit/components/ui/button.d.ts +11 -0
- package/dist/toolkit/components/ui/calendar.d.ts +8 -0
- package/dist/toolkit/components/ui/date-time-picker.d.ts +111 -0
- package/dist/toolkit/components/ui/input.d.ts +3 -0
- package/dist/toolkit/components/ui/popover.d.ts +7 -0
- package/dist/toolkit/components/ui/select.d.ts +13 -0
- package/dist/toolkit/fields/components/color-picker/block-widget.d.ts +3 -0
- package/dist/toolkit/fields/components/color-picker/color-input.d.ts +35 -0
- package/dist/toolkit/fields/components/color-picker/color-picker.d.ts +6 -2
- package/dist/toolkit/fields/components/color-picker/color-utils.d.ts +37 -0
- package/dist/toolkit/fields/components/color-picker/sketch-widget.d.ts +3 -0
- package/dist/toolkit/fields/components/password-field.d.ts +1 -1
- package/dist/toolkit/fields/components/select.d.ts +1 -1
- package/dist/toolkit/fields/components/text-field.d.ts +1 -1
- package/dist/toolkit/fields/plugins/button-toggle-field-plugin.d.ts +2 -2
- package/dist/toolkit/fields/plugins/checkbox-group-field-plugin.d.ts +2 -2
- package/dist/toolkit/fields/plugins/color-field-plugin.d.ts +1 -0
- package/dist/toolkit/fields/plugins/date-field-plugin.d.ts +0 -2
- package/dist/toolkit/fields/plugins/dnd-kit-wrapper.d.ts +49 -0
- package/dist/toolkit/fields/plugins/group-list-field-plugin.d.ts +2 -1
- package/dist/toolkit/fields/plugins/list-field-plugin.d.ts +2 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/editor.d.ts +2 -2
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/blockquote-element.d.ts +1 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/button.d.ts +2 -2
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/code-block/code-block-element.d.ts +1 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/code-line-element.d.ts +1 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/command.d.ts +7 -7
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/list-element.d.ts +2 -2
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/paragraph-element.d.ts +1 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/slash-input-element.d.ts +1 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table/table-cell-element.d.ts +2 -2
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table/table-element.d.ts +1 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table/table-row-element.d.ts +1 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/use-floating-toolbar-hook.d.ts +1 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/components.d.ts +18 -18
- package/dist/toolkit/fields/plugins/radio-group-field-plugin.d.ts +2 -2
- package/dist/toolkit/fields/plugins/select-field-plugin.d.ts +2 -2
- package/dist/toolkit/fields/plugins/toggle-field-plugin.d.ts +2 -2
- package/dist/toolkit/fields/plugins/wrap-field-with-meta.d.ts +6 -2
- package/dist/toolkit/form-builder/create-branch-modal.d.ts +13 -0
- package/dist/toolkit/form-builder/fields-builder.d.ts +2 -1
- package/dist/toolkit/form-builder/form-builder.d.ts +1 -11
- package/dist/toolkit/form-builder/index.d.ts +1 -0
- package/dist/toolkit/forms/field.d.ts +3 -2
- package/dist/toolkit/icons/TinaExtended.d.ts +4 -0
- package/dist/toolkit/icons/index.d.ts +1 -0
- package/dist/toolkit/index.d.ts +1 -1
- package/dist/toolkit/plugin-branch-switcher/branch-button.d.ts +3 -1
- package/dist/toolkit/react-modals/modal/modal-actions.d.ts +2 -1
- package/dist/toolkit/react-modals/modal/modal-header.d.ts +1 -1
- package/dist/toolkit/react-sidebar/components/NavMenuTrigger.d.ts +11 -0
- package/dist/toolkit/react-sidebar/components/badge.d.ts +6 -0
- package/dist/toolkit/react-sidebar/components/callout.d.ts +5 -0
- package/dist/toolkit/react-sidebar/components/local-warning.d.ts +3 -1
- package/dist/toolkit/react-sidebar/components/nav-components.d.ts +11 -0
- package/dist/toolkit/react-sidebar/components/nav-context.d.ts +15 -0
- package/dist/toolkit/react-sidebar/components/nav.d.ts +3 -3
- package/dist/toolkit/react-sidebar/components/sidebar-body.d.ts +26 -1
- package/dist/toolkit/react-sidebar/index.d.ts +3 -0
- package/dist/toolkit/styles/dropdown-button.d.ts +75 -0
- package/dist/toolkit/styles/index.d.ts +1 -0
- package/dist/toolkit/tina-state.d.ts +42 -16
- package/dist/unifiedClient/index.d.ts +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/package.json +34 -71
- package/dist/client.mjs +0 -132
- package/dist/index.mjs +0 -122706
- package/dist/node-cache-5e8db9f0.mjs +0 -63
- package/dist/react.mjs +0 -254
- package/dist/rich-text/index.mjs +0 -249
- package/dist/rich-text/prism.mjs +0 -16
- package/dist/rich-text/static.mjs +0 -236
- package/dist/toolkit/react-datetime/DateTime.d.ts +0 -135
- package/dist/toolkit/react-sidebar/components/alert.d.ts +0 -5
- /package/dist/admin/components/{Sidebar.d.ts → AdminNav.d.ts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare const RadioGroupField: (props: import("./wrap-field-with-meta").InputFieldType<import("
|
|
1
|
+
export declare const RadioGroupField: (props: import("./wrap-field-with-meta").InputFieldType<import("..").RadioGroupProps, {}>) => import("react").JSX.Element;
|
|
2
2
|
export declare const RadioGroupFieldPlugin: {
|
|
3
3
|
name: string;
|
|
4
|
-
Component: (props: import("./wrap-field-with-meta").InputFieldType<import("
|
|
4
|
+
Component: (props: import("./wrap-field-with-meta").InputFieldType<import("..").RadioGroupProps, {}>) => import("react").JSX.Element;
|
|
5
5
|
validate(value: any, values: any, meta: any, field: any): string;
|
|
6
6
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export declare const SelectField: (props: import("./wrap-field-with-meta").InputFieldType<import("
|
|
1
|
+
export declare const SelectField: (props: import("./wrap-field-with-meta").InputFieldType<import("..").SelectProps, {}>) => import("react").JSX.Element;
|
|
2
2
|
export declare const SelectFieldPlugin: {
|
|
3
3
|
name: string;
|
|
4
4
|
type: string;
|
|
5
|
-
Component: (props: import("./wrap-field-with-meta").InputFieldType<import("
|
|
5
|
+
Component: (props: import("./wrap-field-with-meta").InputFieldType<import("..").SelectProps, {}>) => import("react").JSX.Element;
|
|
6
6
|
parse: (value?: string) => string;
|
|
7
7
|
validate(value: any, values: any, meta: any, field: any): string;
|
|
8
8
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare const ToggleField: (props: import("./wrap-field-with-meta").InputFieldType<import("
|
|
1
|
+
export declare const ToggleField: (props: import("./wrap-field-with-meta").InputFieldType<import("..").ToggleProps, {}>) => import("react").JSX.Element;
|
|
2
2
|
export declare const ToggleFieldPlugin: {
|
|
3
3
|
name: string;
|
|
4
4
|
type: string;
|
|
5
|
-
Component: (props: import("./wrap-field-with-meta").InputFieldType<import("
|
|
5
|
+
Component: (props: import("./wrap-field-with-meta").InputFieldType<import("..").ToggleProps, {}>) => import("react").JSX.Element;
|
|
6
6
|
validate(value: any, values: any, meta: any, field: any): string;
|
|
7
7
|
};
|
|
@@ -21,11 +21,15 @@ interface FieldMetaProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
21
21
|
margin?: boolean;
|
|
22
22
|
index?: number;
|
|
23
23
|
tinaForm: Form;
|
|
24
|
+
focusIntent?: boolean;
|
|
25
|
+
hoverIntent?: boolean;
|
|
24
26
|
}
|
|
25
|
-
export declare const FieldMeta: ({ name, label, description, error, margin, children, index, tinaForm, ...props }: FieldMetaProps) => React.JSX.Element;
|
|
26
|
-
export declare const FieldWrapper: ({ margin, children, ...
|
|
27
|
+
export declare const FieldMeta: ({ name, label, description, error, margin, children, index, tinaForm, focusIntent, hoverIntent, ...props }: FieldMetaProps) => React.JSX.Element;
|
|
28
|
+
export declare const FieldWrapper: ({ margin, children, "data-tina-field-active": dataActive, "data-tina-field-hovering": dataHovering, ...restProps }: {
|
|
27
29
|
margin: boolean;
|
|
28
30
|
children: React.ReactNode;
|
|
31
|
+
"data-tina-field-active"?: string;
|
|
32
|
+
"data-tina-field-hovering"?: string;
|
|
29
33
|
} & Partial<React.ComponentPropsWithoutRef<"div">>) => React.JSX.Element;
|
|
30
34
|
export interface FieldLabel extends React.HTMLAttributes<HTMLLabelElement> {
|
|
31
35
|
children?: any | any[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare const CreateBranchModal: ({ close, safeSubmit, path, values, crudType, }: {
|
|
3
|
+
safeSubmit: () => Promise<void>;
|
|
4
|
+
close: () => void;
|
|
5
|
+
path: string;
|
|
6
|
+
values: Record<string, unknown>;
|
|
7
|
+
crudType: string;
|
|
8
|
+
}) => React.JSX.Element;
|
|
9
|
+
export declare const PrefixedTextField: ({ label, prefix, ...props }: {
|
|
10
|
+
[x: string]: any;
|
|
11
|
+
label?: any;
|
|
12
|
+
prefix?: string;
|
|
13
|
+
}) => React.JSX.Element;
|
|
@@ -3,10 +3,11 @@ import * as React from 'react';
|
|
|
3
3
|
export interface FieldsBuilderProps {
|
|
4
4
|
form: Form;
|
|
5
5
|
activeFieldName?: string;
|
|
6
|
+
hoveringFieldName?: string;
|
|
6
7
|
fields: Field[];
|
|
7
8
|
padding?: boolean;
|
|
8
9
|
}
|
|
9
|
-
export declare function FieldsBuilder({ form, fields, activeFieldName, padding, }: FieldsBuilderProps): React.JSX.Element;
|
|
10
|
+
export declare function FieldsBuilder({ form, fields, activeFieldName, hoveringFieldName, padding, }: FieldsBuilderProps): React.JSX.Element;
|
|
10
11
|
export declare const FieldsGroup: ({ padding, children, }: {
|
|
11
12
|
padding?: boolean;
|
|
12
13
|
children?: any | any[];
|
|
@@ -5,6 +5,7 @@ export interface FormBuilderProps {
|
|
|
5
5
|
form: {
|
|
6
6
|
tinaForm: Form;
|
|
7
7
|
activeFieldName?: string;
|
|
8
|
+
hoveringFieldName?: string;
|
|
8
9
|
};
|
|
9
10
|
hideFooter?: boolean;
|
|
10
11
|
label?: string;
|
|
@@ -29,14 +30,3 @@ export declare const CreateBranchModel: ({ close, safeSubmit, relativePath, valu
|
|
|
29
30
|
values: Record<string, unknown>;
|
|
30
31
|
crudType: string;
|
|
31
32
|
}) => React.JSX.Element;
|
|
32
|
-
export declare const CreateBranchModal: ({ close, safeSubmit, path, values, crudType, }: {
|
|
33
|
-
safeSubmit: () => Promise<void>;
|
|
34
|
-
close: () => void;
|
|
35
|
-
path: string;
|
|
36
|
-
values: Record<string, unknown>;
|
|
37
|
-
crudType: string;
|
|
38
|
-
}) => React.JSX.Element;
|
|
39
|
-
export declare const PrefixedTextField: ({ prefix, ...props }: {
|
|
40
|
-
[x: string]: any;
|
|
41
|
-
prefix?: string;
|
|
42
|
-
}) => React.JSX.Element;
|
|
@@ -20,9 +20,10 @@ export interface Field<F extends Field = AnyField> {
|
|
|
20
20
|
* a guarantee that the given field will receive focus since that functionality
|
|
21
21
|
* needs to be built on a per-component basis.
|
|
22
22
|
*
|
|
23
|
-
* This is also a one-way
|
|
23
|
+
* This is also a one-way street. The "active field" for a given form isn't
|
|
24
24
|
* necessarily updated when a user clicks on a new field. So you can have a
|
|
25
25
|
* field which is marked as the active field, and have focus on another field
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
focusIntent?: boolean;
|
|
28
|
+
hoverIntent?: boolean;
|
|
28
29
|
}
|
package/dist/toolkit/index.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export type { TinaState } from './tina-state';
|
|
|
19
19
|
export * from './forms';
|
|
20
20
|
export * from './icons';
|
|
21
21
|
export * from './react-dismissible';
|
|
22
|
-
export { Nav, LocalWarning, BillingWarning, SyncStatusButton, } from './react-sidebar';
|
|
22
|
+
export { Nav, NavCloudLink, NavProvider, NavMenuTrigger, useNav, LocalWarning, BillingWarning, SyncStatusButton, } from './react-sidebar';
|
|
23
23
|
export { useCMS } from './react-core';
|
|
24
24
|
/**
|
|
25
25
|
* Custom `tinacms` things
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
export declare const BranchButton: (
|
|
2
|
+
export declare const BranchButton: ({ className }: {
|
|
3
|
+
className?: string;
|
|
4
|
+
}) => React.JSX.Element;
|
|
3
5
|
export declare const BranchPreviewButton: (props: React.ButtonHTMLAttributes<HTMLButtonElement>) => React.JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export interface ModalHeaderProps {
|
|
3
|
-
children: React.
|
|
3
|
+
children: React.ReactNode;
|
|
4
4
|
close?(): void;
|
|
5
5
|
}
|
|
6
6
|
export declare const ModalHeader: ({ children, close }: ModalHeaderProps) => React.JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface NavMenuTriggerProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
label?: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* A button component that triggers the navigation menu
|
|
8
|
+
* Can be used anywhere within the NavProvider hierarchy
|
|
9
|
+
*/
|
|
10
|
+
export declare const NavMenuTrigger: React.FC<NavMenuTriggerProps>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare const Badge: ({ children, calloutStyle, className, displayIcon, ...props }: {
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
calloutStyle?: "warning" | "info" | "success" | "error";
|
|
5
|
+
displayIcon?: boolean;
|
|
6
|
+
} & React.HTMLProps<HTMLDivElement>) => React.JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CloudConfigPlugin } from '../../react-cloud-config';
|
|
3
|
+
interface NavCloudLinkProps {
|
|
4
|
+
config: CloudConfigPlugin;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Shared component for rendering cloud configuration links
|
|
8
|
+
* Used across both admin and sidebar navigation
|
|
9
|
+
*/
|
|
10
|
+
export declare const NavCloudLink: React.FC<NavCloudLinkProps>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
export interface NavContextValue {
|
|
3
|
+
menuIsOpen: boolean;
|
|
4
|
+
toggleMenu: () => void;
|
|
5
|
+
openMenu: () => void;
|
|
6
|
+
closeMenu: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const NavContext: React.Context<NavContextValue>;
|
|
9
|
+
export declare const useNav: () => NavContextValue;
|
|
10
|
+
interface NavProviderProps {
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
defaultOpen?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare const NavProvider: React.FC<NavProviderProps>;
|
|
15
|
+
export {};
|
|
@@ -9,8 +9,8 @@ interface NavCollection {
|
|
|
9
9
|
interface NavProps {
|
|
10
10
|
isLocalMode: boolean;
|
|
11
11
|
showHamburger?: boolean;
|
|
12
|
-
menuIsOpen
|
|
13
|
-
toggleMenu
|
|
12
|
+
menuIsOpen?: boolean;
|
|
13
|
+
toggleMenu?: () => void;
|
|
14
14
|
children?: any;
|
|
15
15
|
className?: string;
|
|
16
16
|
userName?: string;
|
|
@@ -41,5 +41,5 @@ interface NavProps {
|
|
|
41
41
|
};
|
|
42
42
|
}>;
|
|
43
43
|
}
|
|
44
|
-
export declare const Nav: ({ isLocalMode, showHamburger, menuIsOpen, toggleMenu, className, children, showCollections, collectionsInfo, screens, cloudConfigs, contentCreators, sidebarWidth, RenderNavSite, RenderNavCloud, RenderNavCollection, AuthRenderNavCollection, ...props }: NavProps) => React.JSX.Element;
|
|
44
|
+
export declare const Nav: ({ isLocalMode, showHamburger, menuIsOpen: menuIsOpenProp, toggleMenu: toggleMenuProp, className, children, showCollections, collectionsInfo, screens, cloudConfigs, contentCreators, sidebarWidth, RenderNavSite, RenderNavCloud, RenderNavCollection, AuthRenderNavCollection, ...props }: NavProps) => React.JSX.Element;
|
|
45
45
|
export {};
|
|
@@ -9,8 +9,33 @@ export interface FormHeaderProps {
|
|
|
9
9
|
activeFieldName?: string;
|
|
10
10
|
tinaForm: Form;
|
|
11
11
|
};
|
|
12
|
+
branch?: string;
|
|
13
|
+
isLocalMode?: boolean;
|
|
14
|
+
repoProvider?: {
|
|
15
|
+
defaultBranchName?: string;
|
|
16
|
+
historyUrl?: (context: {
|
|
17
|
+
relativePath: string;
|
|
18
|
+
branch: string;
|
|
19
|
+
}) => {
|
|
20
|
+
url: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export declare const FormHeader: ({ activeForm, repoProvider, branch, isLocalMode, }: FormHeaderProps) => React.JSX.Element;
|
|
25
|
+
interface RepositoryProviderProps {
|
|
26
|
+
contentRelativePath: string;
|
|
27
|
+
tinaBranch?: string;
|
|
28
|
+
isLocalMode?: boolean;
|
|
29
|
+
defaultBranchName?: string;
|
|
30
|
+
historyUrl?: (context: {
|
|
31
|
+
relativePath: string;
|
|
32
|
+
branch: string;
|
|
33
|
+
}) => {
|
|
34
|
+
url: string;
|
|
35
|
+
};
|
|
12
36
|
}
|
|
13
|
-
export declare const
|
|
37
|
+
export declare const FileHistoryProvider: ({ contentRelativePath, tinaBranch, defaultBranchName, historyUrl, isLocalMode, }: RepositoryProviderProps) => React.JSX.Element;
|
|
14
38
|
export declare const FormBreadcrumbs: ({ rootBreadcrumbName, ...props }: {
|
|
15
39
|
rootBreadcrumbName?: string;
|
|
16
40
|
} & React.HTMLAttributes<HTMLDivElement>) => React.JSX.Element;
|
|
41
|
+
export {};
|
|
@@ -3,3 +3,6 @@ export { SidebarProvider } from './components/sidebar';
|
|
|
3
3
|
export { Nav } from './components/nav';
|
|
4
4
|
export { LocalWarning, BillingWarning } from './components/local-warning';
|
|
5
5
|
export { SyncStatusButton } from './components/sync-status';
|
|
6
|
+
export { NavCloudLink } from './components/nav-components';
|
|
7
|
+
export { NavProvider, useNav } from './components/nav-context';
|
|
8
|
+
export { NavMenuTrigger } from './components/NavMenuTrigger';
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ButtonProps } from './button';
|
|
3
|
+
export interface DropdownButtonItem {
|
|
4
|
+
label: string;
|
|
5
|
+
onClick: () => void;
|
|
6
|
+
variant?: 'default' | 'destructive';
|
|
7
|
+
icon?: React.ReactNode;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface DropdownButtonProps extends Omit<ButtonProps, 'onClick'> {
|
|
11
|
+
/**
|
|
12
|
+
* The main action to perform when the button is clicked
|
|
13
|
+
*/
|
|
14
|
+
onMainAction?: () => void;
|
|
15
|
+
/**
|
|
16
|
+
* Array of dropdown menu items
|
|
17
|
+
*/
|
|
18
|
+
items: DropdownButtonItem[];
|
|
19
|
+
/**
|
|
20
|
+
* Whether to show the dropdown arrow in a split button style
|
|
21
|
+
* @default true
|
|
22
|
+
*/
|
|
23
|
+
showSplitButton?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Alignment of the dropdown menu
|
|
26
|
+
* @default 'end'
|
|
27
|
+
*/
|
|
28
|
+
align?: 'start' | 'center' | 'end';
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* A button component that combines a primary action with a dropdown menu of additional options.
|
|
32
|
+
*
|
|
33
|
+
* This component follows the split-button pattern found in TinaCMS, where the main button
|
|
34
|
+
* performs a primary action and a small arrow button opens a dropdown menu with additional options.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* // Basic usage with split button
|
|
38
|
+
* <DropdownButton
|
|
39
|
+
* variant="primary"
|
|
40
|
+
* onMainAction={() => console.log('Save to new branch')}
|
|
41
|
+
* items={[
|
|
42
|
+
* { label: 'Save to protected branch', onClick: () => console.log('Protected') },
|
|
43
|
+
* { label: 'Save and publish', onClick: () => console.log('Publish') },
|
|
44
|
+
* ]}
|
|
45
|
+
* >
|
|
46
|
+
* Save to new branch
|
|
47
|
+
* </DropdownButton>
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* // Dropdown-only button (no main action)
|
|
51
|
+
* <DropdownButton
|
|
52
|
+
* variant="secondary"
|
|
53
|
+
* showSplitButton={false}
|
|
54
|
+
* items={[
|
|
55
|
+
* { label: 'Save to new branch', onClick: () => console.log('New branch') },
|
|
56
|
+
* { label: 'Save to protected branch', onClick: () => console.log('Protected') },
|
|
57
|
+
* ]}
|
|
58
|
+
* >
|
|
59
|
+
* Save options
|
|
60
|
+
* </DropdownButton>
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* // With icons and destructive action
|
|
64
|
+
* <DropdownButton
|
|
65
|
+
* variant="primary"
|
|
66
|
+
* onMainAction={() => console.log('Save')}
|
|
67
|
+
* items={[
|
|
68
|
+
* { label: 'Duplicate', onClick: () => console.log('Duplicate'), icon: <CopyIcon /> },
|
|
69
|
+
* { label: 'Delete', onClick: () => console.log('Delete'), variant: 'destructive', icon: <TrashIcon /> },
|
|
70
|
+
* ]}
|
|
71
|
+
* >
|
|
72
|
+
* Save
|
|
73
|
+
* </DropdownButton>
|
|
74
|
+
*/
|
|
75
|
+
export declare const DropdownButton: React.ForwardRefExoticComponent<DropdownButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
import { Form } from './react-tinacms';
|
|
2
2
|
import { TinaCMS } from './tina-cms';
|
|
3
|
+
export declare const ACTION_TYPES: {
|
|
4
|
+
readonly FORMS_ADD: "forms:add";
|
|
5
|
+
readonly FORMS_REMOVE: "forms:remove";
|
|
6
|
+
readonly FORMS_CLEAR: "forms:clear";
|
|
7
|
+
readonly FORMS_SET_ACTIVE_FORM_ID: "forms:set-active-form-id";
|
|
8
|
+
readonly FORMS_SET_ACTIVE_FIELD_NAME: "forms:set-active-field-name";
|
|
9
|
+
readonly FORMS_SET_HOVERED_FIELD_NAME: "forms:set-hovered-field-name";
|
|
10
|
+
readonly FORM_LISTS_ADD: "form-lists:add";
|
|
11
|
+
readonly FORM_LISTS_REMOVE: "form-lists:remove";
|
|
12
|
+
readonly FORM_LISTS_CLEAR: "form-lists:clear";
|
|
13
|
+
readonly SET_EDIT_MODE: "set-edit-mode";
|
|
14
|
+
readonly INCREMENT_OPERATION_INDEX: "increment-operation-index";
|
|
15
|
+
readonly SET_QUICK_EDITING_SUPPORTED: "set-quick-editing-supported";
|
|
16
|
+
readonly SET_QUICK_EDITING_ENABLED: "set-quick-editing-enabled";
|
|
17
|
+
readonly TOGGLE_QUICK_EDITING_ENABLED: "toggle-quick-editing-enabled";
|
|
18
|
+
readonly TOGGLE_EDIT_STATE: "toggle-edit-state";
|
|
19
|
+
readonly SIDEBAR_SET_DISPLAY_STATE: "sidebar:set-display-state";
|
|
20
|
+
readonly SIDEBAR_SET_LOADING_STATE: "sidebar:set-loading-state";
|
|
21
|
+
};
|
|
3
22
|
type FormListItem = {
|
|
4
23
|
type: 'document';
|
|
5
24
|
path: string;
|
|
@@ -22,50 +41,56 @@ type Breadcrumb = {
|
|
|
22
41
|
namespace: string[];
|
|
23
42
|
};
|
|
24
43
|
export type TinaAction = {
|
|
25
|
-
type:
|
|
44
|
+
type: typeof ACTION_TYPES.FORMS_ADD;
|
|
26
45
|
value: Form;
|
|
27
46
|
} | {
|
|
28
|
-
type:
|
|
47
|
+
type: typeof ACTION_TYPES.FORMS_REMOVE;
|
|
29
48
|
value: string;
|
|
30
49
|
} | {
|
|
31
|
-
type:
|
|
50
|
+
type: typeof ACTION_TYPES.FORMS_CLEAR;
|
|
32
51
|
} | {
|
|
33
|
-
type:
|
|
52
|
+
type: typeof ACTION_TYPES.FORM_LISTS_ADD;
|
|
34
53
|
value: FormList;
|
|
35
54
|
} | {
|
|
36
|
-
type:
|
|
55
|
+
type: typeof ACTION_TYPES.FORM_LISTS_REMOVE;
|
|
37
56
|
value: string;
|
|
38
57
|
} | {
|
|
39
|
-
type:
|
|
58
|
+
type: typeof ACTION_TYPES.FORMS_SET_ACTIVE_FORM_ID;
|
|
40
59
|
value: string;
|
|
41
60
|
} | {
|
|
42
|
-
type:
|
|
61
|
+
type: typeof ACTION_TYPES.FORMS_SET_ACTIVE_FIELD_NAME;
|
|
43
62
|
value: {
|
|
44
63
|
formId: string;
|
|
45
64
|
fieldName: string;
|
|
46
65
|
};
|
|
47
66
|
} | {
|
|
48
|
-
type:
|
|
67
|
+
type: typeof ACTION_TYPES.FORMS_SET_HOVERED_FIELD_NAME;
|
|
68
|
+
value: {
|
|
69
|
+
formId: string;
|
|
70
|
+
fieldName: string | null;
|
|
71
|
+
};
|
|
72
|
+
} | {
|
|
73
|
+
type: typeof ACTION_TYPES.FORM_LISTS_CLEAR;
|
|
49
74
|
} | {
|
|
50
|
-
type:
|
|
75
|
+
type: typeof ACTION_TYPES.SET_EDIT_MODE;
|
|
51
76
|
value: 'visual' | 'basic';
|
|
52
77
|
} | {
|
|
53
|
-
type:
|
|
78
|
+
type: typeof ACTION_TYPES.INCREMENT_OPERATION_INDEX;
|
|
54
79
|
} | {
|
|
55
|
-
type:
|
|
80
|
+
type: typeof ACTION_TYPES.SET_QUICK_EDITING_SUPPORTED;
|
|
56
81
|
value: boolean;
|
|
57
82
|
} | {
|
|
58
|
-
type:
|
|
83
|
+
type: typeof ACTION_TYPES.SET_QUICK_EDITING_ENABLED;
|
|
59
84
|
value?: boolean;
|
|
60
85
|
} | {
|
|
61
|
-
type:
|
|
86
|
+
type: typeof ACTION_TYPES.TOGGLE_QUICK_EDITING_ENABLED;
|
|
62
87
|
} | {
|
|
63
|
-
type:
|
|
88
|
+
type: typeof ACTION_TYPES.TOGGLE_EDIT_STATE;
|
|
64
89
|
} | {
|
|
65
|
-
type:
|
|
90
|
+
type: typeof ACTION_TYPES.SIDEBAR_SET_DISPLAY_STATE;
|
|
66
91
|
value: TinaState['sidebarDisplayState'] | 'openOrFull';
|
|
67
92
|
} | {
|
|
68
|
-
type:
|
|
93
|
+
type: typeof ACTION_TYPES.SIDEBAR_SET_LOADING_STATE;
|
|
69
94
|
value: boolean;
|
|
70
95
|
};
|
|
71
96
|
export interface TinaState {
|
|
@@ -83,6 +108,7 @@ export interface TinaState {
|
|
|
83
108
|
forms: {
|
|
84
109
|
activeFieldName?: string | null;
|
|
85
110
|
tinaForm: Form;
|
|
111
|
+
hoveringFieldName?: string | null;
|
|
86
112
|
}[];
|
|
87
113
|
formLists: FormList[];
|
|
88
114
|
editingMode: 'visual' | 'basic';
|
|
@@ -29,7 +29,7 @@ export declare class TinaClient<GenQueries> {
|
|
|
29
29
|
initialized: boolean;
|
|
30
30
|
cacheLock: AsyncLock | undefined;
|
|
31
31
|
cacheDir: string;
|
|
32
|
-
cache: Cache;
|
|
32
|
+
cache: Cache | null;
|
|
33
33
|
constructor({ token, url, queries, errorPolicy, cacheDir, }: TinaClientArgs<GenQueries>);
|
|
34
34
|
init(): Promise<void>;
|
|
35
35
|
request<DataType extends Record<string, any> = any>({ errorPolicy, ...args }: TinaClientRequestArgs, options: {
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -20,3 +20,4 @@ export interface CreateClientProps {
|
|
|
20
20
|
export declare const createClient: ({ clientId, isLocalClient, branch, tinaioConfig, schema, apiUrl, tinaGraphQLVersion, }: CreateClientProps) => Client;
|
|
21
21
|
export declare function assertShape<T>(value: unknown, yupSchema: (args: typeof yup) => yup.AnySchema, errorMessage?: string): asserts value is T;
|
|
22
22
|
export declare function safeAssertShape<T>(value: unknown, yupSchema: (args: typeof yup) => yup.AnySchema): boolean;
|
|
23
|
+
export declare const get: (obj: any, path: any, defaultValue?: any) => any;
|