tinacms 0.0.0-b4c6a60-20241010070518 → 0.0.0-b54b303-20241210232138
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/types.d.ts +3 -0
- package/dist/cache/node-cache.d.ts +1 -0
- package/dist/client.js +18 -16
- package/dist/client.mjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +151 -37
- package/dist/index.mjs +151 -37
- package/dist/{node-cache-7fa2452c.mjs → node-cache-4c336858.mjs} +18 -11
- package/dist/toolkit/fields/plugins/wrap-field-with-meta.d.ts +8 -0
- package/package.json +26 -26
- package/dist/__vite-browser-external-d06ac358.mjs +0 -4
package/dist/admin/types.d.ts
CHANGED
package/dist/client.js
CHANGED
|
@@ -105,21 +105,27 @@
|
|
|
105
105
|
const client = new TinaClient(args);
|
|
106
106
|
return client;
|
|
107
107
|
}
|
|
108
|
-
const makeCacheDir = async (dir, fs) => {
|
|
109
|
-
const
|
|
110
|
-
const
|
|
111
|
-
const
|
|
108
|
+
const makeCacheDir = async (dir, fs, path, os) => {
|
|
109
|
+
const pathParts = dir.split(path.sep).filter(Boolean);
|
|
110
|
+
const cacheHash = pathParts[pathParts.length - 1];
|
|
111
|
+
const rootUser = pathParts[0];
|
|
112
112
|
let cacheDir = dir;
|
|
113
|
-
if (!fs.existsSync(path.join(path.sep,
|
|
114
|
-
cacheDir = path.join(os.tmpdir(),
|
|
113
|
+
if (!fs.existsSync(path.join(path.sep, rootUser))) {
|
|
114
|
+
cacheDir = path.join(os.tmpdir(), cacheHash);
|
|
115
|
+
}
|
|
116
|
+
try {
|
|
117
|
+
fs.mkdirSync(cacheDir, { recursive: true });
|
|
118
|
+
} catch (error) {
|
|
119
|
+
throw new Error(`Failed to create cache directory: ${error.message}`);
|
|
115
120
|
}
|
|
116
|
-
fs.mkdirSync(cacheDir, { recursive: true });
|
|
117
121
|
return cacheDir;
|
|
118
122
|
};
|
|
119
123
|
const NodeCache = async (dir) => {
|
|
120
|
-
const fs =
|
|
121
|
-
const
|
|
122
|
-
const
|
|
124
|
+
const fs = require("node:fs");
|
|
125
|
+
const path = require("node:path");
|
|
126
|
+
const os = require("node:os");
|
|
127
|
+
const { createHash } = require("node:crypto");
|
|
128
|
+
const cacheDir = await makeCacheDir(dir, fs, path, os);
|
|
123
129
|
return {
|
|
124
130
|
makeKey: (key) => {
|
|
125
131
|
const input = key && key instanceof Object ? JSON.stringify(key) : key || "";
|
|
@@ -147,12 +153,8 @@
|
|
|
147
153
|
};
|
|
148
154
|
const nodeCache = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
149
155
|
__proto__: null,
|
|
150
|
-
NodeCache
|
|
151
|
-
|
|
152
|
-
const __viteBrowserExternal = {};
|
|
153
|
-
const __viteBrowserExternal$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
154
|
-
__proto__: null,
|
|
155
|
-
default: __viteBrowserExternal
|
|
156
|
+
NodeCache,
|
|
157
|
+
makeCacheDir
|
|
156
158
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
157
159
|
exports2.TINA_HOST = TINA_HOST;
|
|
158
160
|
exports2.TinaClient = TinaClient;
|
package/dist/client.mjs
CHANGED
|
@@ -24,7 +24,7 @@ class TinaClient {
|
|
|
24
24
|
}
|
|
25
25
|
try {
|
|
26
26
|
if (this.cacheDir && typeof window === "undefined" && typeof require !== "undefined") {
|
|
27
|
-
const { NodeCache } = await import("./node-cache-
|
|
27
|
+
const { NodeCache } = await import("./node-cache-4c336858.mjs");
|
|
28
28
|
this.cache = await NodeCache(this.cacheDir);
|
|
29
29
|
}
|
|
30
30
|
} catch (e) {
|
package/dist/index.d.ts
CHANGED
|
@@ -53,7 +53,7 @@ export type TinaCollection = Collection;
|
|
|
53
53
|
export type TinaCloudSchema = Schema;
|
|
54
54
|
export declare const defineSchema: (config: Schema) => Schema<false>;
|
|
55
55
|
export declare const defineLegacyConfig: (config: Omit<TinaCMSProviderDefaultProps, "children">) => Omit<TinaCMSProviderDefaultProps, "children">;
|
|
56
|
-
interface MediaStoreClass {
|
|
56
|
+
export interface MediaStoreClass {
|
|
57
57
|
new (...args: any[]): MediaStore;
|
|
58
58
|
}
|
|
59
59
|
export declare const defineStaticConfig: (config: Config<(cms: TinaCMS) => TinaCMS, formifyCallback, DocumentCreatorCallback, MediaStoreClass>) => Config<(cms: TinaCMS) => TinaCMS, formifyCallback, import("./hooks/use-content-creator").DocumentCreatorArgs, MediaStoreClass, undefined>;
|
package/dist/index.js
CHANGED
|
@@ -774,6 +774,22 @@ var __publicField = (obj, key, value) => {
|
|
|
774
774
|
);
|
|
775
775
|
};
|
|
776
776
|
}
|
|
777
|
+
function wrapFieldWithNoHeader(Field) {
|
|
778
|
+
return (props) => {
|
|
779
|
+
return /* @__PURE__ */ React__namespace.createElement(
|
|
780
|
+
FieldMeta,
|
|
781
|
+
{
|
|
782
|
+
name: props.input.name,
|
|
783
|
+
label: false,
|
|
784
|
+
description: "",
|
|
785
|
+
error: props.meta.error,
|
|
786
|
+
index: props.index,
|
|
787
|
+
tinaForm: props.tinaForm
|
|
788
|
+
},
|
|
789
|
+
/* @__PURE__ */ React__namespace.createElement(Field, { ...props })
|
|
790
|
+
);
|
|
791
|
+
};
|
|
792
|
+
}
|
|
777
793
|
function wrapFieldWithError(Field) {
|
|
778
794
|
return (props) => {
|
|
779
795
|
return /* @__PURE__ */ React__namespace.createElement(
|
|
@@ -846,6 +862,16 @@ var __publicField = (obj, key, value) => {
|
|
|
846
862
|
className,
|
|
847
863
|
...props
|
|
848
864
|
}) => {
|
|
865
|
+
if (typeof children === "string") {
|
|
866
|
+
return /* @__PURE__ */ React__namespace.createElement(
|
|
867
|
+
"span",
|
|
868
|
+
{
|
|
869
|
+
className: `block font-sans text-xs italic font-light text-gray-400 pt-0.5 whitespace-normal m-0 ${className}`,
|
|
870
|
+
...props,
|
|
871
|
+
dangerouslySetInnerHTML: { __html: children }
|
|
872
|
+
}
|
|
873
|
+
);
|
|
874
|
+
}
|
|
849
875
|
return /* @__PURE__ */ React__namespace.createElement(
|
|
850
876
|
"span",
|
|
851
877
|
{
|
|
@@ -1321,7 +1347,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1321
1347
|
React.useEffect(() => {
|
|
1322
1348
|
if (mermaidRef.current) {
|
|
1323
1349
|
mermaid.initialize({ startOnLoad: true });
|
|
1324
|
-
mermaid.
|
|
1350
|
+
mermaid.init();
|
|
1325
1351
|
}
|
|
1326
1352
|
}, [config]);
|
|
1327
1353
|
return /* @__PURE__ */ React.createElement("div", { contentEditable: false, className: "border-border border-b" }, /* @__PURE__ */ React.createElement("div", { ref: mermaidRef }, /* @__PURE__ */ React.createElement("pre", { className: "mermaid not-tina-prose" }, config)));
|
|
@@ -1348,7 +1374,7 @@ flowchart TD
|
|
|
1348
1374
|
--> id2(modify me to see changes!)
|
|
1349
1375
|
id2
|
|
1350
1376
|
--> id3(Click the top button to preview the changes)
|
|
1351
|
-
--> id4(Learn about mermaid diagrams
|
|
1377
|
+
--> id4(Learn about mermaid diagrams - mermaid.js.org)`;
|
|
1352
1378
|
const MermaidElement = cn$1.withRef(
|
|
1353
1379
|
({ children, nodeProps, element, ...props }, ref) => {
|
|
1354
1380
|
const [mermaidConfig, setMermaidConfig] = React.useState(
|
|
@@ -1364,7 +1390,7 @@ flowchart TD
|
|
|
1364
1390
|
children: [{ type: "text", text: "" }]
|
|
1365
1391
|
};
|
|
1366
1392
|
React.useEffect(() => {
|
|
1367
|
-
if (mermaid.parse(mermaidConfig
|
|
1393
|
+
if (mermaid.parse(mermaidConfig)) {
|
|
1368
1394
|
setMermaidError(null);
|
|
1369
1395
|
}
|
|
1370
1396
|
}, [mermaidConfig]);
|
|
@@ -3676,7 +3702,7 @@ flowchart TD
|
|
|
3676
3702
|
};
|
|
3677
3703
|
const sizeClasses = {
|
|
3678
3704
|
small: `text-xs h-8 px-3`,
|
|
3679
|
-
medium: `text-sm h-10 px-
|
|
3705
|
+
medium: `text-sm h-10 px-8`,
|
|
3680
3706
|
custom: ``
|
|
3681
3707
|
};
|
|
3682
3708
|
return /* @__PURE__ */ React__namespace.createElement(
|
|
@@ -4909,7 +4935,28 @@ flowchart TD
|
|
|
4909
4935
|
onChange,
|
|
4910
4936
|
value,
|
|
4911
4937
|
step
|
|
4912
|
-
}) => /* @__PURE__ */ React__namespace.createElement(
|
|
4938
|
+
}) => /* @__PURE__ */ React__namespace.createElement(
|
|
4939
|
+
Input,
|
|
4940
|
+
{
|
|
4941
|
+
type: "number",
|
|
4942
|
+
step,
|
|
4943
|
+
value,
|
|
4944
|
+
onChange: (event) => {
|
|
4945
|
+
const inputValue = event.target.value;
|
|
4946
|
+
const newValue = inputValue === "" ? void 0 : inputValue;
|
|
4947
|
+
if (onChange) {
|
|
4948
|
+
const syntheticEvent = {
|
|
4949
|
+
...event,
|
|
4950
|
+
target: {
|
|
4951
|
+
...event.target,
|
|
4952
|
+
value: newValue
|
|
4953
|
+
}
|
|
4954
|
+
};
|
|
4955
|
+
onChange(syntheticEvent);
|
|
4956
|
+
}
|
|
4957
|
+
}
|
|
4958
|
+
}
|
|
4959
|
+
);
|
|
4913
4960
|
function useCMS() {
|
|
4914
4961
|
return useCMS$1();
|
|
4915
4962
|
}
|
|
@@ -5710,10 +5757,11 @@ flowchart TD
|
|
|
5710
5757
|
return /* @__PURE__ */ React.createElement(
|
|
5711
5758
|
"button",
|
|
5712
5759
|
{
|
|
5713
|
-
|
|
5760
|
+
type: "button",
|
|
5761
|
+
className: `w-8 px-1 py-2.5 flex items-center justify-center text-gray-200 hover:opacity-100 opacity-30 hover:bg-gray-50 ${disabled && "pointer-events-none opacity-30 cursor-not-allowed"}`,
|
|
5714
5762
|
onClick
|
|
5715
5763
|
},
|
|
5716
|
-
/* @__PURE__ */ React.createElement(TrashIcon, { className: "fill-current transition-colors ease-out
|
|
5764
|
+
/* @__PURE__ */ React.createElement(TrashIcon, { className: "h-5 w-auto fill-current text-red-500 transition-colors duration-150 ease-out" })
|
|
5717
5765
|
);
|
|
5718
5766
|
};
|
|
5719
5767
|
const DragHandle = ({ isDragging }) => {
|
|
@@ -5791,27 +5839,35 @@ flowchart TD
|
|
|
5791
5839
|
))))
|
|
5792
5840
|
))));
|
|
5793
5841
|
};
|
|
5794
|
-
const Group =
|
|
5795
|
-
|
|
5796
|
-
|
|
5797
|
-
|
|
5798
|
-
|
|
5799
|
-
|
|
5800
|
-
|
|
5801
|
-
|
|
5802
|
-
|
|
5803
|
-
|
|
5804
|
-
|
|
5842
|
+
const Group = wrapFieldWithNoHeader(
|
|
5843
|
+
({ tinaForm, field }) => {
|
|
5844
|
+
const cms = useCMS$1();
|
|
5845
|
+
return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(
|
|
5846
|
+
Header,
|
|
5847
|
+
{
|
|
5848
|
+
onClick: () => {
|
|
5849
|
+
const state = tinaForm.finalForm.getState();
|
|
5850
|
+
if (state.invalid === true) {
|
|
5851
|
+
cms.alerts.error("Cannot navigate away from an invalid form.");
|
|
5852
|
+
return;
|
|
5853
|
+
}
|
|
5854
|
+
cms.dispatch({
|
|
5855
|
+
type: "forms:set-active-field-name",
|
|
5856
|
+
value: { formId: tinaForm.id, fieldName: field.name }
|
|
5857
|
+
});
|
|
5805
5858
|
}
|
|
5806
|
-
|
|
5807
|
-
|
|
5808
|
-
|
|
5809
|
-
|
|
5810
|
-
|
|
5811
|
-
|
|
5812
|
-
|
|
5813
|
-
|
|
5814
|
-
|
|
5859
|
+
},
|
|
5860
|
+
field.label || field.name,
|
|
5861
|
+
field.description && /* @__PURE__ */ React__namespace.createElement(
|
|
5862
|
+
"span",
|
|
5863
|
+
{
|
|
5864
|
+
className: `block font-sans text-xs italic font-light text-gray-400 pt-0.5 whitespace-normal m-0`,
|
|
5865
|
+
dangerouslySetInnerHTML: { __html: field.description }
|
|
5866
|
+
}
|
|
5867
|
+
)
|
|
5868
|
+
));
|
|
5869
|
+
}
|
|
5870
|
+
);
|
|
5815
5871
|
const Header = ({ onClick, children }) => {
|
|
5816
5872
|
return /* @__PURE__ */ React__namespace.createElement("div", { className: "pt-1 mb-5" }, /* @__PURE__ */ React__namespace.createElement(
|
|
5817
5873
|
"button",
|
|
@@ -7977,7 +8033,10 @@ flowchart TD
|
|
|
7977
8033
|
ReactDateTimeWithStyles,
|
|
7978
8034
|
{
|
|
7979
8035
|
value: input.value,
|
|
7980
|
-
onChange:
|
|
8036
|
+
onChange: (value) => {
|
|
8037
|
+
const newValue = value === "" ? void 0 : value;
|
|
8038
|
+
input.onChange(newValue);
|
|
8039
|
+
},
|
|
7981
8040
|
dateFormat: dateFormat || DEFAULT_DATE_DISPLAY_FORMAT,
|
|
7982
8041
|
timeFormat: timeFormat || false,
|
|
7983
8042
|
inputProps: { className: textFieldClasses },
|
|
@@ -10308,7 +10367,7 @@ flowchart TD
|
|
|
10308
10367
|
"Event Log"
|
|
10309
10368
|
));
|
|
10310
10369
|
};
|
|
10311
|
-
const version = "2.
|
|
10370
|
+
const version = "2.5.1";
|
|
10312
10371
|
const Nav = ({
|
|
10313
10372
|
isLocalMode,
|
|
10314
10373
|
className = "",
|
|
@@ -12839,15 +12898,14 @@ flowchart TD
|
|
|
12839
12898
|
fields: fieldGroup.fields
|
|
12840
12899
|
}
|
|
12841
12900
|
) : /* @__PURE__ */ React__namespace.createElement(NoFieldsPlaceholder, null)
|
|
12842
|
-
)), !hideFooter && /* @__PURE__ */ React__namespace.createElement("div", { className: "relative flex-none w-full h-16 px-
|
|
12901
|
+
)), !hideFooter && /* @__PURE__ */ React__namespace.createElement("div", { className: "relative flex-none w-full h-16 px-12 bg-white border-t border-gray-100 flex items-center justify-end" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "flex-1 w-full justify-end gap-2 flex items-center max-w-form" }, tinaForm.reset && /* @__PURE__ */ React__namespace.createElement(
|
|
12843
12902
|
ResetForm,
|
|
12844
12903
|
{
|
|
12845
12904
|
pristine,
|
|
12846
12905
|
reset: async () => {
|
|
12847
12906
|
finalForm2.reset();
|
|
12848
12907
|
await tinaForm.reset();
|
|
12849
|
-
}
|
|
12850
|
-
style: { flexGrow: 1 }
|
|
12908
|
+
}
|
|
12851
12909
|
},
|
|
12852
12910
|
tinaForm.buttons.reset
|
|
12853
12911
|
), /* @__PURE__ */ React__namespace.createElement(
|
|
@@ -12856,8 +12914,7 @@ flowchart TD
|
|
|
12856
12914
|
onClick: safeHandleSubmit,
|
|
12857
12915
|
disabled: !canSubmit,
|
|
12858
12916
|
busy: submitting,
|
|
12859
|
-
variant: "primary"
|
|
12860
|
-
style: { flexGrow: 3 }
|
|
12917
|
+
variant: "primary"
|
|
12861
12918
|
},
|
|
12862
12919
|
submitting && /* @__PURE__ */ React__namespace.createElement(LoadingDots, null),
|
|
12863
12920
|
!submitting && tinaForm.buttons.save
|
|
@@ -13827,6 +13884,7 @@ flowchart TD
|
|
|
13827
13884
|
"Unordered List",
|
|
13828
13885
|
"Ordered List",
|
|
13829
13886
|
"Quote",
|
|
13887
|
+
"Mermaid",
|
|
13830
13888
|
"Heading 1",
|
|
13831
13889
|
"Heading 2",
|
|
13832
13890
|
"Heading 3",
|
|
@@ -14426,6 +14484,7 @@ flowchart TD
|
|
|
14426
14484
|
ToolbarButton,
|
|
14427
14485
|
{
|
|
14428
14486
|
showArrow: false,
|
|
14487
|
+
"data-testid": "rich-text-editor-overflow-menu-button",
|
|
14429
14488
|
className: "lg:min-w-[130px]",
|
|
14430
14489
|
isDropdown: true,
|
|
14431
14490
|
pressed: openState.open,
|
|
@@ -14479,7 +14538,17 @@ flowchart TD
|
|
|
14479
14538
|
};
|
|
14480
14539
|
const RawMarkdownToolbarButton = cn$1.withRef(({ clear, ...rest }, ref) => {
|
|
14481
14540
|
const { props } = useRawMarkdownToolbarButton();
|
|
14482
|
-
return /* @__PURE__ */ React.createElement(
|
|
14541
|
+
return /* @__PURE__ */ React.createElement(
|
|
14542
|
+
ToolbarButton,
|
|
14543
|
+
{
|
|
14544
|
+
ref,
|
|
14545
|
+
tooltip: "Link",
|
|
14546
|
+
...rest,
|
|
14547
|
+
...props,
|
|
14548
|
+
"data-testid": "markdown-button"
|
|
14549
|
+
},
|
|
14550
|
+
/* @__PURE__ */ React.createElement(Icons.raw, null)
|
|
14551
|
+
);
|
|
14483
14552
|
});
|
|
14484
14553
|
function TableDropdownMenu(props) {
|
|
14485
14554
|
const tableSelected = plateCommon.useEditorSelector(
|
|
@@ -30078,6 +30147,7 @@ mutation addPendingDocumentMutation(
|
|
|
30078
30147
|
relativePath
|
|
30079
30148
|
filename
|
|
30080
30149
|
extension
|
|
30150
|
+
hasReferences
|
|
30081
30151
|
}
|
|
30082
30152
|
}
|
|
30083
30153
|
}
|
|
@@ -30169,6 +30239,9 @@ mutation addPendingDocumentMutation(
|
|
|
30169
30239
|
document(collection:$collection, relativePath:$relativePath) {
|
|
30170
30240
|
... on Document {
|
|
30171
30241
|
_values
|
|
30242
|
+
_sys {
|
|
30243
|
+
hasReferences
|
|
30244
|
+
}
|
|
30172
30245
|
}
|
|
30173
30246
|
}
|
|
30174
30247
|
}`;
|
|
@@ -31895,6 +31968,23 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
31895
31968
|
DeleteModal,
|
|
31896
31969
|
{
|
|
31897
31970
|
filename: vars.relativePath,
|
|
31971
|
+
checkRefsFunc: async () => {
|
|
31972
|
+
var _a2, _b2;
|
|
31973
|
+
try {
|
|
31974
|
+
const doc = await admin.fetchDocument(
|
|
31975
|
+
collection.name,
|
|
31976
|
+
vars.relativePath,
|
|
31977
|
+
true
|
|
31978
|
+
);
|
|
31979
|
+
return (_b2 = (_a2 = doc == null ? void 0 : doc.document) == null ? void 0 : _a2._sys) == null ? void 0 : _b2.hasReferences;
|
|
31980
|
+
} catch (error) {
|
|
31981
|
+
cms.alerts.error(
|
|
31982
|
+
"Document was not found, ask a developer for help or check the console for an error message"
|
|
31983
|
+
);
|
|
31984
|
+
console.error(error);
|
|
31985
|
+
throw error;
|
|
31986
|
+
}
|
|
31987
|
+
},
|
|
31898
31988
|
deleteFunc: async () => {
|
|
31899
31989
|
try {
|
|
31900
31990
|
await admin.deleteDocument(vars);
|
|
@@ -31903,6 +31993,12 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
31903
31993
|
);
|
|
31904
31994
|
reFetchCollection();
|
|
31905
31995
|
} catch (error) {
|
|
31996
|
+
if (error.message.indexOf("has references")) {
|
|
31997
|
+
cms.alerts.error(
|
|
31998
|
+
error.message.split("\n ").filter(Boolean)[1]
|
|
31999
|
+
);
|
|
32000
|
+
return;
|
|
32001
|
+
}
|
|
31906
32002
|
cms.alerts.warn(
|
|
31907
32003
|
"Document was not deleted, ask a developer for help or check the console for an error message"
|
|
31908
32004
|
);
|
|
@@ -31954,6 +32050,12 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
31954
32050
|
cms.alerts.info("Document was successfully renamed");
|
|
31955
32051
|
reFetchCollection();
|
|
31956
32052
|
} catch (error) {
|
|
32053
|
+
if (error.message.indexOf("has references")) {
|
|
32054
|
+
cms.alerts.error(
|
|
32055
|
+
error.message.split("\n ").filter(Boolean)[1]
|
|
32056
|
+
);
|
|
32057
|
+
return;
|
|
32058
|
+
}
|
|
31957
32059
|
cms.alerts.warn(
|
|
31958
32060
|
"Document was not renamed, ask a developer for help or check the console for an error message"
|
|
31959
32061
|
);
|
|
@@ -32427,8 +32529,19 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
32427
32529
|
const NoDocumentsPlaceholder = () => {
|
|
32428
32530
|
return /* @__PURE__ */ React.createElement("div", { className: "text-center px-5 py-3 flex flex-col items-center justify-center shadow border border-gray-100 bg-gray-50 border-b border-gray-200 w-full max-w-full rounded-lg" }, /* @__PURE__ */ React.createElement("p", { className: "text-base italic font-medium text-gray-300" }, "No documents found."));
|
|
32429
32531
|
};
|
|
32430
|
-
const DeleteModal = ({
|
|
32431
|
-
|
|
32532
|
+
const DeleteModal = ({
|
|
32533
|
+
close: close2,
|
|
32534
|
+
deleteFunc,
|
|
32535
|
+
checkRefsFunc,
|
|
32536
|
+
filename
|
|
32537
|
+
}) => {
|
|
32538
|
+
const [hasRefs, setHasRefs] = React.useState();
|
|
32539
|
+
React.useEffect(() => {
|
|
32540
|
+
checkRefsFunc().then((result) => {
|
|
32541
|
+
setHasRefs(result);
|
|
32542
|
+
});
|
|
32543
|
+
}, [filename, checkRefsFunc]);
|
|
32544
|
+
return /* @__PURE__ */ React.createElement(Modal, null, /* @__PURE__ */ React.createElement(PopupModal, null, /* @__PURE__ */ React.createElement(ModalHeader, { close: close2 }, "Delete ", filename), /* @__PURE__ */ React.createElement(ModalBody, { padded: true }, /* @__PURE__ */ React.createElement("p", null, `Are you sure you want to delete ${filename}?${hasRefs ? " References to this document will also be deleted." : ""}`)), /* @__PURE__ */ React.createElement(ModalActions, null, /* @__PURE__ */ React.createElement(Button$1, { style: { flexGrow: 2 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React.createElement(
|
|
32432
32545
|
Button$1,
|
|
32433
32546
|
{
|
|
32434
32547
|
style: { flexGrow: 3 },
|
|
@@ -33795,6 +33908,7 @@ This will work when developing locally but NOT when deployed to production.
|
|
|
33795
33908
|
exports2.useScreenPlugin = useScreenPlugin;
|
|
33796
33909
|
exports2.useTinaAuthRedirect = useTinaAuthRedirect;
|
|
33797
33910
|
exports2.wrapFieldWithError = wrapFieldWithError;
|
|
33911
|
+
exports2.wrapFieldWithNoHeader = wrapFieldWithNoHeader;
|
|
33798
33912
|
exports2.wrapFieldsWithMeta = wrapFieldsWithMeta;
|
|
33799
33913
|
Object.defineProperties(exports2, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
33800
33914
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -801,6 +801,22 @@ function wrapFieldsWithMeta(Field2) {
|
|
|
801
801
|
);
|
|
802
802
|
};
|
|
803
803
|
}
|
|
804
|
+
function wrapFieldWithNoHeader(Field2) {
|
|
805
|
+
return (props) => {
|
|
806
|
+
return /* @__PURE__ */ React.createElement(
|
|
807
|
+
FieldMeta,
|
|
808
|
+
{
|
|
809
|
+
name: props.input.name,
|
|
810
|
+
label: false,
|
|
811
|
+
description: "",
|
|
812
|
+
error: props.meta.error,
|
|
813
|
+
index: props.index,
|
|
814
|
+
tinaForm: props.tinaForm
|
|
815
|
+
},
|
|
816
|
+
/* @__PURE__ */ React.createElement(Field2, { ...props })
|
|
817
|
+
);
|
|
818
|
+
};
|
|
819
|
+
}
|
|
804
820
|
function wrapFieldWithError(Field2) {
|
|
805
821
|
return (props) => {
|
|
806
822
|
return /* @__PURE__ */ React.createElement(
|
|
@@ -873,6 +889,16 @@ const FieldDescription = ({
|
|
|
873
889
|
className,
|
|
874
890
|
...props
|
|
875
891
|
}) => {
|
|
892
|
+
if (typeof children === "string") {
|
|
893
|
+
return /* @__PURE__ */ React.createElement(
|
|
894
|
+
"span",
|
|
895
|
+
{
|
|
896
|
+
className: `block font-sans text-xs italic font-light text-gray-400 pt-0.5 whitespace-normal m-0 ${className}`,
|
|
897
|
+
...props,
|
|
898
|
+
dangerouslySetInnerHTML: { __html: children }
|
|
899
|
+
}
|
|
900
|
+
);
|
|
901
|
+
}
|
|
876
902
|
return /* @__PURE__ */ React.createElement(
|
|
877
903
|
"span",
|
|
878
904
|
{
|
|
@@ -1348,7 +1374,7 @@ const MermaidElementWithRef = ({ config }) => {
|
|
|
1348
1374
|
useEffect(() => {
|
|
1349
1375
|
if (mermaidRef.current) {
|
|
1350
1376
|
mermaid.initialize({ startOnLoad: true });
|
|
1351
|
-
mermaid.
|
|
1377
|
+
mermaid.init();
|
|
1352
1378
|
}
|
|
1353
1379
|
}, [config]);
|
|
1354
1380
|
return /* @__PURE__ */ React__default.createElement("div", { contentEditable: false, className: "border-border border-b" }, /* @__PURE__ */ React__default.createElement("div", { ref: mermaidRef }, /* @__PURE__ */ React__default.createElement("pre", { className: "mermaid not-tina-prose" }, config)));
|
|
@@ -1375,7 +1401,7 @@ flowchart TD
|
|
|
1375
1401
|
--> id2(modify me to see changes!)
|
|
1376
1402
|
id2
|
|
1377
1403
|
--> id3(Click the top button to preview the changes)
|
|
1378
|
-
--> id4(Learn about mermaid diagrams
|
|
1404
|
+
--> id4(Learn about mermaid diagrams - mermaid.js.org)`;
|
|
1379
1405
|
const MermaidElement = withRef(
|
|
1380
1406
|
({ children, nodeProps, element, ...props }, ref) => {
|
|
1381
1407
|
const [mermaidConfig, setMermaidConfig] = useState(
|
|
@@ -1391,7 +1417,7 @@ const MermaidElement = withRef(
|
|
|
1391
1417
|
children: [{ type: "text", text: "" }]
|
|
1392
1418
|
};
|
|
1393
1419
|
useEffect(() => {
|
|
1394
|
-
if (mermaid.parse(mermaidConfig
|
|
1420
|
+
if (mermaid.parse(mermaidConfig)) {
|
|
1395
1421
|
setMermaidError(null);
|
|
1396
1422
|
}
|
|
1397
1423
|
}, [mermaidConfig]);
|
|
@@ -3703,7 +3729,7 @@ const Button$1 = ({
|
|
|
3703
3729
|
};
|
|
3704
3730
|
const sizeClasses = {
|
|
3705
3731
|
small: `text-xs h-8 px-3`,
|
|
3706
|
-
medium: `text-sm h-10 px-
|
|
3732
|
+
medium: `text-sm h-10 px-8`,
|
|
3707
3733
|
custom: ``
|
|
3708
3734
|
};
|
|
3709
3735
|
return /* @__PURE__ */ React.createElement(
|
|
@@ -4936,7 +4962,28 @@ const NumberInput = ({
|
|
|
4936
4962
|
onChange,
|
|
4937
4963
|
value,
|
|
4938
4964
|
step
|
|
4939
|
-
}) => /* @__PURE__ */ React.createElement(
|
|
4965
|
+
}) => /* @__PURE__ */ React.createElement(
|
|
4966
|
+
Input,
|
|
4967
|
+
{
|
|
4968
|
+
type: "number",
|
|
4969
|
+
step,
|
|
4970
|
+
value,
|
|
4971
|
+
onChange: (event) => {
|
|
4972
|
+
const inputValue = event.target.value;
|
|
4973
|
+
const newValue = inputValue === "" ? void 0 : inputValue;
|
|
4974
|
+
if (onChange) {
|
|
4975
|
+
const syntheticEvent = {
|
|
4976
|
+
...event,
|
|
4977
|
+
target: {
|
|
4978
|
+
...event.target,
|
|
4979
|
+
value: newValue
|
|
4980
|
+
}
|
|
4981
|
+
};
|
|
4982
|
+
onChange(syntheticEvent);
|
|
4983
|
+
}
|
|
4984
|
+
}
|
|
4985
|
+
}
|
|
4986
|
+
);
|
|
4940
4987
|
function useCMS() {
|
|
4941
4988
|
return useCMS$1();
|
|
4942
4989
|
}
|
|
@@ -5737,10 +5784,11 @@ const ItemDeleteButton = ({ onClick, disabled = false }) => {
|
|
|
5737
5784
|
return /* @__PURE__ */ React__default.createElement(
|
|
5738
5785
|
"button",
|
|
5739
5786
|
{
|
|
5740
|
-
|
|
5787
|
+
type: "button",
|
|
5788
|
+
className: `w-8 px-1 py-2.5 flex items-center justify-center text-gray-200 hover:opacity-100 opacity-30 hover:bg-gray-50 ${disabled && "pointer-events-none opacity-30 cursor-not-allowed"}`,
|
|
5741
5789
|
onClick
|
|
5742
5790
|
},
|
|
5743
|
-
/* @__PURE__ */ React__default.createElement(TrashIcon, { className: "fill-current transition-colors ease-out
|
|
5791
|
+
/* @__PURE__ */ React__default.createElement(TrashIcon, { className: "h-5 w-auto fill-current text-red-500 transition-colors duration-150 ease-out" })
|
|
5744
5792
|
);
|
|
5745
5793
|
};
|
|
5746
5794
|
const DragHandle = ({ isDragging }) => {
|
|
@@ -5818,27 +5866,35 @@ const BlockSelector = ({
|
|
|
5818
5866
|
))))
|
|
5819
5867
|
))));
|
|
5820
5868
|
};
|
|
5821
|
-
const Group =
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
|
|
5825
|
-
|
|
5826
|
-
|
|
5827
|
-
|
|
5828
|
-
|
|
5829
|
-
|
|
5830
|
-
|
|
5831
|
-
|
|
5869
|
+
const Group = wrapFieldWithNoHeader(
|
|
5870
|
+
({ tinaForm, field }) => {
|
|
5871
|
+
const cms = useCMS$1();
|
|
5872
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
5873
|
+
Header,
|
|
5874
|
+
{
|
|
5875
|
+
onClick: () => {
|
|
5876
|
+
const state = tinaForm.finalForm.getState();
|
|
5877
|
+
if (state.invalid === true) {
|
|
5878
|
+
cms.alerts.error("Cannot navigate away from an invalid form.");
|
|
5879
|
+
return;
|
|
5880
|
+
}
|
|
5881
|
+
cms.dispatch({
|
|
5882
|
+
type: "forms:set-active-field-name",
|
|
5883
|
+
value: { formId: tinaForm.id, fieldName: field.name }
|
|
5884
|
+
});
|
|
5832
5885
|
}
|
|
5833
|
-
|
|
5834
|
-
|
|
5835
|
-
|
|
5836
|
-
|
|
5837
|
-
|
|
5838
|
-
|
|
5839
|
-
|
|
5840
|
-
|
|
5841
|
-
|
|
5886
|
+
},
|
|
5887
|
+
field.label || field.name,
|
|
5888
|
+
field.description && /* @__PURE__ */ React.createElement(
|
|
5889
|
+
"span",
|
|
5890
|
+
{
|
|
5891
|
+
className: `block font-sans text-xs italic font-light text-gray-400 pt-0.5 whitespace-normal m-0`,
|
|
5892
|
+
dangerouslySetInnerHTML: { __html: field.description }
|
|
5893
|
+
}
|
|
5894
|
+
)
|
|
5895
|
+
));
|
|
5896
|
+
}
|
|
5897
|
+
);
|
|
5842
5898
|
const Header = ({ onClick, children }) => {
|
|
5843
5899
|
return /* @__PURE__ */ React.createElement("div", { className: "pt-1 mb-5" }, /* @__PURE__ */ React.createElement(
|
|
5844
5900
|
"button",
|
|
@@ -8004,7 +8060,10 @@ const DateField = wrapFieldsWithMeta(
|
|
|
8004
8060
|
ReactDateTimeWithStyles,
|
|
8005
8061
|
{
|
|
8006
8062
|
value: input.value,
|
|
8007
|
-
onChange:
|
|
8063
|
+
onChange: (value) => {
|
|
8064
|
+
const newValue = value === "" ? void 0 : value;
|
|
8065
|
+
input.onChange(newValue);
|
|
8066
|
+
},
|
|
8008
8067
|
dateFormat: dateFormat || DEFAULT_DATE_DISPLAY_FORMAT,
|
|
8009
8068
|
timeFormat: timeFormat || false,
|
|
8010
8069
|
inputProps: { className: textFieldClasses },
|
|
@@ -10335,7 +10394,7 @@ const SyncStatus = ({ cms, setEventsOpen }) => {
|
|
|
10335
10394
|
"Event Log"
|
|
10336
10395
|
));
|
|
10337
10396
|
};
|
|
10338
|
-
const version = "2.
|
|
10397
|
+
const version = "2.5.1";
|
|
10339
10398
|
const Nav = ({
|
|
10340
10399
|
isLocalMode,
|
|
10341
10400
|
className = "",
|
|
@@ -12866,15 +12925,14 @@ const FormBuilder = ({
|
|
|
12866
12925
|
fields: fieldGroup.fields
|
|
12867
12926
|
}
|
|
12868
12927
|
) : /* @__PURE__ */ React.createElement(NoFieldsPlaceholder, null)
|
|
12869
|
-
)), !hideFooter && /* @__PURE__ */ React.createElement("div", { className: "relative flex-none w-full h-16 px-
|
|
12928
|
+
)), !hideFooter && /* @__PURE__ */ React.createElement("div", { className: "relative flex-none w-full h-16 px-12 bg-white border-t border-gray-100 flex items-center justify-end" }, /* @__PURE__ */ React.createElement("div", { className: "flex-1 w-full justify-end gap-2 flex items-center max-w-form" }, tinaForm.reset && /* @__PURE__ */ React.createElement(
|
|
12870
12929
|
ResetForm,
|
|
12871
12930
|
{
|
|
12872
12931
|
pristine,
|
|
12873
12932
|
reset: async () => {
|
|
12874
12933
|
finalForm.reset();
|
|
12875
12934
|
await tinaForm.reset();
|
|
12876
|
-
}
|
|
12877
|
-
style: { flexGrow: 1 }
|
|
12935
|
+
}
|
|
12878
12936
|
},
|
|
12879
12937
|
tinaForm.buttons.reset
|
|
12880
12938
|
), /* @__PURE__ */ React.createElement(
|
|
@@ -12883,8 +12941,7 @@ const FormBuilder = ({
|
|
|
12883
12941
|
onClick: safeHandleSubmit,
|
|
12884
12942
|
disabled: !canSubmit,
|
|
12885
12943
|
busy: submitting,
|
|
12886
|
-
variant: "primary"
|
|
12887
|
-
style: { flexGrow: 3 }
|
|
12944
|
+
variant: "primary"
|
|
12888
12945
|
},
|
|
12889
12946
|
submitting && /* @__PURE__ */ React.createElement(LoadingDots, null),
|
|
12890
12947
|
!submitting && tinaForm.buttons.save
|
|
@@ -13854,6 +13911,7 @@ const unsupportedItemsInTable = /* @__PURE__ */ new Set([
|
|
|
13854
13911
|
"Unordered List",
|
|
13855
13912
|
"Ordered List",
|
|
13856
13913
|
"Quote",
|
|
13914
|
+
"Mermaid",
|
|
13857
13915
|
"Heading 1",
|
|
13858
13916
|
"Heading 2",
|
|
13859
13917
|
"Heading 3",
|
|
@@ -14453,6 +14511,7 @@ function OverflowMenu({
|
|
|
14453
14511
|
ToolbarButton,
|
|
14454
14512
|
{
|
|
14455
14513
|
showArrow: false,
|
|
14514
|
+
"data-testid": "rich-text-editor-overflow-menu-button",
|
|
14456
14515
|
className: "lg:min-w-[130px]",
|
|
14457
14516
|
isDropdown: true,
|
|
14458
14517
|
pressed: openState.open,
|
|
@@ -14506,7 +14565,17 @@ const useRawMarkdownToolbarButton = () => {
|
|
|
14506
14565
|
};
|
|
14507
14566
|
const RawMarkdownToolbarButton = withRef(({ clear, ...rest }, ref) => {
|
|
14508
14567
|
const { props } = useRawMarkdownToolbarButton();
|
|
14509
|
-
return /* @__PURE__ */ React__default.createElement(
|
|
14568
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
14569
|
+
ToolbarButton,
|
|
14570
|
+
{
|
|
14571
|
+
ref,
|
|
14572
|
+
tooltip: "Link",
|
|
14573
|
+
...rest,
|
|
14574
|
+
...props,
|
|
14575
|
+
"data-testid": "markdown-button"
|
|
14576
|
+
},
|
|
14577
|
+
/* @__PURE__ */ React__default.createElement(Icons.raw, null)
|
|
14578
|
+
);
|
|
14510
14579
|
});
|
|
14511
14580
|
function TableDropdownMenu(props) {
|
|
14512
14581
|
const tableSelected = useEditorSelector(
|
|
@@ -30105,6 +30174,7 @@ class TinaAdminApi {
|
|
|
30105
30174
|
relativePath
|
|
30106
30175
|
filename
|
|
30107
30176
|
extension
|
|
30177
|
+
hasReferences
|
|
30108
30178
|
}
|
|
30109
30179
|
}
|
|
30110
30180
|
}
|
|
@@ -30196,6 +30266,9 @@ class TinaAdminApi {
|
|
|
30196
30266
|
document(collection:$collection, relativePath:$relativePath) {
|
|
30197
30267
|
... on Document {
|
|
30198
30268
|
_values
|
|
30269
|
+
_sys {
|
|
30270
|
+
hasReferences
|
|
30271
|
+
}
|
|
30199
30272
|
}
|
|
30200
30273
|
}
|
|
30201
30274
|
}`;
|
|
@@ -31922,6 +31995,23 @@ const CollectionListPage = () => {
|
|
|
31922
31995
|
DeleteModal,
|
|
31923
31996
|
{
|
|
31924
31997
|
filename: vars.relativePath,
|
|
31998
|
+
checkRefsFunc: async () => {
|
|
31999
|
+
var _a2, _b2;
|
|
32000
|
+
try {
|
|
32001
|
+
const doc = await admin.fetchDocument(
|
|
32002
|
+
collection.name,
|
|
32003
|
+
vars.relativePath,
|
|
32004
|
+
true
|
|
32005
|
+
);
|
|
32006
|
+
return (_b2 = (_a2 = doc == null ? void 0 : doc.document) == null ? void 0 : _a2._sys) == null ? void 0 : _b2.hasReferences;
|
|
32007
|
+
} catch (error) {
|
|
32008
|
+
cms.alerts.error(
|
|
32009
|
+
"Document was not found, ask a developer for help or check the console for an error message"
|
|
32010
|
+
);
|
|
32011
|
+
console.error(error);
|
|
32012
|
+
throw error;
|
|
32013
|
+
}
|
|
32014
|
+
},
|
|
31925
32015
|
deleteFunc: async () => {
|
|
31926
32016
|
try {
|
|
31927
32017
|
await admin.deleteDocument(vars);
|
|
@@ -31930,6 +32020,12 @@ const CollectionListPage = () => {
|
|
|
31930
32020
|
);
|
|
31931
32021
|
reFetchCollection();
|
|
31932
32022
|
} catch (error) {
|
|
32023
|
+
if (error.message.indexOf("has references")) {
|
|
32024
|
+
cms.alerts.error(
|
|
32025
|
+
error.message.split("\n ").filter(Boolean)[1]
|
|
32026
|
+
);
|
|
32027
|
+
return;
|
|
32028
|
+
}
|
|
31933
32029
|
cms.alerts.warn(
|
|
31934
32030
|
"Document was not deleted, ask a developer for help or check the console for an error message"
|
|
31935
32031
|
);
|
|
@@ -31981,6 +32077,12 @@ const CollectionListPage = () => {
|
|
|
31981
32077
|
cms.alerts.info("Document was successfully renamed");
|
|
31982
32078
|
reFetchCollection();
|
|
31983
32079
|
} catch (error) {
|
|
32080
|
+
if (error.message.indexOf("has references")) {
|
|
32081
|
+
cms.alerts.error(
|
|
32082
|
+
error.message.split("\n ").filter(Boolean)[1]
|
|
32083
|
+
);
|
|
32084
|
+
return;
|
|
32085
|
+
}
|
|
31984
32086
|
cms.alerts.warn(
|
|
31985
32087
|
"Document was not renamed, ask a developer for help or check the console for an error message"
|
|
31986
32088
|
);
|
|
@@ -32454,8 +32556,19 @@ const Breadcrumb = ({ folder, navigate, collectionName }) => {
|
|
|
32454
32556
|
const NoDocumentsPlaceholder = () => {
|
|
32455
32557
|
return /* @__PURE__ */ React__default.createElement("div", { className: "text-center px-5 py-3 flex flex-col items-center justify-center shadow border border-gray-100 bg-gray-50 border-b border-gray-200 w-full max-w-full rounded-lg" }, /* @__PURE__ */ React__default.createElement("p", { className: "text-base italic font-medium text-gray-300" }, "No documents found."));
|
|
32456
32558
|
};
|
|
32457
|
-
const DeleteModal = ({
|
|
32458
|
-
|
|
32559
|
+
const DeleteModal = ({
|
|
32560
|
+
close: close2,
|
|
32561
|
+
deleteFunc,
|
|
32562
|
+
checkRefsFunc,
|
|
32563
|
+
filename
|
|
32564
|
+
}) => {
|
|
32565
|
+
const [hasRefs, setHasRefs] = React__default.useState();
|
|
32566
|
+
useEffect(() => {
|
|
32567
|
+
checkRefsFunc().then((result) => {
|
|
32568
|
+
setHasRefs(result);
|
|
32569
|
+
});
|
|
32570
|
+
}, [filename, checkRefsFunc]);
|
|
32571
|
+
return /* @__PURE__ */ React__default.createElement(Modal, null, /* @__PURE__ */ React__default.createElement(PopupModal, null, /* @__PURE__ */ React__default.createElement(ModalHeader, { close: close2 }, "Delete ", filename), /* @__PURE__ */ React__default.createElement(ModalBody, { padded: true }, /* @__PURE__ */ React__default.createElement("p", null, `Are you sure you want to delete ${filename}?${hasRefs ? " References to this document will also be deleted." : ""}`)), /* @__PURE__ */ React__default.createElement(ModalActions, null, /* @__PURE__ */ React__default.createElement(Button$1, { style: { flexGrow: 2 }, onClick: close2 }, "Cancel"), /* @__PURE__ */ React__default.createElement(
|
|
32459
32572
|
Button$1,
|
|
32460
32573
|
{
|
|
32461
32574
|
style: { flexGrow: 3 },
|
|
@@ -33817,5 +33930,6 @@ export {
|
|
|
33817
33930
|
useScreenPlugin,
|
|
33818
33931
|
useTinaAuthRedirect,
|
|
33819
33932
|
wrapFieldWithError,
|
|
33933
|
+
wrapFieldWithNoHeader,
|
|
33820
33934
|
wrapFieldsWithMeta
|
|
33821
33935
|
};
|
|
@@ -1,18 +1,24 @@
|
|
|
1
|
-
const makeCacheDir = async (dir, fs) => {
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const
|
|
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
5
|
let cacheDir = dir;
|
|
6
|
-
if (!fs.existsSync(path.join(path.sep,
|
|
7
|
-
cacheDir = path.join(os.tmpdir(),
|
|
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}`);
|
|
8
13
|
}
|
|
9
|
-
fs.mkdirSync(cacheDir, { recursive: true });
|
|
10
14
|
return cacheDir;
|
|
11
15
|
};
|
|
12
16
|
const NodeCache = async (dir) => {
|
|
13
|
-
const fs =
|
|
14
|
-
const
|
|
15
|
-
const
|
|
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);
|
|
16
22
|
return {
|
|
17
23
|
makeKey: (key) => {
|
|
18
24
|
const input = key && key instanceof Object ? JSON.stringify(key) : key || "";
|
|
@@ -39,5 +45,6 @@ const NodeCache = async (dir) => {
|
|
|
39
45
|
};
|
|
40
46
|
};
|
|
41
47
|
export {
|
|
42
|
-
NodeCache
|
|
48
|
+
NodeCache,
|
|
49
|
+
makeCacheDir
|
|
43
50
|
};
|
|
@@ -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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tinacms",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-b54b303-20241210232138",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "./dist/index.mjs",
|
|
6
6
|
"exports": {
|
|
@@ -60,21 +60,21 @@
|
|
|
60
60
|
"typings": "dist/index.d.ts",
|
|
61
61
|
"license": "Apache-2.0",
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@ariakit/react": "^0.4.
|
|
64
|
-
"@floating-ui/dom": "^1.6.
|
|
63
|
+
"@ariakit/react": "^0.4.13",
|
|
64
|
+
"@floating-ui/dom": "^1.6.12",
|
|
65
65
|
"@floating-ui/react-dom": "^2.1.2",
|
|
66
|
-
"@graphql-inspector/core": "^6.
|
|
66
|
+
"@graphql-inspector/core": "^6.2.0",
|
|
67
67
|
"@headlessui/react": "2.1.8",
|
|
68
68
|
"@heroicons/react": "^1.0.6",
|
|
69
69
|
"@monaco-editor/react": "4.4.5",
|
|
70
|
-
"@radix-ui/react-checkbox": "^1.1.
|
|
71
|
-
"@radix-ui/react-dialog": "^1.1.
|
|
72
|
-
"@radix-ui/react-dropdown-menu": "^2.1.
|
|
73
|
-
"@radix-ui/react-popover": "^1.1.
|
|
70
|
+
"@radix-ui/react-checkbox": "^1.1.2",
|
|
71
|
+
"@radix-ui/react-dialog": "^1.1.2",
|
|
72
|
+
"@radix-ui/react-dropdown-menu": "^2.1.2",
|
|
73
|
+
"@radix-ui/react-popover": "^1.1.2",
|
|
74
74
|
"@radix-ui/react-separator": "^1.1.0",
|
|
75
75
|
"@radix-ui/react-slot": "^1.1.0",
|
|
76
76
|
"@radix-ui/react-toolbar": "^1.1.0",
|
|
77
|
-
"@radix-ui/react-tooltip": "^1.1.
|
|
77
|
+
"@radix-ui/react-tooltip": "^1.1.4",
|
|
78
78
|
"@react-hook/window-size": "^3.1.1",
|
|
79
79
|
"@udecode/cn": "^33.0.0",
|
|
80
80
|
"@udecode/plate": "^36.5.9",
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"@udecode/plate-table": "36.5.8",
|
|
95
95
|
"class-variance-authority": "^0.7.0",
|
|
96
96
|
"clsx": "^2.1.1",
|
|
97
|
-
"cmdk": "^1.0.
|
|
97
|
+
"cmdk": "^1.0.4",
|
|
98
98
|
"color-string": "^1.9.1",
|
|
99
99
|
"crypto-js": "^4.2.0",
|
|
100
100
|
"date-fns": "2.30.0",
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"lodash.get": "^4.4.2",
|
|
109
109
|
"lodash.set": "^4.3.2",
|
|
110
110
|
"lucide-react": "^0.424.0",
|
|
111
|
-
"mermaid": "
|
|
111
|
+
"mermaid": "9.3.0",
|
|
112
112
|
"moment": "2.29.4",
|
|
113
113
|
"monaco-editor": "0.31.0",
|
|
114
114
|
"prism-react-renderer": "^2.4.0",
|
|
@@ -125,18 +125,18 @@
|
|
|
125
125
|
"slate-history": "^0.100.0",
|
|
126
126
|
"slate-hyperscript": "^0.100.0",
|
|
127
127
|
"slate-react": "^0.107.1",
|
|
128
|
-
"tailwind-merge": "^2.5.
|
|
128
|
+
"tailwind-merge": "^2.5.4",
|
|
129
129
|
"webfontloader": "1.6.28",
|
|
130
130
|
"yup": "^1.4.0",
|
|
131
131
|
"zod": "^3.23.8",
|
|
132
|
-
"@tinacms/mdx": "
|
|
133
|
-
"@tinacms/
|
|
134
|
-
"@tinacms/
|
|
132
|
+
"@tinacms/mdx": "1.5.2",
|
|
133
|
+
"@tinacms/search": "1.0.35",
|
|
134
|
+
"@tinacms/schema-tools": "1.6.8"
|
|
135
135
|
},
|
|
136
136
|
"devDependencies": {
|
|
137
|
-
"@graphql-tools/utils": "^10.5.
|
|
137
|
+
"@graphql-tools/utils": "^10.5.6",
|
|
138
138
|
"@testing-library/dom": "^10.4.0",
|
|
139
|
-
"@testing-library/jest-dom": "^6.
|
|
139
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
140
140
|
"@testing-library/react": "^16.0.1",
|
|
141
141
|
"@testing-library/user-event": "^14.5.2",
|
|
142
142
|
"@types/atob": "^2.1.4",
|
|
@@ -144,14 +144,14 @@
|
|
|
144
144
|
"@types/color-string": "^1.5.5",
|
|
145
145
|
"@types/lodash.debounce": "^4.0.9",
|
|
146
146
|
"@types/lodash.get": "^4.4.9",
|
|
147
|
-
"@types/node": "^22.
|
|
147
|
+
"@types/node": "^22.9.0",
|
|
148
148
|
"@types/prop-types": "^15.7.13",
|
|
149
|
-
"@types/react": "^18.3.
|
|
149
|
+
"@types/react": "^18.3.12",
|
|
150
150
|
"@types/react-beautiful-dnd": "^13.1.8",
|
|
151
151
|
"@types/react-color": "^3.0.12",
|
|
152
|
-
"@types/react-dom": "^18.3.
|
|
152
|
+
"@types/react-dom": "^18.3.1",
|
|
153
153
|
"@types/yup": "^0.32.0",
|
|
154
|
-
"happy-dom": "
|
|
154
|
+
"happy-dom": "15.10.2",
|
|
155
155
|
"identity-obj-proxy": "^3.0.0",
|
|
156
156
|
"isomorphic-fetch": "^3.0.0",
|
|
157
157
|
"jest-file-snapshot": "^0.7.0",
|
|
@@ -160,11 +160,11 @@
|
|
|
160
160
|
"react-dom": "^18.3.1",
|
|
161
161
|
"react-is": "^18.3.1",
|
|
162
162
|
"tsc-alias": "^1.8.10",
|
|
163
|
-
"tslib": "^2.
|
|
164
|
-
"typescript": "^5.6.
|
|
165
|
-
"vite": "^5.4.
|
|
166
|
-
"vitest": "^2.1.
|
|
167
|
-
"@tinacms/scripts": "
|
|
163
|
+
"tslib": "^2.8.1",
|
|
164
|
+
"typescript": "^5.6.3",
|
|
165
|
+
"vite": "^5.4.11",
|
|
166
|
+
"vitest": "^2.1.5",
|
|
167
|
+
"@tinacms/scripts": "1.3.1"
|
|
168
168
|
},
|
|
169
169
|
"peerDependencies": {
|
|
170
170
|
"react": ">=16.14.0",
|