tinacms 3.1.3 → 3.2.0

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/index.js CHANGED
@@ -1402,6 +1402,7 @@ function wrapFieldsWithMeta(Field2) {
1402
1402
  error: props.meta.error,
1403
1403
  index: props.index,
1404
1404
  tinaForm: props.tinaForm,
1405
+ field: props.field,
1405
1406
  focusIntent: props.field.focusIntent,
1406
1407
  hoverIntent: props.field.hoverIntent
1407
1408
  },
@@ -1454,6 +1455,7 @@ const FieldMeta = ({
1454
1455
  children,
1455
1456
  index,
1456
1457
  tinaForm,
1458
+ field,
1457
1459
  focusIntent,
1458
1460
  hoverIntent,
1459
1461
  ...props
@@ -1481,6 +1483,7 @@ const FieldMeta = ({
1481
1483
  FieldWrapper,
1482
1484
  {
1483
1485
  margin,
1486
+ field,
1484
1487
  onMouseOver: () => setHoveredField({ id: tinaForm.id, fieldName: name }),
1485
1488
  onMouseOut: () => setHoveredField({ id: null, fieldName: null }),
1486
1489
  onClick: handleClick,
@@ -1497,9 +1500,10 @@ const FieldMeta = ({
1497
1500
  const FieldWrapper = ({
1498
1501
  margin,
1499
1502
  children,
1503
+ field,
1500
1504
  "data-tina-field-active": dataActive,
1501
1505
  "data-tina-field-hovering": dataHovering,
1502
- ...restProps
1506
+ ...props
1503
1507
  }) => {
1504
1508
  const isActive = dataActive === "true";
1505
1509
  const isHovering = dataHovering === "true";
@@ -1521,10 +1525,10 @@ const FieldWrapper = ({
1521
1525
  return /* @__PURE__ */ React.createElement(
1522
1526
  "div",
1523
1527
  {
1524
- className: `relative ${margin ? `mb-5 last:mb-0` : ``} ${getFieldStateClasses()}`,
1528
+ className: `relative w-full px-2 ${margin ? "mb-5 last:mb-0" : ""} ${(field == null ? void 0 : field.width) === "half" ? "@sm:w-1/2" : ""} ${getFieldStateClasses()}`,
1525
1529
  "data-tina-field-active": dataActive,
1526
1530
  "data-tina-field-hovering": dataHovering,
1527
- ...restProps
1531
+ ...props
1528
1532
  },
1529
1533
  children
1530
1534
  );
@@ -38245,7 +38249,7 @@ function FieldsBuilder({
38245
38249
  }, [setFieldPlugins]);
38246
38250
  React.useEffect(() => updateFieldPlugins(), []);
38247
38251
  useEventSubscription("plugin:add:field", () => updateFieldPlugins(), []);
38248
- return /* @__PURE__ */ React.createElement(FieldsGroup, { padding }, fields.map((field, index) => {
38252
+ return /* @__PURE__ */ React.createElement(FieldsGroup, null, fields.map((field, index) => {
38249
38253
  return /* @__PURE__ */ React.createElement(
38250
38254
  InnerField,
38251
38255
  {
@@ -38306,6 +38310,7 @@ const InnerField = ({
38306
38310
  {
38307
38311
  name: field.name,
38308
38312
  key: field.name,
38313
+ className: "w-full",
38309
38314
  isEqual: (a2, b) => isEqual(field, a2, b),
38310
38315
  type,
38311
38316
  parse: parse2 ? (value, name) => parse2(value, name, field) : void 0,
@@ -38354,13 +38359,12 @@ const InnerField = ({
38354
38359
  );
38355
38360
  };
38356
38361
  const FieldsGroup = ({
38357
- padding,
38358
38362
  children
38359
38363
  }) => {
38360
38364
  return /* @__PURE__ */ React.createElement(
38361
38365
  "div",
38362
38366
  {
38363
- className: `relative block w-full h-full whitespace-nowrap overflow-x-visible ${padding ? `pb-5` : ``}`
38367
+ className: `relative flex flex-wrap w-full h-full whitespace-nowrap overflow-x-visible`
38364
38368
  },
38365
38369
  children
38366
38370
  );
@@ -39977,7 +39981,7 @@ const Select$1 = ({
39977
39981
  ref.current.focus();
39978
39982
  }
39979
39983
  }, [field == null ? void 0 : field.focusIntent, ref]);
39980
- return /* @__PURE__ */ React.createElement("div", { className: "relative group w-full h-full md:w-auto" }, /* @__PURE__ */ React.createElement(
39984
+ return /* @__PURE__ */ React.createElement("div", { className: "relative group w-full h-fit md:w-auto" }, /* @__PURE__ */ React.createElement(
39981
39985
  "select",
39982
39986
  {
39983
39987
  id: input.name,
@@ -46527,7 +46531,7 @@ const NavProvider = ({
46527
46531
  };
46528
46532
  return /* @__PURE__ */ React__default.createElement(NavContext.Provider, { value }, children);
46529
46533
  };
46530
- const version$1 = "3.1.3";
46534
+ const version$1 = "3.2.0";
46531
46535
  const VersionInfo = () => {
46532
46536
  var _a2, _b, _c, _d, _e, _f;
46533
46537
  const cms = useCMS();
@@ -64657,9 +64661,9 @@ const FormWrapper = ({
64657
64661
  "div",
64658
64662
  {
64659
64663
  "data-test": `form:${id2 == null ? void 0 : id2.replace(/\\/g, "/")}`,
64660
- className: "h-full overflow-y-auto max-h-full bg-gray-50"
64664
+ className: "h-full overflow-y-auto max-h-full bg-gray-50 @container"
64661
64665
  },
64662
- /* @__PURE__ */ React.createElement("div", { className: "py-5 px-6" }, children)
64666
+ /* @__PURE__ */ React.createElement("div", { className: "py-5 px-4" }, children)
64663
64667
  );
64664
64668
  };
64665
64669
  const Emoji = ({ className = "", ...props }) => /* @__PURE__ */ React.createElement(
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { FieldProps } from './field-props';
3
- import { Form } from '../../forms';
3
+ import { Form, Field } 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
6
  /**
@@ -21,13 +21,15 @@ interface FieldMetaProps extends React.HTMLAttributes<HTMLElement> {
21
21
  margin?: boolean;
22
22
  index?: number;
23
23
  tinaForm: Form;
24
+ field?: Field;
24
25
  focusIntent?: boolean;
25
26
  hoverIntent?: boolean;
26
27
  }
27
- export declare const FieldMeta: ({ name, label, description, error, margin, children, index, tinaForm, focusIntent, hoverIntent, ...props }: FieldMetaProps) => React.JSX.Element;
28
- export declare const FieldWrapper: ({ margin, children, "data-tina-field-active": dataActive, "data-tina-field-hovering": dataHovering, ...restProps }: {
28
+ export declare const FieldMeta: ({ name, label, description, error, margin, children, index, tinaForm, field, focusIntent, hoverIntent, ...props }: FieldMetaProps) => React.JSX.Element;
29
+ export declare const FieldWrapper: ({ margin, children, field, "data-tina-field-active": dataActive, "data-tina-field-hovering": dataHovering, ...props }: {
29
30
  margin: boolean;
30
31
  children: React.ReactNode;
32
+ field?: Field;
31
33
  "data-tina-field-active"?: string;
32
34
  "data-tina-field-hovering"?: string;
33
35
  } & Partial<React.ComponentPropsWithoutRef<"div">>) => React.JSX.Element;
@@ -8,7 +8,6 @@ export interface FieldsBuilderProps {
8
8
  padding?: boolean;
9
9
  }
10
10
  export declare function FieldsBuilder({ form, fields, activeFieldName, hoveringFieldName, padding, }: FieldsBuilderProps): React.JSX.Element;
11
- export declare const FieldsGroup: ({ padding, children, }: {
12
- padding?: boolean;
11
+ export declare const FieldsGroup: ({ children, }: {
13
12
  children?: any | any[];
14
13
  }) => React.JSX.Element;
@@ -15,6 +15,7 @@ export interface Field<F extends Field = AnyField> {
15
15
  defaultValue?: any;
16
16
  namespace?: string[];
17
17
  fields?: F[];
18
+ width?: 'full' | 'half';
18
19
  /**
19
20
  * Focus events can come from outside of the component, this is not
20
21
  * a guarantee that the given field will receive focus since that functionality
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "tinacms",
3
3
  "type": "module",
4
4
  "typings": "dist/index.d.ts",
5
- "version": "3.1.3",
5
+ "version": "3.2.0",
6
6
  "main": "dist/index.js",
7
7
  "module": "./dist/index.js",
8
8
  "exports": {
@@ -110,9 +110,9 @@
110
110
  "webfontloader": "1.6.28",
111
111
  "yup": "^1.6.1",
112
112
  "zod": "^3.24.2",
113
- "@tinacms/mdx": "2.0.1",
114
- "@tinacms/schema-tools": "2.1.0",
115
- "@tinacms/search": "1.1.8"
113
+ "@tinacms/mdx": "2.0.2",
114
+ "@tinacms/search": "1.1.9",
115
+ "@tinacms/schema-tools": "2.2.0"
116
116
  },
117
117
  "devDependencies": {
118
118
  "@graphql-tools/utils": "^10.8.1",