tinacms 3.8.1 → 3.8.3

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/README.md CHANGED
@@ -2,9 +2,9 @@
2
2
  [![npm version](https://img.shields.io/npm/v/tinacms.svg?style=flat)](https://www.npmjs.com/package/tinacms)
3
3
  [![Build, Test, Lint for Main](https://github.com/tinacms/tinacms/actions/workflows/main.yml/badge.svg?branch=main&event=push)](https://github.com/tinacms/tinacms/actions/workflows/main.yml)
4
4
 
5
- # [![TINA CMS](https://res.cloudinary.com/forestry-demo/image/upload/c_scale,w_400/v1694189357/tina-brand-assets/logos/png/Logo_Full_-_Default.png 'Visit tinacms.org')](https://tina.io)
5
+ # [![TINA CMS](./.github/assets/tinacms-logo-small-default.svg)](https://tina.io)
6
6
 
7
- [![Tina Demo](https://res.cloudinary.com/forestry-demo/video/upload/du_16,w_700,e_loop/tina-io/new-homepage/homepage-demo-2.gif)](https://tina.io/)
7
+ [![Tina Demo](./.github/assets/homepage-demo-2.gif)](https://tina.io/)
8
8
 
9
9
  Tina is a headless content management system with support for **Markdown**, MDX, JSON, YAML, and more.
10
10
 
@@ -35,7 +35,7 @@ Visit [Tina's documentation](https://tina.io/docs/) to learn more.
35
35
  [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?url=https%3A%2F%2Ftinacms.org&text=I%20just%20checked%20out%20@tinacms%20on%20GitHub%20and%20it%20is%20sweet%21&hashtags=TinaCMS%2Cjamstack%2Cheadlesscms)
36
36
  [![Forum](https://shields.io/github/discussions/tinacms/tinacms)](https://github.com/tinacms/tinacms/discussions)
37
37
 
38
- Visit the [GitHub Discussions](https://github.com/tinacms/tinacms/discussions) or our [Community Discord](https://discord.com/invite/zumN63Ybpf) to ask questions, or look us up on on Twitter at [@tinacms](https://twitter.com/tinacms).
38
+ Visit the [GitHub Discussions](https://github.com/tinacms/tinacms/discussions) or our [Community Discord](https://discord.com/invite/zumN63Ybpf) to ask questions, or look us up on Twitter at [@tinacms](https://twitter.com/tinacms).
39
39
 
40
40
  <!-- ## Changelog
41
41
 
@@ -75,5 +75,3 @@ Please see our [./CONTRIBUTING.md](https://github.com/tinacms/tinacms/blob/main/
75
75
  - Adam Cogan ([@adamcogan](https://github.com/adamcogan))
76
76
 
77
77
  View our awesome SSW devs at [ssw.com.au/people](https://www.ssw.com.au/people/?skill=%F0%9F%A6%99-TinaCMS).
78
-
79
- ![](https://res.cloudinary.com/forestry-demo/image/upload/h_85/v1573167387/Favicon.png)
package/dist/index.js CHANGED
@@ -978,7 +978,7 @@ const FieldMeta = ({
978
978
  onMouseOver: () => setHoveredField({ id: tinaForm.id, fieldName: name2 }),
979
979
  onMouseOut: () => setHoveredField({ id: null, fieldName: null }),
980
980
  onClick: () => setFocusedField({ id: tinaForm.id, fieldName: name2 }),
981
- style: { zIndex: index ? 1e3 - index : void 0 },
981
+ style: { zIndex: index != null ? 1e3 - index : void 0 },
982
982
  ...props
983
983
  },
984
984
  (label !== false || description) && /* @__PURE__ */ React.createElement(FieldLabel, { name: name2 }, label !== false && /* @__PURE__ */ React.createElement(React.Fragment, null, label || name2), description && /* @__PURE__ */ React.createElement(FieldDescription, null, description)),
@@ -3269,7 +3269,7 @@ const Heading1 = ({
3269
3269
  headerClasses,
3270
3270
  blockClasses,
3271
3271
  className,
3272
- "text-4xl mb-4 last:mb-0 mt-6 first:mt-0 font-libre-baskerville"
3272
+ "text-4xl mb-4 last:mb-0 mt-6 first:mt-0 font-inter"
3273
3273
  )
3274
3274
  },
3275
3275
  children
@@ -3286,7 +3286,7 @@ const Heading2 = ({
3286
3286
  headerClasses,
3287
3287
  blockClasses,
3288
3288
  className,
3289
- "text-3xl mb-4 last:mb-0 mt-6 first:mt-0 font-libre-baskerville"
3289
+ "text-3xl mb-4 last:mb-0 mt-6 first:mt-0 font-inter"
3290
3290
  )
3291
3291
  },
3292
3292
  children
@@ -3303,7 +3303,7 @@ const Heading3 = ({
3303
3303
  headerClasses,
3304
3304
  blockClasses,
3305
3305
  className,
3306
- "text-2xl mb-4 last:mb-0 mt-6 first:mt-0 font-libre-baskerville"
3306
+ "text-2xl mb-4 last:mb-0 mt-6 first:mt-0 font-inter"
3307
3307
  )
3308
3308
  },
3309
3309
  children
@@ -3320,13 +3320,13 @@ const Heading4 = ({
3320
3320
  headerClasses,
3321
3321
  blockClasses,
3322
3322
  className,
3323
- "text-xl mb-4 last:mb-0 mt-6 first:mt-0 font-libre-baskerville"
3323
+ "text-xl mb-4 last:mb-0 mt-6 first:mt-0 font-inter"
3324
3324
  )
3325
3325
  },
3326
3326
  children
3327
3327
  );
3328
- const headerSerifStyle = {
3329
- fontFamily: "'Libre Baskerville', serif",
3328
+ const headerFontStyle = {
3329
+ fontFamily: "'Inter', sans-serif",
3330
3330
  fontWeight: "400"
3331
3331
  };
3332
3332
  const Heading5 = ({
@@ -3343,7 +3343,7 @@ const Heading5 = ({
3343
3343
  className,
3344
3344
  "text-lg mb-4 last:mb-0 mt-6 first:mt-0"
3345
3345
  ),
3346
- style: headerSerifStyle
3346
+ style: headerFontStyle
3347
3347
  },
3348
3348
  children
3349
3349
  );
@@ -3361,7 +3361,7 @@ const Heading6 = ({
3361
3361
  className,
3362
3362
  "text-base mb-4 last:mb-0 mt-6 first:mt-0"
3363
3363
  ),
3364
- style: headerSerifStyle
3364
+ style: headerFontStyle
3365
3365
  },
3366
3366
  children
3367
3367
  );
@@ -4221,7 +4221,7 @@ const IconButton = ({
4221
4221
  function FontLoader() {
4222
4222
  React.useEffect(() => {
4223
4223
  const link = document.createElement("link");
4224
- link.href = "https://fonts.googleapis.com/css2?family=Inter:wght@400;600&family=Libre+Baskerville:wght@400;500;600;700&display=swap";
4224
+ link.href = "https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap";
4225
4225
  link.rel = "stylesheet";
4226
4226
  document.head.appendChild(link);
4227
4227
  return () => {
@@ -6150,7 +6150,7 @@ const ListFieldMeta = ({
6150
6150
  margin,
6151
6151
  ...hoverEvents,
6152
6152
  onClick: () => setFocusedField({ id: tinaForm.id, fieldName: name2 }),
6153
- style: { zIndex: index ? 1e3 - index : void 0 },
6153
+ style: { zIndex: index != null ? 1e3 - index : void 0 },
6154
6154
  ...props
6155
6155
  },
6156
6156
  /* @__PURE__ */ React.createElement(ListHeader, null, /* @__PURE__ */ React.createElement(ListMeta, null, label !== false && /* @__PURE__ */ React.createElement(ListLabel, null, label || name2), description && /* @__PURE__ */ React.createElement(FieldDescription, { className: "whitespace-nowrap text-ellipsis overflow-hidden" }, description)), actions && actions),
@@ -8279,7 +8279,10 @@ const format$1 = (date, format2) => {
8279
8279
  return m.format(format2);
8280
8280
  };
8281
8281
  const DateField = wrapFieldsWithMeta(
8282
- ({ input, field: { dateFormat, timeFormat, onChange, ...rest } }) => {
8282
+ ({
8283
+ input,
8284
+ field: { dateFormat, timeFormat, onChange, required, ...rest }
8285
+ }) => {
8283
8286
  const granularity = timeFormat ? "minute" : "day";
8284
8287
  const inputRef = React__default.useRef(null);
8285
8288
  React__default.useEffect(() => {
@@ -8303,14 +8306,16 @@ const DateField = wrapFieldsWithMeta(
8303
8306
  }
8304
8307
  return dateFormat;
8305
8308
  }, [dateFormat]);
8306
- const date = input.value ? new Date(input.value) : /* @__PURE__ */ new Date();
8309
+ const date = input.value ? new Date(input.value) : required === false ? void 0 : /* @__PURE__ */ new Date();
8307
8310
  return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
8308
8311
  DateTimePicker,
8309
8312
  {
8310
8313
  ...rest,
8311
8314
  ref: inputRef,
8312
8315
  granularity,
8313
- onChange: (value) => input.onChange(value ? value.toISOString() : value),
8316
+ onChange: (value) => input.onChange(
8317
+ value ? value.toISOString() : required !== false ? (/* @__PURE__ */ new Date()).toISOString() : value
8318
+ ),
8314
8319
  timeFormat: getTimeFormat(),
8315
8320
  hourCycle: 12,
8316
8321
  dateFormat: getDateFormat(),
@@ -12775,7 +12780,7 @@ const NavProvider = ({
12775
12780
  const name = "tinacms";
12776
12781
  const type = "module";
12777
12782
  const typings = "dist/index.d.ts";
12778
- const version$1 = "3.8.1";
12783
+ const version$1 = "3.8.3";
12779
12784
  const main = "dist/index.js";
12780
12785
  const module = "./dist/index.js";
12781
12786
  const exports = {
@@ -13966,7 +13971,10 @@ const FormsView = ({ loadingPlaceholder } = {}) => {
13966
13971
  const isEditing = !!activeForm;
13967
13972
  const formMetas = cms.plugins.all("form:meta");
13968
13973
  if (!isReferencingManyForms) {
13969
- return /* @__PURE__ */ React.createElement(React.Fragment, null, activeForm && /* @__PURE__ */ React.createElement("div", { className: "flex-1 flex flex-col flex-nowrap overflow-hidden h-full w-full relative bg-white" }, /* @__PURE__ */ React.createElement(
13974
+ if (!activeForm) {
13975
+ return /* @__PURE__ */ React.createElement(SidebarNoFormsPlaceholder, null);
13976
+ }
13977
+ return /* @__PURE__ */ React.createElement("div", { className: "flex-1 flex flex-col flex-nowrap overflow-hidden h-full w-full relative bg-white" }, /* @__PURE__ */ React.createElement(
13970
13978
  FormHeader,
13971
13979
  {
13972
13980
  activeForm,
@@ -13974,13 +13982,7 @@ const FormsView = ({ loadingPlaceholder } = {}) => {
13974
13982
  repoProvider: cms.api.admin.api.schema.config.config.repoProvider,
13975
13983
  isLocalMode: (_b = (_a = cms.api) == null ? void 0 : _a.tina) == null ? void 0 : _b.isLocalMode
13976
13984
  }
13977
- ), formMetas == null ? void 0 : formMetas.map((meta) => /* @__PURE__ */ React.createElement(React.Fragment, { key: meta.name }, /* @__PURE__ */ React.createElement(meta.Component, null))), /* @__PURE__ */ React.createElement(
13978
- FormBuilder,
13979
- {
13980
- form: activeForm,
13981
- onPristineChange: setFormIsPristine
13982
- }
13983
- )));
13985
+ ), formMetas == null ? void 0 : formMetas.map((meta) => /* @__PURE__ */ React.createElement(React.Fragment, { key: meta.name }, /* @__PURE__ */ React.createElement(meta.Component, null))), /* @__PURE__ */ React.createElement(FormBuilder, { form: activeForm, onPristineChange: setFormIsPristine }));
13984
13986
  }
13985
13987
  return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
13986
13988
  Transition,
@@ -72989,7 +72991,7 @@ const SearchInput = ({
72989
72991
  if (e.key === "Enter") {
72990
72992
  e.preventDefault();
72991
72993
  if (searchInput.trim()) {
72992
- setSearch(searchInput);
72994
+ setSearch(searchInput.trim());
72993
72995
  setSearchLoaded(false);
72994
72996
  }
72995
72997
  }
@@ -72997,9 +72999,9 @@ const SearchInput = ({
72997
72999
  const handleSubmit = (e) => {
72998
73000
  e.preventDefault();
72999
73001
  if (searchInput.trim()) {
73000
- setSearch(searchInput);
73002
+ setSearch(searchInput.trim());
73001
73003
  captureEvent(CollectionListPageSearchEvent, {
73002
- searchQuery: searchInput
73004
+ searchQuery: searchInput.trim()
73003
73005
  });
73004
73006
  setSearchLoaded(false);
73005
73007
  }
@@ -36,7 +36,7 @@ export declare class Subscribable {
36
36
  /**
37
37
  * Removes the given listener from the `Subscribable` object.
38
38
  *
39
- * @param listener The functioni to be removed.
39
+ * @param listener The function to be removed.
40
40
  */
41
41
  unsubscribe(listener: Function): void;
42
42
  /**
@@ -68,5 +68,5 @@ export declare class Subscribable {
68
68
  * cup.empty() // Logs: false
69
69
  * ```
70
70
  */
71
- protected notifiySubscribers(): void;
71
+ protected notifySubscribers(): void;
72
72
  }
@@ -26,4 +26,5 @@ export interface Field<F extends Field = AnyField> {
26
26
  * field which is marked as the active field, and have focus on another field
27
27
  */
28
28
  experimental_focusIntent?: boolean;
29
+ required?: boolean;
29
30
  }
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.8.1",
5
+ "version": "3.8.3",
6
6
  "main": "dist/index.js",
7
7
  "module": "./dist/index.js",
8
8
  "exports": {
@@ -111,16 +111,16 @@
111
111
  "react-dropzone": "14.2.3",
112
112
  "react-final-form": "^6.5.9",
113
113
  "react-icons": "^5.4.0",
114
- "react-router-dom": "6.3.0",
114
+ "react-router-dom": "^6.30.3",
115
115
  "react-use": "^17.6.0",
116
116
  "tailwind-merge": "^2.6.0",
117
117
  "webfontloader": "1.6.28",
118
118
  "yup": "^1.6.1",
119
119
  "zod": "^3.24.2",
120
- "@tinacms/mdx": "2.1.4",
121
- "@tinacms/schema-tools": "2.7.4",
122
- "@tinacms/bridge": "0.2.0",
123
- "@tinacms/search": "1.2.15"
120
+ "@tinacms/bridge": "0.3.0",
121
+ "@tinacms/mdx": "2.1.5",
122
+ "@tinacms/schema-tools": "2.8.0",
123
+ "@tinacms/search": "1.2.16"
124
124
  },
125
125
  "devDependencies": {
126
126
  "@graphql-tools/utils": "^10.8.1",