tinacms 0.0.0-bb6864c-20241024011228 → 0.0.0-bc59a81-20241030011355

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.
@@ -1,3 +1,3 @@
1
1
  import type { Cache } from './index';
2
- export declare const makeCacheDir: (dir: string, fs: any) => Promise<string>;
2
+ export declare const makeCacheDir: (dir: string, fs: any, path: any, os: any) => Promise<string>;
3
3
  export declare const NodeCache: (dir: string) => Promise<Cache>;
package/dist/client.js CHANGED
@@ -105,9 +105,7 @@
105
105
  const client = new TinaClient(args);
106
106
  return client;
107
107
  }
108
- const makeCacheDir = async (dir, fs) => {
109
- const path = require("node:path");
110
- const os = require("node:os");
108
+ const makeCacheDir = async (dir, fs, path, os) => {
111
109
  const pathParts = dir.split(path.sep).filter(Boolean);
112
110
  const cacheHash = pathParts[pathParts.length - 1];
113
111
  const rootUser = pathParts[0];
@@ -124,8 +122,10 @@
124
122
  };
125
123
  const NodeCache = async (dir) => {
126
124
  const fs = require("node:fs");
125
+ const path = require("node:path");
126
+ const os = require("node:os");
127
127
  const { createHash } = require("node:crypto");
128
- const cacheDir = await makeCacheDir(dir, fs);
128
+ const cacheDir = await makeCacheDir(dir, fs, path, os);
129
129
  return {
130
130
  makeKey: (key) => {
131
131
  const input = key && key instanceof Object ? JSON.stringify(key) : key || "";
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-906fcb22.mjs");
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
@@ -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(
@@ -850,9 +866,9 @@ var __publicField = (obj, key, value) => {
850
866
  "span",
851
867
  {
852
868
  className: `block font-sans text-xs italic font-light text-gray-400 pt-0.5 whitespace-normal m-0 ${className}`,
853
- ...props
854
- },
855
- children
869
+ ...props,
870
+ dangerouslySetInnerHTML: { __html: children }
871
+ }
856
872
  );
857
873
  };
858
874
  const FieldError = ({
@@ -5791,27 +5807,35 @@ flowchart TD
5791
5807
  ))))
5792
5808
  ))));
5793
5809
  };
