tinacms 0.0.0-9b91b31-20241023063504 → 0.0.0-9bb408f-20241030010559
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/cache/node-cache.d.ts +1 -0
- package/dist/client.js +10 -18
- package/dist/client.mjs +1 -1
- package/dist/index.js +16 -7
- package/dist/index.mjs +16 -7
- package/dist/{node-cache-2dadfb7c.mjs → node-cache-4c336858.mjs} +10 -13
- package/package.json +4 -4
- package/dist/__vite-browser-external-d06ac358.mjs +0 -4
package/dist/client.js
CHANGED
|
@@ -105,17 +105,12 @@
|
|
|
105
105
|
const client = new TinaClient(args);
|
|
106
106
|
return client;
|
|
107
107
|
}
|
|
108
|
-
const makeCacheDir = async (dir, fs) => {
|
|
109
|
-
const
|
|
110
|
-
const os = require("node:os");
|
|
111
|
-
if (typeof dir !== "string" || !dir.trim()) {
|
|
112
|
-
throw new Error("Invalid directory path");
|
|
113
|
-
}
|
|
114
|
-
console.log("Path sep", path.sep);
|
|
115
|
-
const pathParts = dir.split(path.sep);
|
|
108
|
+
const makeCacheDir = async (dir, fs, path, os) => {
|
|
109
|
+
const pathParts = dir.split(path.sep).filter(Boolean);
|
|
116
110
|
const cacheHash = pathParts[pathParts.length - 1];
|
|
111
|
+
const rootUser = pathParts[0];
|
|
117
112
|
let cacheDir = dir;
|
|
118
|
-
if (!fs.existsSync(
|
|
113
|
+
if (!fs.existsSync(path.join(path.sep, rootUser))) {
|
|
119
114
|
cacheDir = path.join(os.tmpdir(), cacheHash);
|
|
120
115
|
}
|
|
121
116
|
try {
|
|
@@ -127,9 +122,10 @@
|
|
|
127
122
|
};
|
|
128
123
|
const NodeCache = async (dir) => {
|
|
129
124
|
const fs = require("node:fs");
|
|
130
|
-
|
|
131
|
-
const
|
|
132
|
-
const
|
|
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);
|
|
133
129
|
return {
|
|
134
130
|
makeKey: (key) => {
|
|
135
131
|
const input = key && key instanceof Object ? JSON.stringify(key) : key || "";
|
|
@@ -157,12 +153,8 @@
|
|
|
157
153
|
};
|
|
158
154
|
const nodeCache = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
159
155
|
__proto__: null,
|
|
160
|
-
NodeCache
|
|
161
|
-
|
|
162
|
-
const __viteBrowserExternal = {};
|
|
163
|
-
const __viteBrowserExternal$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
164
|
-
__proto__: null,
|
|
165
|
-
default: __viteBrowserExternal
|
|
156
|
+
NodeCache,
|
|
157
|
+
makeCacheDir
|
|
166
158
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
167
159
|
exports2.TINA_HOST = TINA_HOST;
|
|
168
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.js
CHANGED
|
@@ -3676,7 +3676,7 @@ flowchart TD
|
|
|
3676
3676
|
};
|
|
3677
3677
|
const sizeClasses = {
|
|
3678
3678
|
small: `text-xs h-8 px-3`,
|
|
3679
|
-
medium: `text-sm h-10 px-
|
|
3679
|
+
medium: `text-sm h-10 px-8`,
|
|
3680
3680
|
custom: ``
|
|
3681
3681
|
};
|
|
3682
3682
|
return /* @__PURE__ */ React__namespace.createElement(
|
|
@@ -12839,15 +12839,14 @@ flowchart TD
|
|
|
12839
12839
|
fields: fieldGroup.fields
|
|
12840
12840
|
}
|
|
12841
12841
|
) : /* @__PURE__ */ React__namespace.createElement(NoFieldsPlaceholder, null)
|
|
12842
|
-
)), !hideFooter && /* @__PURE__ */ React__namespace.createElement("div", { className: "relative flex-none w-full h-16 px-
|
|
12842
|
+
)), !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
12843
|
ResetForm,
|
|
12844
12844
|
{
|
|
12845
12845
|
pristine,
|
|
12846
12846
|
reset: async () => {
|
|
12847
12847
|
finalForm2.reset();
|
|
12848
12848
|
await tinaForm.reset();
|
|
12849
|
-
}
|
|
12850
|
-
style: { flexGrow: 1 }
|
|
12849
|
+
}
|
|
12851
12850
|
},
|
|
12852
12851
|
tinaForm.buttons.reset
|
|
12853
12852
|
), /* @__PURE__ */ React__namespace.createElement(
|
|
@@ -12856,8 +12855,7 @@ flowchart TD
|
|
|
12856
12855
|
onClick: safeHandleSubmit,
|
|
12857
12856
|
disabled: !canSubmit,
|
|
12858
12857
|
busy: submitting,
|
|
12859
|
-
variant: "primary"
|
|
12860
|
-
style: { flexGrow: 3 }
|
|
12858
|
+
variant: "primary"
|
|
12861
12859
|
},
|
|
12862
12860
|
submitting && /* @__PURE__ */ React__namespace.createElement(LoadingDots, null),
|
|
12863
12861
|
!submitting && tinaForm.buttons.save
|
|
@@ -14427,6 +14425,7 @@ flowchart TD
|
|
|
14427
14425
|
ToolbarButton,
|
|
14428
14426
|
{
|
|
14429
14427
|
showArrow: false,
|
|
14428
|
+
"data-testid": "rich-text-editor-overflow-menu-button",
|
|
14430
14429
|
className: "lg:min-w-[130px]",
|
|
14431
14430
|
isDropdown: true,
|
|
14432
14431
|
pressed: openState.open,
|
|
@@ -14480,7 +14479,17 @@ flowchart TD
|
|
|
14480
14479
|
};
|
|
14481
14480
|
const RawMarkdownToolbarButton = cn$1.withRef(({ clear, ...rest }, ref) => {
|
|
14482
14481
|
const { props } = useRawMarkdownToolbarButton();
|
|
14483
|
-
return /* @__PURE__ */ React.createElement(
|
|
14482
|
+
return /* @__PURE__ */ React.createElement(
|
|
14483
|
+
ToolbarButton,
|
|
14484
|
+
{
|
|
14485
|
+
ref,
|
|
14486
|
+
tooltip: "Link",
|
|
14487
|
+
...rest,
|
|
14488
|
+
...props,
|
|
14489
|
+
"data-testid": "markdown-button"
|
|
14490
|
+
},
|
|
14491
|
+
/* @__PURE__ */ React.createElement(Icons.raw, null)
|
|
14492
|
+
);
|
|
14484
14493
|
});
|
|
14485
14494
|
function TableDropdownMenu(props) {
|
|
14486
14495
|
const tableSelected = plateCommon.useEditorSelector(
|
package/dist/index.mjs
CHANGED
|
@@ -3703,7 +3703,7 @@ const Button$1 = ({
|
|
|
3703
3703
|
};
|
|
3704
3704
|
const sizeClasses = {
|
|
3705
3705
|
small: `text-xs h-8 px-3`,
|
|
3706
|
-
medium: `text-sm h-10 px-
|
|
3706
|
+
medium: `text-sm h-10 px-8`,
|
|
3707
3707
|
custom: ``
|
|
3708
3708
|
};
|
|
3709
3709
|
return /* @__PURE__ */ React.createElement(
|
|
@@ -12866,15 +12866,14 @@ const FormBuilder = ({
|
|
|
12866
12866
|
fields: fieldGroup.fields
|
|
12867
12867
|
}
|
|
12868
12868
|
) : /* @__PURE__ */ React.createElement(NoFieldsPlaceholder, null)
|
|
12869
|
-
)), !hideFooter && /* @__PURE__ */ React.createElement("div", { className: "relative flex-none w-full h-16 px-
|
|
12869
|
+
)), !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
12870
|
ResetForm,
|
|
12871
12871
|
{
|
|
12872
12872
|
pristine,
|
|
12873
12873
|
reset: async () => {
|
|
12874
12874
|
finalForm.reset();
|
|
12875
12875
|
await tinaForm.reset();
|
|
12876
|
-
}
|
|
12877
|
-
style: { flexGrow: 1 }
|
|
12876
|
+
}
|
|
12878
12877
|
},
|
|
12879
12878
|
tinaForm.buttons.reset
|
|
12880
12879
|
), /* @__PURE__ */ React.createElement(
|
|
@@ -12883,8 +12882,7 @@ const FormBuilder = ({
|
|
|
12883
12882
|
onClick: safeHandleSubmit,
|
|
12884
12883
|
disabled: !canSubmit,
|
|
12885
12884
|
busy: submitting,
|
|
12886
|
-
variant: "primary"
|
|
12887
|
-
style: { flexGrow: 3 }
|
|
12885
|
+
variant: "primary"
|
|
12888
12886
|
},
|
|
12889
12887
|
submitting && /* @__PURE__ */ React.createElement(LoadingDots, null),
|
|
12890
12888
|
!submitting && tinaForm.buttons.save
|
|
@@ -14454,6 +14452,7 @@ function OverflowMenu({
|
|
|
14454
14452
|
ToolbarButton,
|
|
14455
14453
|
{
|
|
14456
14454
|
showArrow: false,
|
|
14455
|
+
"data-testid": "rich-text-editor-overflow-menu-button",
|
|
14457
14456
|
className: "lg:min-w-[130px]",
|
|
14458
14457
|
isDropdown: true,
|
|
14459
14458
|
pressed: openState.open,
|
|
@@ -14507,7 +14506,17 @@ const useRawMarkdownToolbarButton = () => {
|
|
|
14507
14506
|
};
|
|
14508
14507
|
const RawMarkdownToolbarButton = withRef(({ clear, ...rest }, ref) => {
|
|
14509
14508
|
const { props } = useRawMarkdownToolbarButton();
|
|
14510
|
-
return /* @__PURE__ */ React__default.createElement(
|
|
14509
|
+
return /* @__PURE__ */ React__default.createElement(
|
|
14510
|
+
ToolbarButton,
|
|
14511
|
+
{
|
|
14512
|
+
ref,
|
|
14513
|
+
tooltip: "Link",
|
|
14514
|
+
...rest,
|
|
14515
|
+
...props,
|
|
14516
|
+
"data-testid": "markdown-button"
|
|
14517
|
+
},
|
|
14518
|
+
/* @__PURE__ */ React__default.createElement(Icons.raw, null)
|
|
14519
|
+
);
|
|
14511
14520
|
});
|
|
14512
14521
|
function TableDropdownMenu(props) {
|
|
14513
14522
|
const tableSelected = useEditorSelector(
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
const makeCacheDir = async (dir, fs) => {
|
|
2
|
-
const
|
|
3
|
-
const os = require("node:os");
|
|
4
|
-
if (typeof dir !== "string" || !dir.trim()) {
|
|
5
|
-
throw new Error("Invalid directory path");
|
|
6
|
-
}
|
|
7
|
-
console.log("Path sep", path.sep);
|
|
8
|
-
const pathParts = dir.split(path.sep);
|
|
1
|
+
const makeCacheDir = async (dir, fs, path, os) => {
|
|
2
|
+
const pathParts = dir.split(path.sep).filter(Boolean);
|
|
9
3
|
const cacheHash = pathParts[pathParts.length - 1];
|
|
4
|
+
const rootUser = pathParts[0];
|
|
10
5
|
let cacheDir = dir;
|
|
11
|
-
if (!fs.existsSync(
|
|
6
|
+
if (!fs.existsSync(path.join(path.sep, rootUser))) {
|
|
12
7
|
cacheDir = path.join(os.tmpdir(), cacheHash);
|
|
13
8
|
}
|
|
14
9
|
try {
|
|
@@ -20,9 +15,10 @@ const makeCacheDir = async (dir, fs) => {
|
|
|
20
15
|
};
|
|
21
16
|
const NodeCache = async (dir) => {
|
|
22
17
|
const fs = require("node:fs");
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
const
|
|
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);
|
|
26
22
|
return {
|
|
27
23
|
makeKey: (key) => {
|
|
28
24
|
const input = key && key instanceof Object ? JSON.stringify(key) : key || "";
|
|
@@ -49,5 +45,6 @@ const NodeCache = async (dir) => {
|
|
|
49
45
|
};
|
|
50
46
|
};
|
|
51
47
|
export {
|
|
52
|
-
NodeCache
|
|
48
|
+
NodeCache,
|
|
49
|
+
makeCacheDir
|
|
53
50
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tinacms",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-9bb408f-20241030010559",
|
|
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.4.0",
|
|
131
131
|
"zod": "^3.23.8",
|
|
132
|
-
"@tinacms/
|
|
133
|
-
"@tinacms/
|
|
134
|
-
"@tinacms/mdx": "
|
|
132
|
+
"@tinacms/search": "0.0.0-9bb408f-20241030010559",
|
|
133
|
+
"@tinacms/schema-tools": "0.0.0-9bb408f-20241030010559",
|
|
134
|
+
"@tinacms/mdx": "0.0.0-9bb408f-20241030010559"
|
|
135
135
|
},
|
|
136
136
|
"devDependencies": {
|
|
137
137
|
"@graphql-tools/utils": "^10.5.4",
|