tinacms 0.0.0-a690e47-20241003005744 → 0.0.0-bf22bf8-20241004045704

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/client.js CHANGED
@@ -26,7 +26,7 @@
26
26
  return;
27
27
  }
28
28
  try {
29
- if (this.cacheDir && window === void 0 && typeof require !== "undefined") {
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
  }
package/dist/client.mjs CHANGED
@@ -23,7 +23,7 @@ class TinaClient {
23
23
  return;
24
24
  }
25
25
  try {
26
- if (this.cacheDir && window === void 0 && typeof require !== "undefined") {
26
+ if (this.cacheDir && typeof window === "undefined" && typeof require !== "undefined") {
27
27
  const { NodeCache } = await import("./node-cache-7fa2452c.mjs");
28
28
  this.cache = await NodeCache(this.cacheDir);
29
29
  }
package/dist/index.js CHANGED
@@ -4605,7 +4605,10 @@ var __publicField = (obj, key, value) => {
4605
4605
  edges: response.collection.documents.edges
4606
4606
  };
4607
4607
  } catch (e) {
4608
- console.error("Unhandle exception:", e);
4608
+ console.error(
4609
+ "Exception thrown while building and running GraphQL query: ",
4610
+ e
4611
+ );
4609
4612
  return {
4610
4613
  collection,
4611
4614
  edges: []
@@ -13758,7 +13761,7 @@ var __publicField = (obj, key, value) => {
13758
13761
  tooltip: "Headings"
13759
13762
  },
13760
13763
  /* @__PURE__ */ React.createElement(SelectedItemIcon, { className: "size-5" }),
13761
- /* @__PURE__ */ React.createElement("span", { className: "hidden 2xl:flex" }, selectedItemLabel)
13764
+ /* @__PURE__ */ React.createElement("span", { className: "@md/toolbar:flex hidden" }, selectedItemLabel)
13762
13765
  )), /* @__PURE__ */ React.createElement(DropdownMenuContent, { align: "start", className: "min-w-0" }, /* @__PURE__ */ React.createElement(
13763
13766
  DropdownMenuRadioGroup,
13764
13767
  {
@@ -13960,6 +13963,7 @@ var __publicField = (obj, key, value) => {
13960
13963
  };
13961
13964
  const ICON_WIDTH = 32;
13962
13965
  const EMBED_ICON_WIDTH = 78;
13966
+ const MD_BREAKPOINT = 768;
13963
13967
  const useResize = (ref, callback) => {
13964
13968
  React.useEffect(() => {
13965
13969
  const resizeObserver = new ResizeObserver((entries) => {
@@ -14046,11 +14050,12 @@ var __publicField = (obj, key, value) => {
14046
14050
  const { overrides } = useToolbarContext();
14047
14051
  useResize(toolbarRef, (entry) => {
14048
14052
  const width = entry.target.getBoundingClientRect().width;
14049
- const itemsShown2 = (width - EMBED_ICON_WIDTH) / ICON_WIDTH;
14053
+ const paragraphIconWidth = width < MD_BREAKPOINT ? 58 : 128;
14054
+ const itemsShown2 = (width - EMBED_ICON_WIDTH - paragraphIconWidth) / ICON_WIDTH;
14050
14055
  setItemsShown(Math.floor(itemsShown2));
14051
14056
  });
14052
14057
  const toolbarItemsArray = overrides === void 0 ? Object.values(toolbarItems) : overrides.map((item) => toolbarItems[item]).filter((item) => item !== void 0);
14053
- return /* @__PURE__ */ React.createElement("div", { className: "w-full overflow-hidden", ref: toolbarRef }, /* @__PURE__ */ React.createElement(
14058
+ return /* @__PURE__ */ React.createElement("div", { className: "w-full overflow-hidden @container/toolbar", ref: toolbarRef }, /* @__PURE__ */ React.createElement(
14054
14059
  "div",
14055
14060
  {
14056
14061
  className: "flex",
package/dist/index.mjs CHANGED
@@ -4628,7 +4628,10 @@ const useGetOptionSets = (cms, collections, collectionFilter) => {
4628
4628
  edges: response.collection.documents.edges
4629
4629
  };
4630
4630
  } catch (e) {
4631
- console.error("Unhandle exception:", e);
4631
+ console.error(
4632
+ "Exception thrown while building and running GraphQL query: ",
4633
+ e
4634
+ );
4632
4635
  return {
4633
4636
  collection,
4634
4637
  edges: []
@@ -13781,7 +13784,7 @@ function HeadingsMenu(props) {
13781
13784
  tooltip: "Headings"
13782
13785
  },
13783
13786
  /* @__PURE__ */ React__default.createElement(SelectedItemIcon, { className: "size-5" }),
13784
- /* @__PURE__ */ React__default.createElement("span", { className: "hidden 2xl:flex" }, selectedItemLabel)
13787
+ /* @__PURE__ */ React__default.createElement("span", { className: "@md/toolbar:flex hidden" }, selectedItemLabel)
13785
13788
  )), /* @__PURE__ */ React__default.createElement(DropdownMenuContent, { align: "start", className: "min-w-0" }, /* @__PURE__ */ React__default.createElement(
13786
13789
  DropdownMenuRadioGroup,
13787
13790
  {
@@ -13983,6 +13986,7 @@ const EmbedButton = ({ editor, templates }) => {
13983
13986
  };
13984
13987
  const ICON_WIDTH = 32;
13985
13988
  const EMBED_ICON_WIDTH = 78;
13989
+ const MD_BREAKPOINT = 768;
13986
13990
  const useResize = (ref, callback) => {
13987
13991
  React__default.useEffect(() => {
13988
13992
  const resizeObserver = new ResizeObserver((entries) => {
@@ -14069,11 +14073,12 @@ function FixedToolbarButtons() {
14069
14073
  const { overrides } = useToolbarContext();
14070
14074
  useResize(toolbarRef, (entry) => {
14071
14075
  const width = entry.target.getBoundingClientRect().width;
14072
- const itemsShown2 = (width - EMBED_ICON_WIDTH) / ICON_WIDTH;
14076
+ const paragraphIconWidth = width < MD_BREAKPOINT ? 58 : 128;
14077
+ const itemsShown2 = (width - EMBED_ICON_WIDTH - paragraphIconWidth) / ICON_WIDTH;
14073
14078
  setItemsShown(Math.floor(itemsShown2));
14074
14079
  });
14075
14080
  const toolbarItemsArray = overrides === void 0 ? Object.values(toolbarItems) : overrides.map((item) => toolbarItems[item]).filter((item) => item !== void 0);
14076
- return /* @__PURE__ */ React__default.createElement("div", { className: "w-full overflow-hidden", ref: toolbarRef }, /* @__PURE__ */ React__default.createElement(
14081
+ return /* @__PURE__ */ React__default.createElement("div", { className: "w-full overflow-hidden @container/toolbar", ref: toolbarRef }, /* @__PURE__ */ React__default.createElement(
14077
14082
  "div",
14078
14083
  {
14079
14084
  className: "flex",
@@ -1,4 +1,4 @@
1
1
  export type ToolbarOverrideType = 'heading' | 'link' | 'image' | 'quote' | 'ul' | 'ol' | 'code' | 'codeBlock' | 'bold' | 'italic' | 'raw' | 'embed';
2
2
  export declare const ICON_WIDTH = 32;
3
3
  export declare const EMBED_ICON_WIDTH = 78;
4
- export declare const HEADING = 138;
4
+ export declare const MD_BREAKPOINT = 768;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tinacms",
3
- "version": "0.0.0-a690e47-20241003005744",
3
+ "version": "0.0.0-bf22bf8-20241004045704",
4
4
  "main": "dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "exports": {
@@ -127,9 +127,9 @@
127
127
  "webfontloader": "1.6.28",
128
128
  "yup": "^1.4.0",
129
129
  "zod": "^3.23.8",
130
- "@tinacms/schema-tools": "1.6.4",
131
- "@tinacms/search": "1.0.31",
132
- "@tinacms/mdx": "1.4.4"
130
+ "@tinacms/mdx": "0.0.0-bf22bf8-20241004045704",
131
+ "@tinacms/schema-tools": "0.0.0-bf22bf8-20241004045704",
132
+ "@tinacms/search": "0.0.0-bf22bf8-20241004045704"
133
133
  },
134
134
  "devDependencies": {
135
135
  "@graphql-tools/utils": "^10.5.4",