tinacms 2.9.1 → 2.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1072 -868
- package/dist/index.mjs +1075 -869
- package/dist/toolkit/components/ui/sonner.d.ts +12 -0
- 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/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/plugins/ui/components.d.ts +18 -18
- package/dist/toolkit/form-builder/create-branch-modal.d.ts +13 -0
- package/dist/toolkit/form-builder/form-builder.d.ts +0 -11
- package/dist/toolkit/form-builder/index.d.ts +1 -0
- package/dist/toolkit/icons/TinaExtended.d.ts +4 -0
- package/dist/toolkit/icons/index.d.ts +1 -0
- 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-sidebar/components/local-warning.d.ts +3 -1
- package/dist/toolkit/styles/dropdown-button.d.ts +75 -0
- package/dist/toolkit/styles/index.d.ts +1 -0
- package/package.json +6 -4
|
@@ -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;
|
|
@@ -29,14 +29,3 @@ export declare const CreateBranchModel: ({ close, safeSubmit, relativePath, valu
|
|
|
29
29
|
values: Record<string, unknown>;
|
|
30
30
|
crudType: string;
|
|
31
31
|
}) => 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;
|
|
@@ -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;
|
|
@@ -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>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tinacms",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.4",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"exports": {
|
|
@@ -137,13 +137,15 @@
|
|
|
137
137
|
"react-icons": "^5.4.0",
|
|
138
138
|
"react-router-dom": "6.3.0",
|
|
139
139
|
"react-use": "^17.6.0",
|
|
140
|
+
"sonner": "^2.0.7",
|
|
140
141
|
"tailwind-merge": "^2.6.0",
|
|
141
142
|
"webfontloader": "1.6.28",
|
|
142
143
|
"yup": "^1.6.1",
|
|
143
144
|
"zod": "^3.24.2",
|
|
144
|
-
"
|
|
145
|
+
"dompurify": "^3.3.0",
|
|
145
146
|
"@tinacms/schema-tools": "1.9.1",
|
|
146
|
-
"@tinacms/search": "1.1.1"
|
|
147
|
+
"@tinacms/search": "1.1.1",
|
|
148
|
+
"@tinacms/mdx": "1.8.1"
|
|
147
149
|
},
|
|
148
150
|
"devDependencies": {
|
|
149
151
|
"@graphql-tools/utils": "^10.8.1",
|
|
@@ -163,11 +165,11 @@
|
|
|
163
165
|
"@types/react-color": "^3.0.13",
|
|
164
166
|
"@types/react-dom": "^18.3.5",
|
|
165
167
|
"@types/yup": "^0.32.0",
|
|
166
|
-
"lowlight": "^3.3.0",
|
|
167
168
|
"happy-dom": "15.10.2",
|
|
168
169
|
"identity-obj-proxy": "^3.0.0",
|
|
169
170
|
"isomorphic-fetch": "^3.0.0",
|
|
170
171
|
"jest-file-snapshot": "^0.7.0",
|
|
172
|
+
"lowlight": "^3.3.0",
|
|
171
173
|
"next": "14.2.10",
|
|
172
174
|
"react": "^18.3.1",
|
|
173
175
|
"react-dom": "^18.3.1",
|