5794
- const Group = wrapFieldWithError(({ tinaForm, field }) => {
5795
- const cms = useCMS$1();
5796
- React__namespace.useState(false);
5797
- return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(
5798
- Header,
5799
- {
5800
- onClick: () => {
5801
- const state = tinaForm.finalForm.getState();
5802
- if (state.invalid === true) {
5803
- cms.alerts.error("Cannot navigate away from an invalid form.");
5804
- return;
5810
+ const Group = wrapFieldWithNoHeader(
5811
+ ({ tinaForm, field }) => {
5812
+ const cms = useCMS$1();
5813
+ return /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(
5814
+ Header,
5815
+ {
5816
+ onClick: () => {
5817
+ const state = tinaForm.finalForm.getState();
5818
+ if (state.invalid === true) {
5819
+ cms.alerts.error("Cannot navigate away from an invalid form.");
5820
+ return;
5821
+ }
5822
+ cms.dispatch({
5823
+ type: "forms:set-active-field-name",
5824
+ value: { formId: tinaForm.id, fieldName: field.name }
5825
+ });
5805
5826
  }
5806
- cms.dispatch({
5807
- type: "forms:set-active-field-name",
5808
- value: { formId: tinaForm.id, fieldName: field.name }
5809
- });
5810
- }
5811
- },
5812
- field.label || field.name
5813
- ));
5814
- });
5827
+ },
5828
+ field.label || field.name,
5829
+ field.description && /* @__PURE__ */ React__namespace.createElement(
5830
+ "span",
5831
+ {
5832
+ className: `block font-sans text-xs italic font-light text-gray-400 pt-0.5 whitespace-normal m-0`,
5833
+ dangerouslySetInnerHTML: { __html: field.description }
5834
+ }
5835
+ )
5836
+ ));
5837
+ }
5838
+ );
5815
5839
  const Header = ({ onClick, children }) => {
5816
5840
  return /* @__PURE__ */ React__namespace.createElement("div", { className: "pt-1 mb-5" }, /* @__PURE__ */ React__namespace.createElement(
5817
5841
  "button",
@@ -14425,6 +14449,7 @@ flowchart TD
14425
14449
  ToolbarButton,
14426
14450
  {
14427
14451
  showArrow: false,
14452
+ "data-testid": "rich-text-editor-overflow-menu-button",
14428
14453
  className: "lg:min-w-[130px]",
14429
14454
  isDropdown: true,
14430
14455
  pressed: openState.open,
@@ -14478,7 +14503,17 @@ flowchart TD
14478
14503
  };
14479
14504
  const RawMarkdownToolbarButton = cn$1.withRef(({ clear, ...rest }, ref) => {
14480
14505
  const { props } = useRawMarkdownToolbarButton();
14481
- return /* @__PURE__ */ React.createElement(ToolbarButton, { ref, tooltip: "Link", ...rest, ...props }, /* @__PURE__ */ React.createElement(Icons.raw, null));
14506
+ return /* @__PURE__ */ React.createElement(
14507
+ ToolbarButton,
14508
+ {
14509
+ ref,
14510
+ tooltip: "Link",
14511
+ ...rest,
14512
+ ...props,
14513
+ "data-testid": "markdown-button"
14514
+ },
14515
+ /* @__PURE__ */ React.createElement(Icons.raw, null)
14516
+ );
14482
14517
  });
14483
14518
  function TableDropdownMenu(props) {
14484
14519
  const tableSelected = plateCommon.useEditorSelector(
@@ -33794,6 +33829,7 @@ This will work when developing locally but NOT when deployed to production.
33794
33829
  exports2.useScreenPlugin = useScreenPlugin;
33795
33830
  exports2.useTinaAuthRedirect = useTinaAuthRedirect;
33796
33831
  exports2.wrapFieldWithError = wrapFieldWithError;
33832
+ exports2.wrapFieldWithNoHeader = wrapFieldWithNoHeader;
33797
33833
  exports2.wrapFieldsWithMeta = wrapFieldsWithMeta;
33798
33834
  Object.defineProperties(exports2, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
33799
33835
  });
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(
@@ -877,9 +893,9 @@ const FieldDescription = ({
877
893
  "span",
878
894
  {
879
895
  className: `block font-sans text-xs italic font-light text-gray-400 pt-0.5 whitespace-normal m-0 ${className}`,
880
- ...props
881
- },
882
- children
896
+ ...props,
897
+ dangerouslySetInnerHTML: { __html: children }
898
+ }
883
899
  );
884
900
  };
885
901
  const FieldError = ({
@@ -5818,27 +5834,35 @@ const BlockSelector = ({
5818
5834
  ))))
5819
5835
  ))));
5820
5836
  };
