tinacms 0.0.0-c5dad82-20241009225242 → 0.0.0-c6a6335-20250416234606
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/README.md +1 -1
- package/dist/admin/api.d.ts +1 -0
- package/dist/admin/components/GetCollection.d.ts +2 -2
- package/dist/admin/types.d.ts +3 -0
- package/dist/auth/TinaCloudProvider.d.ts +1 -1
- package/dist/cache/node-cache.d.ts +1 -0
- package/dist/client.js +100 -62
- package/dist/client.mjs +59 -36
- package/dist/hooks/create-page-plugin.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3721 -2238
- package/dist/index.mjs +3712 -2228
- package/dist/internalClient/index.d.ts +3 -3
- package/dist/node-cache-5e8db9f0.mjs +63 -0
- package/dist/react.d.ts +1 -0
- package/dist/react.js +13 -1
- package/dist/react.mjs +13 -1
- package/dist/rich-text/index.d.ts +3 -0
- package/dist/rich-text/index.js +3 -1
- package/dist/rich-text/index.mjs +3 -1
- package/dist/toolkit/components/media/media-manager.d.ts +1 -1
- package/dist/toolkit/fields/components/reference/reference-select.d.ts +2 -2
- package/dist/toolkit/fields/plugins/mdx-field-plugin/index.d.ts +4 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/fixed-toolbar-buttons.d.ts +0 -4
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/icons.d.ts +2 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/indent-list-toolbar-button.d.ts +17 -5
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/mark-toolbar-button.d.ts +4 -18
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/mermaid-element.d.ts +11 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/mermaid-toolbar-button.d.ts +20 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/text-area.d.ts +5 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/index.d.ts +1 -1
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/custom/mermaid-plugin.d.ts +2 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/code-block/index.d.ts +4 -2
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/plugins/ui/components.d.ts +16 -11
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/toolbar/toolbar-overrides.d.ts +11 -3
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/toolbar/toolbar-provider.d.ts +3 -3
- package/dist/toolkit/fields/plugins/wrap-field-with-meta.d.ts +8 -0
- package/dist/toolkit/plugin-branch-switcher/branch-switcher-legacy.d.ts +1 -1
- package/dist/toolkit/plugin-branch-switcher/branch-switcher.d.ts +1 -1
- package/dist/toolkit/react-cloud-config/cloud-config-plugin.d.ts +3 -3
- package/dist/toolkit/react-sidebar/components/sidebar-body.d.ts +5 -4
- package/dist/toolkit/react-sidebar/components/sidebar-loading-placeholder.d.ts +2 -0
- package/dist/toolkit/react-sidebar/components/sidebar-no-forms-placeholder.d.ts +2 -0
- package/dist/toolkit/react-sidebar/sidebar.d.ts +2 -2
- package/dist/toolkit/tina-state.d.ts +4 -0
- package/dist/unifiedClient/index.d.ts +8 -1
- package/package.json +42 -41
- package/dist/__vite-browser-external-d06ac358.mjs +0 -4
- package/dist/node-cache-7fa2452c.mjs +0 -43
- package/dist/toolkit/react-sidebar/components/no-forms-placeholder.d.ts +0 -8
|
@@ -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;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
const makeCacheDir = async (dir, fs, path, os) => {
|
|
2
|
+
const pathParts = dir.split(path.sep).filter(Boolean);
|
|
3
|
+
const cacheHash = pathParts[pathParts.length - 1];
|
|
4
|
+
const rootUser = pathParts[0];
|
|
5
|
+
let cacheDir = dir;
|
|
6
|
+
if (!fs.existsSync(path.join(path.sep, rootUser))) {
|
|
7
|
+
cacheDir = path.join(os.tmpdir(), cacheHash);
|
|
8
|
+
}
|
|
9
|
+
try {
|
|
10
|
+
fs.mkdirSync(cacheDir, { recursive: true });
|
|
11
|
+
} catch (error) {
|
|
12
|
+
throw new Error(`Failed to create cache directory: ${error.message}`);
|
|
13
|
+
}
|
|
14
|
+
return cacheDir;
|
|
15
|
+
};
|
|
16
|
+
const NodeCache = async (dir) => {
|
|
17
|
+
const fs = require("node:fs");
|
|
18
|
+
const path = require("node:path");
|
|
19
|
+
const os = require("node:os");
|
|
20
|
+
const { createHash } = require("node:crypto");
|
|
21
|
+
const cacheDir = await makeCacheDir(dir, fs, path, os);
|
|
22
|
+
return {
|
|
23
|
+
makeKey: (key) => {
|
|
24
|
+
const input = key && key instanceof Object ? JSON.stringify(key) : key || "";
|
|
25
|
+
return createHash("sha256").update(input).digest("hex");
|
|
26
|
+
},
|
|
27
|
+
get: async (key) => {
|
|
28
|
+
let readValue;
|
|
29
|
+
const cacheFilename = `${cacheDir}/${key}`;
|
|
30
|
+
try {
|
|
31
|
+
const data = await fs.promises.readFile(cacheFilename, "utf-8");
|
|
32
|
+
readValue = JSON.parse(data);
|
|
33
|
+
} catch (e) {
|
|
34
|
+
if (e.code !== "ENOENT") {
|
|
35
|
+
console.error(
|
|
36
|
+
`Failed to read cache file to ${cacheFilename}: ${e.message}`
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return readValue;
|
|
41
|
+
},
|
|
42
|
+
set: async (key, value) => {
|
|
43
|
+
const cacheFilename = `${cacheDir}/${key}`;
|
|
44
|
+
try {
|
|
45
|
+
await fs.promises.writeFile(cacheFilename, JSON.stringify(value), {
|
|
46
|
+
encoding: "utf-8",
|
|
47
|
+
flag: "wx"
|
|
48
|
+
// Don't overwrite existing caches
|
|
49
|
+
});
|
|
50
|
+
} catch (e) {
|
|
51
|
+
if (e.code !== "EEXIST") {
|
|
52
|
+
console.error(
|
|
53
|
+
`Failed to write cache file to ${cacheFilename}: ${e.message}`
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
export {
|
|
61
|
+
NodeCache,
|
|
62
|
+
makeCacheDir
|
|
63
|
+
};
|
package/dist/react.d.ts
CHANGED
package/dist/react.js
CHANGED
|
@@ -18,6 +18,9 @@
|
|
|
18
18
|
React.useEffect(() => {
|
|
19
19
|
setIsClient(true);
|
|
20
20
|
setData(props.data);
|
|
21
|
+
parent.postMessage({
|
|
22
|
+
type: "url-changed"
|
|
23
|
+
});
|
|
21
24
|
}, [id]);
|
|
22
25
|
React.useEffect(() => {
|
|
23
26
|
if (quickEditEnabled) {
|
|
@@ -100,7 +103,16 @@
|
|
|
100
103
|
}
|
|
101
104
|
}, [quickEditEnabled, isInTinaIframe]);
|
|
102
105
|
React.useEffect(() => {
|
|
103
|
-
|
|
106
|
+
if (props == null ? void 0 : props.experimental___selectFormByFormId) {
|
|
107
|
+
parent.postMessage({
|
|
108
|
+
type: "user-select-form",
|
|
109
|
+
formId: props.experimental___selectFormByFormId()
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
}, [id]);
|
|
113
|
+
React.useEffect(() => {
|
|
114
|
+
const { experimental___selectFormByFormId, ...rest } = props;
|
|
115
|
+
parent.postMessage({ type: "open", ...rest, id }, window.location.origin);
|
|
104
116
|
window.addEventListener("message", (event) => {
|
|
105
117
|
if (event.data.type === "quickEditEnabled") {
|
|
106
118
|
setQuickEditEnabled(event.data.value);
|
package/dist/react.mjs
CHANGED
|
@@ -15,6 +15,9 @@ function useTina(props) {
|
|
|
15
15
|
React.useEffect(() => {
|
|
16
16
|
setIsClient(true);
|
|
17
17
|
setData(props.data);
|
|
18
|
+
parent.postMessage({
|
|
19
|
+
type: "url-changed"
|
|
20
|
+
});
|
|
18
21
|
}, [id]);
|
|
19
22
|
React.useEffect(() => {
|
|
20
23
|
if (quickEditEnabled) {
|
|
@@ -97,7 +100,16 @@ function useTina(props) {
|
|
|
97
100
|
}
|
|
98
101
|
}, [quickEditEnabled, isInTinaIframe]);
|
|
99
102
|
React.useEffect(() => {
|
|
100
|
-
|
|
103
|
+
if (props == null ? void 0 : props.experimental___selectFormByFormId) {
|
|
104
|
+
parent.postMessage({
|
|
105
|
+
type: "user-select-form",
|
|
106
|
+
formId: props.experimental___selectFormByFormId()
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
}, [id]);
|
|
110
|
+
React.useEffect(() => {
|
|
111
|
+
const { experimental___selectFormByFormId, ...rest } = props;
|
|
112
|
+
parent.postMessage({ type: "open", ...rest, id }, window.location.origin);
|
|
101
113
|
window.addEventListener("message", (event) => {
|
|
102
114
|
if (event.data.type === "quickEditEnabled") {
|
|
103
115
|
setQuickEditEnabled(event.data.value);
|
package/dist/rich-text/index.js
CHANGED
|
@@ -117,7 +117,8 @@
|
|
|
117
117
|
// @ts-ignore FIXME: TinaMarkdownContent needs to be a union of all possible node types
|
|
118
118
|
/* @__PURE__ */ React.createElement("a", { href: child.url }, /* @__PURE__ */ React.createElement(TinaMarkdown, { components, content: children }))
|
|
119
119
|
);
|
|
120
|
-
case "
|
|
120
|
+
case "mermaid":
|
|
121
|
+
case "code_block": {
|
|
121
122
|
const value = child.value;
|
|
122
123
|
if (components[child.type]) {
|
|
123
124
|
const Component2 = components[child.type];
|
|
@@ -127,6 +128,7 @@
|
|
|
127
128
|
);
|
|
128
129
|
}
|
|
129
130
|
return /* @__PURE__ */ React.createElement("pre", null, /* @__PURE__ */ React.createElement("code", null, value));
|
|
131
|
+
}
|
|
130
132
|
case "hr":
|
|
131
133
|
if (components[child.type]) {
|
|
132
134
|
const Component2 = components[child.type];
|
package/dist/rich-text/index.mjs
CHANGED
|
@@ -114,7 +114,8 @@ const Node = ({ components, child }) => {
|
|
|
114
114
|
// @ts-ignore FIXME: TinaMarkdownContent needs to be a union of all possible node types
|
|
115
115
|
/* @__PURE__ */ React.createElement("a", { href: child.url }, /* @__PURE__ */ React.createElement(TinaMarkdown, { components, content: children }))
|
|
116
116
|
);
|
|
117
|
-
case "
|
|
117
|
+
case "mermaid":
|
|
118
|
+
case "code_block": {
|
|
118
119
|
const value = child.value;
|
|
119
120
|
if (components[child.type]) {
|
|
120
121
|
const Component2 = components[child.type];
|
|
@@ -124,6 +125,7 @@ const Node = ({ components, child }) => {
|
|
|
124
125
|
);
|
|
125
126
|
}
|
|
126
127
|
return /* @__PURE__ */ React.createElement("pre", null, /* @__PURE__ */ React.createElement("code", null, value));
|
|
128
|
+
}
|
|
127
129
|
case "hr":
|
|
128
130
|
if (components[child.type]) {
|
|
129
131
|
const Component2 = components[child.type];
|
|
@@ -7,5 +7,5 @@ interface ReferenceSelectProps {
|
|
|
7
7
|
input: any;
|
|
8
8
|
field: ReferenceFieldProps & Field;
|
|
9
9
|
}
|
|
10
|
-
declare const
|
|
11
|
-
export default
|
|
10
|
+
declare const Combobox: React.FC<ReferenceSelectProps>;
|
|
11
|
+
export default Combobox;
|
|
@@ -2,16 +2,18 @@ import React from 'react';
|
|
|
2
2
|
import { type InputFieldType } from '../wrap-field-with-meta';
|
|
3
3
|
import type { MdxTemplate } from './plate/types';
|
|
4
4
|
import type { InputProps } from '../../../fields/components';
|
|
5
|
-
import type { ToolbarOverrideType } from './plate/toolbar/toolbar-overrides';
|
|
5
|
+
import type { ToolbarOverrides, ToolbarOverrideType } from './plate/toolbar/toolbar-overrides';
|
|
6
6
|
export type RichTextType = React.PropsWithChildren<InputFieldType<InputProps, {
|
|
7
7
|
templates: MdxTemplate[];
|
|
8
8
|
toolbarOverride?: ToolbarOverrideType[];
|
|
9
|
+
overrides?: ToolbarOverrides;
|
|
9
10
|
}>>;
|
|
10
11
|
export declare const MdxFieldPlugin: {
|
|
11
12
|
name: string;
|
|
12
13
|
Component: (props: InputFieldType<InputProps, {
|
|
13
14
|
templates: MdxTemplate[];
|
|
14
15
|
toolbarOverride?: ToolbarOverrideType[];
|
|
16
|
+
overrides?: ToolbarOverrides;
|
|
15
17
|
}>) => React.JSX.Element;
|
|
16
18
|
};
|
|
17
19
|
export declare const MdxFieldPluginExtendible: {
|
|
@@ -20,5 +22,6 @@ export declare const MdxFieldPluginExtendible: {
|
|
|
20
22
|
Component: (props: InputFieldType<InputProps, {
|
|
21
23
|
templates: MdxTemplate[];
|
|
22
24
|
toolbarOverride?: ToolbarOverrideType[];
|
|
25
|
+
overrides?: ToolbarOverrides;
|
|
23
26
|
}>) => React.JSX.Element;
|
|
24
27
|
};
|
|
@@ -33,6 +33,7 @@ export declare const Icons: {
|
|
|
33
33
|
chevronsUpDown: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
34
34
|
clear: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
35
35
|
close: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
36
|
+
paint: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
36
37
|
codeblock: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
37
38
|
color: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
38
39
|
column: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
@@ -55,6 +56,7 @@ export declare const Icons: {
|
|
|
55
56
|
kbd: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
56
57
|
lineHeight: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
57
58
|
minus: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
59
|
+
mermaid: () => React.JSX.Element;
|
|
58
60
|
more: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
59
61
|
outdent: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
60
62
|
paragraph: React.ForwardRefExoticComponent<Omit<LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
export declare const IndentListToolbarButton: React.ForwardRefExoticComponent<{
|
|
4
|
-
nodeType?: typeof ELEMENT_UL | typeof ELEMENT_OL;
|
|
5
|
-
} & Omit<Omit<{
|
|
2
|
+
export declare const UnorderedListToolbarButton: React.ForwardRefExoticComponent<Omit<Omit<{
|
|
6
3
|
tooltip?: React.ReactNode;
|
|
7
4
|
tooltipContentProps?: Omit<React.ComponentPropsWithoutRef<React.ForwardRefExoticComponent<import("@radix-ui/react-tooltip").TooltipContentProps & React.RefAttributes<HTMLDivElement>>>, "children">;
|
|
8
5
|
tooltipProps?: Omit<React.ComponentPropsWithoutRef<React.FC<import("@radix-ui/react-tooltip").TooltipProps>>, "children">;
|
|
@@ -16,4 +13,19 @@ export declare const IndentListToolbarButton: React.ForwardRefExoticComponent<{
|
|
|
16
13
|
} & import("class-variance-authority/dist/types").ClassProp) => string> & React.RefAttributes<HTMLButtonElement>, "ref">, "value" | "asChild"> & import("class-variance-authority").VariantProps<(props?: {
|
|
17
14
|
size?: "default" | "sm" | "lg";
|
|
18
15
|
variant?: "default" | "outline";
|
|
19
|
-
} & import("class-variance-authority/dist/types").ClassProp) => string> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref">,
|
|
16
|
+
} & import("class-variance-authority/dist/types").ClassProp) => string> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref">, never> & React.RefAttributes<HTMLButtonElement>>;
|
|
17
|
+
export declare const OrderedListToolbarButton: React.ForwardRefExoticComponent<Omit<Omit<{
|
|
18
|
+
tooltip?: React.ReactNode;
|
|
19
|
+
tooltipContentProps?: Omit<React.ComponentPropsWithoutRef<React.ForwardRefExoticComponent<import("@radix-ui/react-tooltip").TooltipContentProps & React.RefAttributes<HTMLDivElement>>>, "children">;
|
|
20
|
+
tooltipProps?: Omit<React.ComponentPropsWithoutRef<React.FC<import("@radix-ui/react-tooltip").TooltipProps>>, "children">;
|
|
21
|
+
} & Omit<{
|
|
22
|
+
isDropdown?: boolean;
|
|
23
|
+
pressed?: boolean;
|
|
24
|
+
showArrow?: boolean;
|
|
25
|
+
} & Omit<Omit<Omit<import("@radix-ui/react-toolbar").ToolbarToggleItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & import("class-variance-authority").VariantProps<(props?: {
|
|
26
|
+
size?: "default" | "sm" | "lg";
|
|
27
|
+
variant?: "default" | "outline";
|
|
28
|
+
} & import("class-variance-authority/dist/types").ClassProp) => string> & React.RefAttributes<HTMLButtonElement>, "ref">, "value" | "asChild"> & import("class-variance-authority").VariantProps<(props?: {
|
|
29
|
+
size?: "default" | "sm" | "lg";
|
|
30
|
+
variant?: "default" | "outline";
|
|
31
|
+
} & import("class-variance-authority/dist/types").ClassProp) => string> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref">, never> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -1,19 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
tooltip?: React.ReactNode;
|
|
7
|
-
tooltipContentProps?: Omit<React.ComponentPropsWithoutRef<React.ForwardRefExoticComponent<import("@radix-ui/react-tooltip").TooltipContentProps & React.RefAttributes<HTMLDivElement>>>, "children">;
|
|
8
|
-
tooltipProps?: Omit<React.ComponentPropsWithoutRef<React.FC<import("@radix-ui/react-tooltip").TooltipProps>>, "children">;
|
|
9
|
-
} & Omit<{
|
|
10
|
-
isDropdown?: boolean;
|
|
11
|
-
pressed?: boolean;
|
|
12
|
-
showArrow?: boolean;
|
|
13
|
-
} & Omit<Omit<Omit<import("@radix-ui/react-toolbar").ToolbarToggleItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & import("class-variance-authority").VariantProps<(props?: {
|
|
14
|
-
size?: "default" | "sm" | "lg";
|
|
15
|
-
variant?: "default" | "outline";
|
|
16
|
-
} & import("class-variance-authority/dist/types").ClassProp) => string> & React.RefAttributes<HTMLButtonElement>, "ref">, "value" | "asChild"> & import("class-variance-authority").VariantProps<(props?: {
|
|
17
|
-
size?: "default" | "sm" | "lg";
|
|
18
|
-
variant?: "default" | "outline";
|
|
19
|
-
} & import("class-variance-authority/dist/types").ClassProp) => string> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref">, "clear" | "nodeType"> & React.RefAttributes<HTMLButtonElement>>;
|
|
2
|
+
export declare const BoldToolbarButton: () => React.JSX.Element;
|
|
3
|
+
export declare const StrikethroughToolbarButton: () => React.JSX.Element;
|
|
4
|
+
export declare const ItalicToolbarButton: () => React.JSX.Element;
|
|
5
|
+
export declare const CodeToolbarButton: () => React.JSX.Element;
|
package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/mermaid-element.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const MermaidElement: React.ForwardRefExoticComponent<Omit<Omit<{
|
|
3
|
+
elementToAttributes?: (element: import("@udecode/plate-common").TElement) => any;
|
|
4
|
+
} & Omit<{
|
|
5
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
6
|
+
asChild?: boolean | undefined;
|
|
7
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<any>, "ref"> & {
|
|
8
|
+
ref?: React.Ref<any>;
|
|
9
|
+
} & import("@udecode/plate-common").PlateRenderNodeProps<import("@udecode/plate-common").Value, import("@udecode/plate-common").PlateEditor<import("@udecode/plate-common").Value>> & {
|
|
10
|
+
element: import("@udecode/plate-common").TElement;
|
|
11
|
+
} & Omit<import("slate-react").RenderElementProps, "element"> & React.RefAttributes<HTMLDivElement>, "ref">, never> & React.RefAttributes<any>>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type PlateEditor } from '@udecode/plate-common';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare const insertEmptyMermaid: (editor: PlateEditor) => void;
|
|
4
|
+
export declare const MermaidToolbarButton: React.ForwardRefExoticComponent<{
|
|
5
|
+
clear?: string | string[];
|
|
6
|
+
} & Omit<Omit<{
|
|
7
|
+
tooltip?: React.ReactNode;
|
|
8
|
+
tooltipContentProps?: Omit<React.ComponentPropsWithoutRef<React.ForwardRefExoticComponent<import("@radix-ui/react-tooltip").TooltipContentProps & React.RefAttributes<HTMLDivElement>>>, "children">;
|
|
9
|
+
tooltipProps?: Omit<React.ComponentPropsWithoutRef<React.FC<import("@radix-ui/react-tooltip").TooltipProps>>, "children">;
|
|
10
|
+
} & Omit<{
|
|
11
|
+
isDropdown?: boolean;
|
|
12
|
+
pressed?: boolean;
|
|
13
|
+
showArrow?: boolean;
|
|
14
|
+
} & Omit<Omit<Omit<import("@radix-ui/react-toolbar").ToolbarToggleItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & import("class-variance-authority").VariantProps<(props?: {
|
|
15
|
+
size?: "default" | "sm" | "lg";
|
|
16
|
+
variant?: "default" | "outline";
|
|
17
|
+
} & import("class-variance-authority/dist/types").ClassProp) => string> & React.RefAttributes<HTMLButtonElement>, "ref">, "value" | "asChild"> & import("class-variance-authority").VariantProps<(props?: {
|
|
18
|
+
size?: "default" | "sm" | "lg";
|
|
19
|
+
variant?: "default" | "outline";
|
|
20
|
+
} & import("class-variance-authority/dist/types").ClassProp) => string> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref">, "clear"> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const ELEMENT_MERMAID = "mermaid";
|
|
2
|
+
export declare const createMermaidPlugin: <OP = import("@udecode/plate-common").AnyObject, OV extends import("@udecode/plate-common").Value = import("@udecode/plate-common").Value, OE extends import("@udecode/plate-common").PlateEditor<OV> = import("@udecode/plate-common").PlateEditor<OV>>(override?: Partial<import("@udecode/plate-common").PlatePlugin<import("@udecode/plate-common").NoInfer<OP>, OV, OE>>, overrideByKey?: import("@udecode/plate-common").OverrideByKey<OV, OE>) => import("@udecode/plate-common").PlatePlugin<import("@udecode/plate-common").NoInfer<OP>, OV, OE>;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { type PlateEditor, type TElement } from '@udecode/plate-common';
|
|
3
|
-
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare const CodeBlock: ({ attributes, editor, element, language: restrictLanguage, onChangeCallback, defaultValue, ...props }: {
|
|
4
4
|
attributes: Record<string, unknown>;
|
|
5
5
|
element: TElement;
|
|
6
6
|
editor: PlateEditor;
|
|
7
7
|
language?: string;
|
|
8
8
|
children: React.ReactNode;
|
|
9
|
+
defaultValue?: unknown;
|
|
10
|
+
onChangeCallback?: (value: string) => void;
|
|
9
11
|
}) => React.JSX.Element;
|
|
@@ -60,6 +60,16 @@ export declare const Components: () => {
|
|
|
60
60
|
editor: any;
|
|
61
61
|
element: any;
|
|
62
62
|
}) => React.JSX.Element;
|
|
63
|
+
mermaid: React.ForwardRefExoticComponent<Omit<Omit<{
|
|
64
|
+
elementToAttributes?: (element: import("@udecode/plate-common").TElement) => any;
|
|
65
|
+
} & Omit<{
|
|
66
|
+
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
67
|
+
asChild?: boolean | undefined;
|
|
68
|
+
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<any>, "ref"> & {
|
|
69
|
+
ref?: React.Ref<any>;
|
|
70
|
+
} & import("@udecode/plate-common").PlateRenderNodeProps<import("@udecode/plate-common").Value, import("@udecode/plate-common").PlateEditor<import("@udecode/plate-common").Value>> & {
|
|
71
|
+
element: import("@udecode/plate-common").TElement;
|
|
72
|
+
} & Omit<import("slate-react").RenderElementProps, "element"> & React.RefAttributes<HTMLDivElement>, "ref">, never> & React.RefAttributes<any>>;
|
|
63
73
|
blockquote: React.ForwardRefExoticComponent<Omit<Omit<{
|
|
64
74
|
elementToAttributes?: (element: import("@udecode/plate-common").TElement) => any;
|
|
65
75
|
} & Omit<{
|
|
@@ -179,17 +189,12 @@ export declare const Components: () => {
|
|
|
179
189
|
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & React.RefAttributes<any>, "ref"> & {
|
|
180
190
|
ref?: React.Ref<any>;
|
|
181
191
|
} & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<any>>;
|
|
182
|
-
strikethrough:
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
leaf:
|
|
186
|
-
text:
|
|
187
|
-
}
|
|
188
|
-
as?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
|
|
189
|
-
asChild?: boolean | undefined;
|
|
190
|
-
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & React.RefAttributes<any>, "ref"> & {
|
|
191
|
-
ref?: React.Ref<any>;
|
|
192
|
-
} & React.RefAttributes<HTMLSpanElement>, "ref"> & React.RefAttributes<any>>;
|
|
192
|
+
strikethrough: ({ editor, leaf, text, ...props }: {
|
|
193
|
+
[x: string]: any;
|
|
194
|
+
editor: any;
|
|
195
|
+
leaf: any;
|
|
196
|
+
text: any;
|
|
197
|
+
}) => React.JSX.Element;
|
|
193
198
|
italic: React.ForwardRefExoticComponent<Omit<{
|
|
194
199
|
leafToAttributes?: (leaf: import("@udecode/plate-common").TText) => any;
|
|
195
200
|
} & import("@udecode/plate-common").PlateRenderNodeProps<import("@udecode/plate-common").Value, import("@udecode/plate-common").PlateEditor<import("@udecode/plate-common").Value>> & Omit<import("slate-react").RenderLeafProps, "text" | "leaf"> & {
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
export type ToolbarOverrideType = 'heading' | 'link' | 'image' | 'quote' | 'ul' | 'ol' | 'code' | 'codeBlock' | 'bold' | 'italic' | 'raw' | 'embed' | 'table';
|
|
2
|
-
export declare const
|
|
1
|
+
export type ToolbarOverrideType = 'heading' | 'link' | 'image' | 'quote' | 'ul' | 'ol' | 'code' | 'codeBlock' | 'bold' | 'strikethrough' | 'italic' | 'mermaid' | 'raw' | 'embed' | 'table';
|
|
2
|
+
export declare const STANDARD_ICON_WIDTH = 32;
|
|
3
|
+
export declare const HEADING_ICON_WITH_TEXT = 127;
|
|
4
|
+
export declare const HEADING_ICON_ONLY = 58;
|
|
3
5
|
export declare const EMBED_ICON_WIDTH = 78;
|
|
4
|
-
export declare const
|
|
6
|
+
export declare const CONTAINER_MD_BREAKPOINT = 448;
|
|
7
|
+
export declare const FLOAT_BUTTON_WIDTH = 25;
|
|
8
|
+
export declare const HEADING_LABEL = "Headings";
|
|
9
|
+
export type ToolbarOverrides = {
|
|
10
|
+
toolbar?: ToolbarOverrideType[];
|
|
11
|
+
showFloatingToolbar?: boolean;
|
|
12
|
+
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type ReactNode } from 'react';
|
|
3
|
-
import type { MdxTemplate } from '../types';
|
|
4
3
|
import type { Form } from '../../../../../forms';
|
|
5
|
-
import type {
|
|
4
|
+
import type { MdxTemplate } from '../types';
|
|
5
|
+
import type { ToolbarOverrides, ToolbarOverrideType } from './toolbar-overrides';
|
|
6
6
|
interface ToolbarContextProps {
|
|
7
7
|
tinaForm: Form;
|
|
8
8
|
templates: MdxTemplate[];
|
|
9
|
-
overrides: ToolbarOverrideType[];
|
|
9
|
+
overrides: ToolbarOverrideType[] | ToolbarOverrides;
|
|
10
10
|
}
|
|
11
11
|
interface ToolbarProviderProps extends ToolbarContextProps {
|
|
12
12
|
children: ReactNode;
|
|
@@ -3,6 +3,14 @@ import { FieldProps } from './field-props';
|
|
|
3
3
|
import { Form } from '../../forms';
|
|
4
4
|
export type InputFieldType<ExtraFieldProps, InputProps> = FieldProps<InputProps> & ExtraFieldProps;
|
|
5
5
|
export declare function wrapFieldsWithMeta<ExtraFieldProps = {}, InputProps = {}>(Field: React.FunctionComponent<InputFieldType<ExtraFieldProps, InputProps>> | React.ComponentClass<InputFieldType<ExtraFieldProps, InputProps>>): (props: InputFieldType<ExtraFieldProps, InputProps>) => React.JSX.Element;
|
|
6
|
+
/**
|
|
7
|
+
* Same as wrapFieldsWithMeta but excludes the label, and description useful for fields that render their label and description
|
|
8
|
+
*/
|
|
9
|
+
export declare function wrapFieldWithNoHeader<ExtraFieldProps = {}, InputProps = {}>(Field: React.FunctionComponent<InputFieldType<ExtraFieldProps, InputProps>> | React.ComponentClass<InputFieldType<ExtraFieldProps, InputProps>>): (props: InputFieldType<ExtraFieldProps, InputProps>) => React.JSX.Element;
|
|
10
|
+
/**
|
|
11
|
+
* Same as above but excludes the label, useful for fields that have their own label
|
|
12
|
+
* @deprecated This function is deprecated and will be removed in future versions.
|
|
13
|
+
*/
|
|
6
14
|
export declare function wrapFieldWithError<ExtraFieldProps = {}, InputProps = {}>(Field: React.FunctionComponent<InputFieldType<ExtraFieldProps, InputProps>> | React.ComponentClass<InputFieldType<ExtraFieldProps, InputProps>>): (props: InputFieldType<ExtraFieldProps, InputProps>) => React.JSX.Element;
|
|
7
15
|
interface FieldMetaProps extends React.HTMLAttributes<HTMLElement> {
|
|
8
16
|
name: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
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 {
|
|
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
|
|
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
|
|
7
|
+
* about TinaCloud Configuration
|
|
8
8
|
* cases may include:
|
|
9
9
|
*
|
|
10
|
-
* *
|
|
10
|
+
* * TinaCloud Project Configuration
|
|
11
11
|
* * User Management
|
|
12
12
|
*/
|
|
13
13
|
export interface CloudConfigPlugin extends Plugin {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import type { Form } from '../../forms';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export interface FormsViewProps {
|
|
4
|
+
loadingPlaceholder?: React.FC;
|
|
5
|
+
}
|
|
6
|
+
export declare const FormsView: ({ loadingPlaceholder }?: FormsViewProps) => React.JSX.Element;
|
|
6
7
|
export interface MultiformFormHeaderProps {
|
|
7
8
|
activeForm: {
|
|
8
9
|
activeFieldName?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EventBus, Callback } from '../core';
|
|
2
1
|
import * as React from 'react';
|
|
2
|
+
import { Callback, EventBus } from '../core';
|
|
3
3
|
export interface SidebarStateOptions {
|
|
4
4
|
position?: SidebarPosition;
|
|
5
5
|
buttons?: SidebarButtons;
|
|
@@ -22,7 +22,7 @@ export declare type DefaultSidebarState = 'open' | 'closed';
|
|
|
22
22
|
export declare class SidebarState {
|
|
23
23
|
private events;
|
|
24
24
|
private _isOpen;
|
|
25
|
-
|
|
25
|
+
loadingPlaceholder: React.FC;
|
|
26
26
|
defaultState: DefaultSidebarState;
|
|
27
27
|
position: SidebarPosition;
|
|
28
28
|
renderNav: boolean;
|
|
@@ -58,6 +58,9 @@ export type TinaAction = {
|
|
|
58
58
|
} | {
|
|
59
59
|
type: 'sidebar:set-display-state';
|
|
60
60
|
value: TinaState['sidebarDisplayState'] | 'openOrFull';
|
|
61
|
+
} | {
|
|
62
|
+
type: 'sidebar:set-loading-state';
|
|
63
|
+
value: boolean;
|
|
61
64
|
};
|
|
62
65
|
export interface TinaState {
|
|
63
66
|
activeFormId: string | null;
|
|
@@ -76,6 +79,7 @@ export interface TinaState {
|
|
|
76
79
|
}[];
|
|
77
80
|
formLists: FormList[];
|
|
78
81
|
editingMode: 'visual' | 'basic';
|
|
82
|
+
isLoadingContent: boolean;
|
|
79
83
|
quickEditSupported: boolean;
|
|
80
84
|
sidebarDisplayState: 'closed' | 'open' | 'fullscreen';
|
|
81
85
|
}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { Config } from '@tinacms/schema-tools';
|
|
2
|
+
import AsyncLock from 'async-lock';
|
|
3
|
+
import type { GraphQLError } from 'graphql';
|
|
2
4
|
import type { Cache } from '../cache/index';
|
|
3
5
|
export declare const TINA_HOST = "content.tinajs.io";
|
|
4
6
|
export interface TinaClientArgs<GenQueries = Record<string, unknown>> {
|
|
@@ -25,12 +27,17 @@ export declare class TinaClient<GenQueries> {
|
|
|
25
27
|
queries: GenQueries;
|
|
26
28
|
errorPolicy: Config['client']['errorPolicy'];
|
|
27
29
|
initialized: boolean;
|
|
30
|
+
cacheLock: AsyncLock | undefined;
|
|
28
31
|
cacheDir: string;
|
|
29
32
|
cache: Cache;
|
|
30
33
|
constructor({ token, url, queries, errorPolicy, cacheDir, }: TinaClientArgs<GenQueries>);
|
|
31
34
|
init(): Promise<void>;
|
|
32
35
|
request<DataType extends Record<string, any> = any>({ errorPolicy, ...args }: TinaClientRequestArgs, options: {
|
|
33
36
|
fetchOptions?: Parameters<typeof fetch>[1];
|
|
34
|
-
}): Promise<
|
|
37
|
+
}): Promise<{
|
|
38
|
+
data: DataType;
|
|
39
|
+
errors: GraphQLError[] | null;
|
|
40
|
+
query: string;
|
|
41
|
+
}>;
|
|
35
42
|
}
|
|
36
43
|
export declare function createClient<GenQueries>(args: TinaClientArgs<GenQueries>): TinaClient<GenQueries>;
|