tinacms 0.65.0 → 0.66.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/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # tinacms
2
2
 
3
+ ## 0.66.0
4
+
5
+ ### Minor Changes
6
+
7
+ - d6f46a9f9: fix: When passing in queries into the root TinaCMS container, don't overwrite the data prop on an empty query
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [37286858e]
12
+ - @tinacms/toolkit@0.56.10
13
+
14
+ ## 0.65.3
15
+
16
+ ### Patch Changes
17
+
18
+ - 0c4456c11: fix: Send update to useTina hook on the initial isLoading change
19
+
20
+ ## 0.65.2
21
+
22
+ ### Patch Changes
23
+
24
+ - a9b385b01: Fix mutation string for document creation
25
+
26
+ ## 0.65.1
27
+
28
+ ### Patch Changes
29
+
30
+ - 68284198a: fix: use user-specific document creator callback
31
+ - ccf4dcbd4: chore: Export low-level data provider from "tinacms", for the playground and other sandboz environments
32
+ - f2431c031: Fix type for code_block TinaMarkdown element
33
+
3
34
  ## 0.65.0
4
35
 
5
36
  ### Minor Changes
package/dist/index.es.js CHANGED
@@ -2756,7 +2756,9 @@ const TinaCMSProvider2 = (_c) => {
2756
2756
  isLocalClient,
2757
2757
  cmsCallback: props.cmsCallback,
2758
2758
  mediaStore: props.mediaStore
2759
- }, /* @__PURE__ */ React.createElement("style", null, styles), /* @__PURE__ */ React.createElement(ErrorBoundary, null, /* @__PURE__ */ React.createElement(DocumentCreator, null), /* @__PURE__ */ React.createElement(TinaDataProvider, {
2759
+ }, /* @__PURE__ */ React.createElement("style", null, styles), /* @__PURE__ */ React.createElement(ErrorBoundary, null, /* @__PURE__ */ React.createElement(DocumentCreator, {
2760
+ documentCreatorCallback
2761
+ }), /* @__PURE__ */ React.createElement(TinaDataProvider, {
2760
2762
  formifyCallback
2761
2763
  }, typeof props.children == "function" ? /* @__PURE__ */ React.createElement(TinaQuery, __spreadProps(__spreadValues({}, props), {
2762
2764
  variables: props.variables,
@@ -2784,7 +2786,7 @@ const TinaQueryInner = (_e) => {
2784
2786
  variables: props.variables,
2785
2787
  data: props.data
2786
2788
  });
2787
- return /* @__PURE__ */ React.createElement(React.Fragment, null, children(isLoading ? props : __spreadProps(__spreadValues({}, props), { data: liveData })));
2789
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, children(isLoading || !props.query ? props : __spreadProps(__spreadValues({}, props), { data: liveData })));
2788
2790
  };
2789
2791
  const TinaDataProvider = ({
2790
2792
  children,
@@ -2827,7 +2829,7 @@ const FormRegistrar = ({
2827
2829
  });
2828
2830
  React.useEffect(() => {
2829
2831
  onPayloadStateChange({ payload, isLoading });
2830
- }, [JSON.stringify(payload)]);
2832
+ }, [JSON.stringify(payload), isLoading]);
2831
2833
  return isLoading ? /* @__PURE__ */ React.createElement(Loader, null, /* @__PURE__ */ React.createElement(React.Fragment, null)) : null;
2832
2834
  };
2833
2835
  const Loader = (props) => {
@@ -3138,10 +3140,13 @@ class TinaAdminApi {
3138
3140
  return response;
3139
3141
  }
3140
3142
  async createDocument(collectionName, relativePath, params) {
3141
- const response = await this.api.request(`mutation($collection: String!, $relativePath: String!, $params: DocumentMutation!) {
3143
+ const response = await this.api.request(`#graphql
3144
+ mutation($collection: String!, $relativePath: String!, $params: DocumentMutation!) {
3142
3145
  createDocument(
3143
3146
  collection: $collection,
3144
3147
  relativePath: $relativePath,
3148
+ params: $params
3149
+ ){__typename}
3145
3150
  }`, {
3146
3151
  variables: {
3147
3152
  collection: collectionName,
@@ -3152,10 +3157,11 @@ class TinaAdminApi {
3152
3157
  return response;
3153
3158
  }
3154
3159
  async updateDocument(collectionName, relativePath, params) {
3155
- const response = await this.api.request(`mutation($collection: String!, $relativePath: String!, $params: DocumentMutation!) {
3156
- updateDocument(
3160
+ const response = await this.api.request(`#graphql
3161
+ mutation($collection: String!, $relativePath: String!, $params: DocumentMutation!) {
3162
+ updateDocument(
3157
3163
  collection: $collection,
3158
- relativePath: $relativePath,
3164
+ relativePath: $relativePath,
3159
3165
  params: $params
3160
3166
  ){__typename}
3161
3167
  }`, {
@@ -3710,4 +3716,4 @@ class RouteMappingPlugin {
3710
3716
  this.mapper = mapper;
3711
3717
  }
3712
3718
  }
3713
- export { AuthWallInner, Client, DEFAULT_LOCAL_TINA_GQL_SERVER_URL, LocalClient, RouteMappingPlugin, TinaAdmin, TinaAdminApi, TinaCMSProvider2, TinaCloudAuthWall, TinaCloudProvider, assertShape, createClient, TinaCMSProvider2 as default, getStaticPropsForTina, gql, safeAssertShape, staticRequest, useDocumentCreatorPlugin, useGraphqlForms, useTinaAuthRedirect };
3719
+ export { AuthWallInner, Client, DEFAULT_LOCAL_TINA_GQL_SERVER_URL, LocalClient, RouteMappingPlugin, TinaAdmin, TinaAdminApi, TinaCMSProvider2, TinaCloudAuthWall, TinaCloudProvider, TinaDataProvider, assertShape, createClient, TinaCMSProvider2 as default, getStaticPropsForTina, gql, safeAssertShape, staticRequest, useDocumentCreatorPlugin, useGraphqlForms, useTinaAuthRedirect };
package/dist/index.js CHANGED
@@ -2776,7 +2776,9 @@ Document
2776
2776
  isLocalClient,
2777
2777
  cmsCallback: props.cmsCallback,
2778
2778
  mediaStore: props.mediaStore
2779
- }, /* @__PURE__ */ React__default["default"].createElement("style", null, styles), /* @__PURE__ */ React__default["default"].createElement(ErrorBoundary, null, /* @__PURE__ */ React__default["default"].createElement(DocumentCreator, null), /* @__PURE__ */ React__default["default"].createElement(TinaDataProvider, {
2779
+ }, /* @__PURE__ */ React__default["default"].createElement("style", null, styles), /* @__PURE__ */ React__default["default"].createElement(ErrorBoundary, null, /* @__PURE__ */ React__default["default"].createElement(DocumentCreator, {
2780
+ documentCreatorCallback
2781
+ }), /* @__PURE__ */ React__default["default"].createElement(TinaDataProvider, {
2780
2782
  formifyCallback
2781
2783
  }, typeof props.children == "function" ? /* @__PURE__ */ React__default["default"].createElement(TinaQuery, __spreadProps(__spreadValues({}, props), {
2782
2784
  variables: props.variables,
@@ -2804,7 +2806,7 @@ Document
2804
2806
  variables: props.variables,
2805
2807
  data: props.data
2806
2808
  });
2807
- return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, children(isLoading ? props : __spreadProps(__spreadValues({}, props), { data: liveData })));
2809
+ return /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, children(isLoading || !props.query ? props : __spreadProps(__spreadValues({}, props), { data: liveData })));
2808
2810
  };
2809
2811
  const TinaDataProvider = ({
2810
2812
  children,
@@ -2847,7 +2849,7 @@ Document
2847
2849
  });
2848
2850
  React__default["default"].useEffect(() => {
2849
2851
  onPayloadStateChange({ payload, isLoading });
2850
- }, [JSON.stringify(payload)]);
2852
+ }, [JSON.stringify(payload), isLoading]);
2851
2853
  return isLoading ? /* @__PURE__ */ React__default["default"].createElement(Loader, null, /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null)) : null;
2852
2854
  };
2853
2855
  const Loader = (props) => {
@@ -3158,10 +3160,13 @@ This will work when developing locally but NOT when deployed to production.
3158
3160
  return response;
3159
3161
  }
3160
3162
  async createDocument(collectionName, relativePath, params) {
3161
- const response = await this.api.request(`mutation($collection: String!, $relativePath: String!, $params: DocumentMutation!) {
3163
+ const response = await this.api.request(`#graphql
3164
+ mutation($collection: String!, $relativePath: String!, $params: DocumentMutation!) {
3162
3165
  createDocument(
3163
3166
  collection: $collection,
3164
3167
  relativePath: $relativePath,
3168
+ params: $params
3169
+ ){__typename}
3165
3170
  }`, {
3166
3171
  variables: {
3167
3172
  collection: collectionName,
@@ -3172,10 +3177,11 @@ This will work when developing locally but NOT when deployed to production.
3172
3177
  return response;
3173
3178
  }
3174
3179
  async updateDocument(collectionName, relativePath, params) {
3175
- const response = await this.api.request(`mutation($collection: String!, $relativePath: String!, $params: DocumentMutation!) {
3176
- updateDocument(
3180
+ const response = await this.api.request(`#graphql
3181
+ mutation($collection: String!, $relativePath: String!, $params: DocumentMutation!) {
3182
+ updateDocument(
3177
3183
  collection: $collection,
3178
- relativePath: $relativePath,
3184
+ relativePath: $relativePath,
3179
3185
  params: $params
3180
3186
  ){__typename}
3181
3187
  }`, {
@@ -3740,6 +3746,7 @@ This will work when developing locally but NOT when deployed to production.
3740
3746
  exports2.TinaCMSProvider2 = TinaCMSProvider2;
3741
3747
  exports2.TinaCloudAuthWall = TinaCloudAuthWall;
3742
3748
  exports2.TinaCloudProvider = TinaCloudProvider;
3749
+ exports2.TinaDataProvider = TinaDataProvider;
3743
3750
  exports2.assertShape = assertShape;
3744
3751
  exports2.createClient = createClient;
3745
3752
  exports2["default"] = TinaCMSProvider2;
@@ -61,7 +61,7 @@ declare type BaseComponents = {
61
61
  children: JSX.Element;
62
62
  };
63
63
  code_block?: {
64
- language?: string;
64
+ lang?: string;
65
65
  children: JSX.Element;
66
66
  };
67
67
  img?: {
@@ -98,6 +98,10 @@ declare type QueryProviderProps = {
98
98
  data?: never;
99
99
  };
100
100
  export declare const TinaCMSProvider2: ({ query, documentCreatorCallback, formifyCallback, ...props }: QueryProviderProps & APIProviderProps & BaseProviderProps) => JSX.Element;
101
+ export declare const TinaDataProvider: ({ children, formifyCallback, }: {
102
+ children: any;
103
+ formifyCallback: formifyCallback;
104
+ }) => JSX.Element;
101
105
  /**
102
106
  * @deprecated v0.62.0: Use `staticRequest` and a "try catch" block instead. see https://tina.io/docs/features/data-fetching/#querying-tina-content-in-nextjs for more details
103
107
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tinacms",
3
- "version": "0.65.0",
3
+ "version": "0.66.0",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist"
@@ -17,13 +17,14 @@
17
17
  "scripts": {
18
18
  "types": "yarn tsc",
19
19
  "build": "echo \"Run `yarn build` from the root of the repository instead\"",
20
- "test": "jest --env=jsdom --passWithNoTests"
20
+ "test": "jest --env=jsdom --passWithNoTests",
21
+ "test-watch": "jest --env=jsdom --passWithNoTests --watch"
21
22
  },
22
23
  "dependencies": {
23
24
  "@headlessui/react": "^1.4.1",
24
25
  "@heroicons/react": "^1.0.4",
25
26
  "@tinacms/sharedctx": "0.1.0",
26
- "@tinacms/toolkit": "0.56.9",
27
+ "@tinacms/toolkit": "0.56.10",
27
28
  "crypto-js": "^4.0.0",
28
29
  "final-form": "4.20.1",
29
30
  "graphql": "^15.1.0",