5821
- const Group = wrapFieldWithError(({ tinaForm, field }) => {
5822
- const cms = useCMS$1();
5823
- React.useState(false);
5824
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
5825
- Header,
5826
- {
5827
- onClick: () => {
5828
- const state = tinaForm.finalForm.getState();
5829
- if (state.invalid === true) {
5830
- cms.alerts.error("Cannot navigate away from an invalid form.");
5831
- return;
5837
+ const Group = wrapFieldWithNoHeader(
5838
+ ({ tinaForm, field }) => {
5839
+ const cms = useCMS$1();
5840
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
5841
+ Header,
5842
+ {
5843
+ onClick: () => {
5844
+ const state = tinaForm.finalForm.getState();
5845
+ if (state.invalid === true) {
5846
+ cms.alerts.error("Cannot navigate away from an invalid form.");
5847
+ return;
5848
+ }
5849
+ cms.dispatch({
5850
+ type: "forms:set-active-field-name",
5851
+ value: { formId: tinaForm.id, fieldName: field.name }
5852
+ });
5832
5853
  }
5833
- cms.dispatch({
5834
- type: "forms:set-active-field-name",
5835
- value: { formId: tinaForm.id, fieldName: field.name }
5836
- });
5837
- }
5838
- },
5839
- field.label || field.name
5840
- ));
5841
- });
5854
+ },
5855
+ field.label || field.name,
5856
+ field.description && /* @__PURE__ */ React.createElement(
5857
+ "span",
5858
+ {
5859
+ className: `block font-sans text-xs italic font-light text-gray-400 pt-0.5 whitespace-normal m-0`,
5860
+ dangerouslySetInnerHTML: { __html: field.description }
5861
+ }
5862
+ )
5863
+ ));
5864
+ }
5865
+ );
5842
5866
  const Header = ({ onClick, children }) => {
5843
5867
  return /* @__PURE__ */ React.createElement("div", { className: "pt-1 mb-5" }, /* @__PURE__ */ React.createElement(
5844
5868
  "button",
@@ -14452,6 +14476,7 @@ function OverflowMenu({
14452
14476
  ToolbarButton,
14453
14477
  {
14454
14478
  showArrow: false,
14479
+ "data-testid": "rich-text-editor-overflow-menu-button",
14455
14480
  className: "lg:min-w-[130px]",
14456
14481
  isDropdown: true,
14457
14482
  pressed: openState.open,
@@ -14505,7 +14530,17 @@ const useRawMarkdownToolbarButton = () => {
14505
14530
  };
14506
14531
  const RawMarkdownToolbarButton = withRef(({ clear, ...rest }, ref) => {
14507
14532
  const { props } = useRawMarkdownToolbarButton();
14508
- return /* @__PURE__ */ React__default.createElement(ToolbarButton, { ref, tooltip: "Link", ...rest, ...props }, /* @__PURE__ */ React__default.createElement(Icons.raw, null));
14533
+ return /* @__PURE__ */ React__default.createElement(
14534
+ ToolbarButton,
14535
+ {
14536
+ ref,
14537
+ tooltip: "Link",
14538
+ ...rest,
14539
+ ...props,
14540
+ "data-testid": "markdown-button"
14541
+ },
14542
+ /* @__PURE__ */ React__default.createElement(Icons.raw, null)
14543
+ );
14509
14544
  });
14510
14545
  function TableDropdownMenu(props) {
14511
14546
  const tableSelected = useEditorSelector(
@@ -33816,5 +33851,6 @@ export {
33816
33851
  useScreenPlugin,
33817
33852
  useTinaAuthRedirect,
33818
33853
  wrapFieldWithError,
33854
+ wrapFieldWithNoHeader,
33819
33855
  wrapFieldsWithMeta
33820
33856
  };
@@ -1,6 +1,4 @@
1
- const makeCacheDir = async (dir, fs) => {
2
- const path = require("node:path");
3
- const os = require("node:os");
1
+ const makeCacheDir = async (dir, fs, path, os) => {
4
2
  const pathParts = dir.split(path.sep).filter(Boolean);
5
3
  const cacheHash = pathParts[pathParts.length - 1];
6
4
  const rootUser = pathParts[0];
@@ -17,8 +15,10 @@ const makeCacheDir = async (dir, fs) => {
17
15
  };
18
16
  const NodeCache = async (dir) => {
19
17
  const fs = require("node:fs");
18
+ const path = require("node:path");
19
+ const os = require("node:os");
20
20
  const { createHash } = require("node:crypto");
21
- const cacheDir = await makeCacheDir(dir, fs);
21
+ const cacheDir = await makeCacheDir(dir, fs, path, os);
22
22
  return {
23
23
  makeKey: (key) => {
24
24
  const input = key && key instanceof Object ? JSON.stringify(key) : key || "";
@@ -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-bb6864c-20241024011228",
3
+ "version": "0.0.0-bc59a81-20241030011355",
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/mdx": "1.5.0",
133
- "@tinacms/schema-tools": "1.6.6",
134
- "@tinacms/search": "1.0.33"
132
+ "@tinacms/mdx": "0.0.0-bc59a81-20241030011355",
133
+ "@tinacms/schema-tools": "0.0.0-bc59a81-20241030011355",
134
+ "@tinacms/search": "0.0.0-bc59a81-20241030011355"
135
135
  },
136
136
  "devDependencies": {
137
137
  "@graphql-tools/utils": "^10.5.4",