tinacms 2.7.4 → 2.7.5

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.
@@ -1,10 +1,10 @@
1
- import { TokenObject } from '../auth/authenticate';
2
1
  import { BranchData, EventBus } from '@tinacms/toolkit';
3
2
  import { DocumentNode, GraphQLSchema } from 'graphql';
3
+ import { TokenObject } from '../auth/authenticate';
4
+ import { AuthProvider, Schema, TinaSchema } from '@tinacms/schema-tools';
5
+ import { SearchClient } from '@tinacms/search/dist/index-client';
4
6
  import gql from 'graphql-tag';
5
- import { TinaSchema, Schema, AuthProvider } from '@tinacms/schema-tools';
6
7
  import { TinaCloudProject } from './types';
7
- import { SearchClient } from '@tinacms/search/dist/index-client';
8
8
  export * from './authProvider';
9
9
  export type OnLoginFunc = (args: {
10
10
  token?: TokenObject;
package/dist/react.d.ts CHANGED
@@ -1 +1,34 @@
1
- export * from "../src/react"
1
+ export declare function useTina<T extends object>(props: {
2
+ query: string;
3
+ variables: object;
4
+ data: T;
5
+ experimental___selectFormByFormId?: () => string | false | undefined;
6
+ }): {
7
+ data: T;
8
+ isClient: boolean;
9
+ };
10
+ export declare function useEditState(): {
11
+ edit: boolean;
12
+ };
13
+ /**
14
+ * Grab the field name for the given attribute
15
+ * to signal to Tina which DOM element the field
16
+ * is working with.
17
+ */
18
+ export declare const tinaField: <T extends (object & {
19
+ _content_source?: {
20
+ queryId: string;
21
+ path: (number | string)[];
22
+ };
23
+ }) | undefined | null>(object: T, property?: keyof Omit<NonNullable<T>, "__typename" | "_sys">, index?: number) => string;
24
+ export declare const addMetadata: <T extends object>(id: string, object: T & {
25
+ type?: string;
26
+ _content_source?: unknown;
27
+ }, path: (string | number)[]) => T;
28
+ /**
29
+ * This is a pretty rudimentary approach to hashing the query and variables to
30
+ * ensure we treat multiple queries on the page uniquely. It's possible
31
+ * that we would have collisions, and I'm not sure of the likeliness but seems
32
+ * like it'd be rare.
33
+ */
34
+ export declare const hashFromQuery: (input: string) => string;
@@ -1 +1,142 @@
1
- export * from "../../src/rich-text/index"
1
+ /**
2
+
3
+ */
4
+ import React from 'react';
5
+ type BaseComponents = {
6
+ h1?: {
7
+ children: JSX.Element;
8
+ };
9
+ h2?: {
10
+ children: JSX.Element;
11
+ };
12
+ h3?: {
13
+ children: JSX.Element;
14
+ };
15
+ h4?: {
16
+ children: JSX.Element;
17
+ };
18
+ h5?: {
19
+ children: JSX.Element;
20
+ };
21
+ h6?: {
22
+ children: JSX.Element;
23
+ };
24
+ p?: {
25
+ children: JSX.Element;
26
+ };
27
+ a?: {
28
+ url: string;
29
+ children: JSX.Element;
30
+ };
31
+ italic?: {
32
+ children: JSX.Element;
33
+ };
34
+ bold?: {
35
+ children: JSX.Element;
36
+ };
37
+ strikethrough?: {
38
+ children: JSX.Element;
39
+ };
40
+ underline?: {
41
+ children: JSX.Element;
42
+ };
43
+ code?: {
44
+ children: JSX.Element;
45
+ };
46
+ text?: {
47
+ children: string;
48
+ };
49
+ ul?: {
50
+ children: JSX.Element;
51
+ };
52
+ ol?: {
53
+ children: JSX.Element;
54
+ };
55
+ li?: {
56
+ children: JSX.Element;
57
+ };
58
+ lic?: {
59
+ children: JSX.Element;
60
+ };
61
+ block_quote?: {
62
+ children: JSX.Element;
63
+ };
64
+ code_block?: {
65
+ lang?: string;
66
+ value: string;
67
+ };
68
+ mermaid?: {
69
+ value: string;
70
+ };
71
+ img?: {
72
+ url: string;
73
+ caption?: string;
74
+ alt?: string;
75
+ };
76
+ hr?: {};
77
+ break?: {};
78
+ maybe_mdx?: {
79
+ children: JSX.Element;
80
+ };
81
+ html?: {
82
+ value: string;
83
+ };
84
+ html_inline?: {
85
+ value: string;
86
+ };
87
+ table?: {
88
+ align?: ('left' | 'right' | 'center')[];
89
+ tableRows: {
90
+ tableCells: {
91
+ value: TinaMarkdownContent;
92
+ }[];
93
+ }[];
94
+ };
95
+ component_missing?: {
96
+ name: string;
97
+ };
98
+ };
99
+ type BaseComponentSignature = {
100
+ [BK in keyof BaseComponents]: (props: BaseComponents[BK]) => JSX.Element;
101
+ };
102
+ /**
103
+ * Define the allowed components and their props
104
+ * ```ts
105
+ * const components:
106
+ * Components<{
107
+ * BlockQuote: {
108
+ * children: TinaMarkdownContent;
109
+ * authorName: string;
110
+ * };
111
+ * }> = {
112
+ * BlockQuote: (props: {
113
+ * children: TinaMarkdownContent;
114
+ * authorName: string;
115
+ * }) => {
116
+ * return (
117
+ * <div>
118
+ * <blockquote>
119
+ * <TinaMarkdown content={props.children} />
120
+ * {props.authorName}
121
+ * </blockquote>
122
+ * </div>
123
+ * );
124
+ * }
125
+ * }
126
+ * }
127
+ * ```
128
+ */
129
+ export type Components<ComponentAndProps extends object> = {
130
+ [K in keyof ComponentAndProps]: (props: ComponentAndProps[K]) => JSX.Element;
131
+ } & BaseComponentSignature;
132
+ export type TinaMarkdownContent = {
133
+ type: string;
134
+ children: TinaMarkdownContent[];
135
+ };
136
+ export declare const TinaMarkdown: <CustomComponents extends {
137
+ [key: string]: object;
138
+ } = any>({ content, components, }: {
139
+ content: TinaMarkdownContent | TinaMarkdownContent[];
140
+ components?: Components<{}> | Components<{ [BK in keyof CustomComponents]: (props: CustomComponents[BK]) => JSX.Element; }>;
141
+ }) => React.JSX.Element;
142
+ export {};
@@ -1 +1,10 @@
1
- export * from "../../src/rich-text/prism"
1
+ /**
2
+
3
+ */
4
+ import React from 'react';
5
+ import { themes } from 'prism-react-renderer';
6
+ export declare const Prism: (props: {
7
+ value: string;
8
+ lang?: string;
9
+ theme?: keyof typeof themes;
10
+ }) => React.JSX.Element;
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
1
  import { Media } from '../../core';
2
+ import React from 'react';
3
3
  export interface MediaRequest {
4
4
  directory?: string;
5
5
  onSelect?(_media: Media): void;
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { BranchSwitcherProps, Branch } from './types';
2
+ import { Branch, BranchSwitcherProps } from './types';
3
3
  export declare function formatBranchName(str: string): string;
4
4
  export declare const BranchSwitcherLegacy: ({ listBranches, createBranch, chooseBranch, }: BranchSwitcherProps) => React.JSX.Element;
5
5
  export declare const getFilteredBranchList: (branchList: Branch[], filter: string, currentBranchName: string) => Branch[];
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { BranchSwitcherProps, Branch } from './types';
2
+ import { Branch, BranchSwitcherProps } from './types';
3
3
  export declare function formatBranchName(str: string): string;
4
4
  export declare const BranchSwitcher: (props: BranchSwitcherProps) => React.JSX.Element;
5
5
  export declare const EditoralBranchSwitcher: ({ listBranches, createBranch, chooseBranch, setModalTitle, }: BranchSwitcherProps) => React.JSX.Element;
@@ -1,13 +1,13 @@
1
1
  import { Plugin } from '../core';
2
2
  import type { IconType } from 'react-icons';
3
3
  /**
4
- * Represents a Tina Cloud Config that should be accessible via the CMS.
4
+ * Represents a TinaCloud Config that should be accessible via the CMS.
5
5
  *
6
6
  * The purpose of these configs is to give a way to display & edit information
7
- * about TIna Cloud Configuration
7
+ * about TinaCloud Configuration
8
8
  * cases may include:
9
9
  *
10
- * * Tina Cloud Project Configuration
10
+ * * TinaCloud Project Configuration
11
11
  * * User Management
12
12
  */
13
13
  export interface CloudConfigPlugin extends Plugin {
@@ -1,6 +1,6 @@
1
+ import type { Config } from '@tinacms/schema-tools';
1
2
  import AsyncLock from 'async-lock';
2
3
  import type { GraphQLError } from 'graphql';
3
- import type { Config } from '@tinacms/schema-tools';
4
4
  import type { Cache } from '../cache/index';
5
5
  export declare const TINA_HOST = "content.tinajs.io";
6
6
  export interface TinaClientArgs<GenQueries = Record<string, unknown>> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tinacms",
3
- "version": "2.7.4",
3
+ "version": "2.7.5",
4
4
  "main": "dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "exports": {
@@ -129,9 +129,9 @@
129
129
  "webfontloader": "1.6.28",
130
130
  "yup": "^1.6.1",
131
131
  "zod": "^3.24.2",
132
- "@tinacms/mdx": "1.6.1",
133
- "@tinacms/schema-tools": "1.7.2",
134
- "@tinacms/search": "1.0.42"
132
+ "@tinacms/mdx": "1.6.2",
133
+ "@tinacms/schema-tools": "1.7.3",
134
+ "@tinacms/search": "1.0.43"
135
135
  },
136
136
  "devDependencies": {
137
137
  "@graphql-tools/utils": "^10.8.1",
@@ -164,7 +164,7 @@
164
164
  "typescript": "^5.7.3",
165
165
  "vite": "^5.4.14",
166
166
  "vitest": "^2.1.9",
167
- "@tinacms/scripts": "1.3.3"
167
+ "@tinacms/scripts": "1.3.4"
168
168
  },
169
169
  "peerDependencies": {
170
170
  "react": ">=16.14.0",