tinacms 0.0.0-ad8dbc0-20241003000436 → 0.0.0-b20679d-20241024054309
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 +17 -15
- package/dist/client.mjs +2 -2
- package/dist/index.js +1533 -905
- package/dist/index.mjs +1502 -870
- package/dist/{node-cache-7fa2452c.mjs → node-cache-906fcb22.mjs} +16 -9
- package/dist/rich-text/index.d.ts +3 -0
- package/dist/rich-text/index.js +45 -12
- package/dist/rich-text/index.mjs +45 -12
- 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/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/resizable.d.ts +39 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table-cell-element.d.ts +27 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table-dropdown-menu.d.ts +3 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table-element.d.ts +14 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/components/plate-ui/table-row-element.d.ts +13 -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/plugins/core/common.d.ts +1 -0
- 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 +58 -0
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/toolbar/toolbar-overrides.d.ts +7 -3
- package/dist/toolkit/fields/plugins/mdx-field-plugin/plate/toolbar/toolbar-provider.d.ts +1 -1
- package/package.json +8 -6
- package/dist/__vite-browser-external-d06ac358.mjs +0 -4
package/dist/client.js
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
28
|
try {
|
|
29
|
-
if (this.cacheDir && window ===
|
|
29
|
+
if (this.cacheDir && typeof window === "undefined" && typeof require !== "undefined") {
|
|
30
30
|
const { NodeCache: NodeCache2 } = await Promise.resolve().then(() => nodeCache);
|
|
31
31
|
this.cache = await NodeCache2(this.cacheDir);
|
|
32
32
|
}
|
|
@@ -106,19 +106,25 @@
|
|
|
106
106
|
return client;
|
|
107
107
|
}
|
|
108
108
|
const makeCacheDir = async (dir, fs) => {
|
|
109
|
-
const path =
|
|
110
|
-
const os =
|
|
111
|
-
const
|
|
109
|
+
const path = require("node:path");
|
|
110
|
+
const os = require("node:os");
|
|
111
|
+
const pathParts = dir.split(path.sep).filter(Boolean);
|
|
112
|
+
const cacheHash = pathParts[pathParts.length - 1];
|
|
113
|
+
const rootUser = pathParts[0];
|
|
112
114
|
let cacheDir = dir;
|
|
113
|
-
if (!fs.existsSync(path.join(path.sep,
|
|
114
|
-
cacheDir = path.join(os.tmpdir(),
|
|
115
|
+
if (!fs.existsSync(path.join(path.sep, rootUser))) {
|
|
116
|
+
cacheDir = path.join(os.tmpdir(), cacheHash);
|
|
117
|
+
}
|
|
118
|
+
try {
|
|
119
|
+
fs.mkdirSync(cacheDir, { recursive: true });
|
|
120
|
+
} catch (error) {
|
|
121
|
+
throw new Error(`Failed to create cache directory: ${error.message}`);
|
|
115
122
|
}
|
|
116
|
-
fs.mkdirSync(cacheDir, { recursive: true });
|
|
117
123
|
return cacheDir;
|
|
118
124
|
};
|
|
119
125
|
const NodeCache = async (dir) => {
|
|
120
|
-
const fs =
|
|
121
|
-
const { createHash } =
|
|
126
|
+
const fs = require("node:fs");
|
|
127
|
+
const { createHash } = require("node:crypto");
|
|
122
128
|
const cacheDir = await makeCacheDir(dir, fs);
|
|
123
129
|
return {
|
|
124
130
|
makeKey: (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
|
@@ -23,8 +23,8 @@ class TinaClient {
|
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
25
|
try {
|
|
26
|
-
if (this.cacheDir && window ===
|
|
27
|
-
const { NodeCache } = await import("./node-cache-
|
|
26
|
+
if (this.cacheDir && typeof window === "undefined" && typeof require !== "undefined") {
|
|
27
|
+
const { NodeCache } = await import("./node-cache-906fcb22.mjs");
|
|
28
28
|
this.cache = await NodeCache(this.cacheDir);
|
|
29
29
|
}
|
|
30
30
|
} catch (e) {
|