@tinacms/schema-tools 2.0.0 → 2.1.0
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/types/index.d.ts +68 -0
- package/package.json +2 -2
package/dist/types/index.d.ts
CHANGED
|
@@ -125,6 +125,26 @@ export type UIField<Type, List extends boolean> = {
|
|
|
125
125
|
* @deprecated use `defaultItem` at the collection level instead
|
|
126
126
|
*/
|
|
127
127
|
defaultValue?: List extends true ? Type[] : Type;
|
|
128
|
+
/**
|
|
129
|
+
* The color format for the color picker component.
|
|
130
|
+
* Can be 'hex' or 'rgb'.
|
|
131
|
+
*/
|
|
132
|
+
colorFormat?: 'hex' | 'rgb';
|
|
133
|
+
/**
|
|
134
|
+
* The widget style for the color picker component.
|
|
135
|
+
* Can be 'sketch' or 'block'.
|
|
136
|
+
*/
|
|
137
|
+
widget?: 'sketch' | 'block';
|
|
138
|
+
/**
|
|
139
|
+
* The width of the color picker component.
|
|
140
|
+
* Accepts CSS width values (e.g., '350px').
|
|
141
|
+
*/
|
|
142
|
+
width?: string;
|
|
143
|
+
/**
|
|
144
|
+
* Preset colors for the color picker component.
|
|
145
|
+
* An array of color strings (e.g., ['#D0021B', '#F5A623']).
|
|
146
|
+
*/
|
|
147
|
+
colors?: string[];
|
|
128
148
|
};
|
|
129
149
|
type FieldGeneric<Type, List extends boolean | undefined, ExtraFieldUIProps = {}> = List extends true ? {
|
|
130
150
|
list: true;
|
|
@@ -558,6 +578,54 @@ export interface Config<CMSCallback = undefined, FormifyCallback = undefined, Do
|
|
|
558
578
|
loadCustomStore?: never;
|
|
559
579
|
accept?: string | string[];
|
|
560
580
|
};
|
|
581
|
+
/**
|
|
582
|
+
* Configuration for repository-related UI features.
|
|
583
|
+
*
|
|
584
|
+
* This allows you to configure how the CMS displays repository information
|
|
585
|
+
* and generates links to view file history in your Git provider (e.g., GitHub, GitLab).
|
|
586
|
+
*
|
|
587
|
+
* @example
|
|
588
|
+
*
|
|
589
|
+
* repoProvider: {
|
|
590
|
+
* defaultBranchName: 'main',
|
|
591
|
+
* historyUrl: ({ relativePath, branch }) => ({
|
|
592
|
+
* url: `https://github.com/owner/repo/commits/${branch}/${relativePath}`
|
|
593
|
+
* })
|
|
594
|
+
* }
|
|
595
|
+
* */
|
|
596
|
+
repoProvider?: {
|
|
597
|
+
/**
|
|
598
|
+
* The default branch name to use when in local mode or when no branch is specified.
|
|
599
|
+
* When not in local mode, TinaCMS will use the branch selected in the editor.
|
|
600
|
+
*
|
|
601
|
+
* This is typically your main/master branch name (e.g., "main", "master").
|
|
602
|
+
*/
|
|
603
|
+
defaultBranchName?: string;
|
|
604
|
+
/**
|
|
605
|
+
* A function that generates a URL to view the commit history for a specific file.
|
|
606
|
+
*
|
|
607
|
+
* This URL is used to link to your Git provider's history view (e.g., GitHub's commits page).
|
|
608
|
+
* The function receives the file's relative path and current branch, and should return
|
|
609
|
+
* a URL object with the full URL to the history page.
|
|
610
|
+
*
|
|
611
|
+
* @param context - Context object containing file and branch information
|
|
612
|
+
* @param context.relativePath - The relative path of the file from the repository root
|
|
613
|
+
* @param context.branch - The current branch name
|
|
614
|
+
* @returns An object with a `url` property containing the full URL to the history page
|
|
615
|
+
*
|
|
616
|
+
* @example
|
|
617
|
+
*s
|
|
618
|
+
* historyUrl: ({ relativePath, branch }) => ({
|
|
619
|
+
* url: `https://github.com/tinacms/tinacms/commits/${branch}/examples/next-2024/${relativePath}`
|
|
620
|
+
* })
|
|
621
|
+
* */
|
|
622
|
+
historyUrl?: (context: {
|
|
623
|
+
relativePath: string;
|
|
624
|
+
branch: string;
|
|
625
|
+
}) => {
|
|
626
|
+
url: string;
|
|
627
|
+
};
|
|
628
|
+
};
|
|
561
629
|
search?: ({
|
|
562
630
|
/**
|
|
563
631
|
* An instance of a search client like Algolia
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tinacms/schema-tools",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.1.0",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"ts-jest": "^29.2.5",
|
|
25
25
|
"typescript": "^5.7.3",
|
|
26
26
|
"yup": "^1.6.1",
|
|
27
|
-
"@tinacms/scripts": "1.4.
|
|
27
|
+
"@tinacms/scripts": "1.4.2"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"react": ">=16.14.0",
|