tinacms 1.1.5 → 1.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/LICENSE +8 -0
- package/dist/admin/api.d.ts +9 -11
- package/dist/admin/components/AuthTemplate.d.ts +2 -10
- package/dist/admin/components/GetCMS.d.ts +2 -10
- package/dist/admin/components/GetCollection.d.ts +6 -12
- package/dist/admin/components/GetCollections.d.ts +2 -10
- package/dist/admin/components/GetDocument.d.ts +2 -10
- package/dist/admin/components/Layout.d.ts +2 -10
- package/dist/admin/components/LoadingPage.d.ts +2 -10
- package/dist/admin/components/Page.d.ts +1 -10
- package/dist/admin/components/Sidebar.d.ts +2 -10
- package/dist/admin/index.d.ts +2 -10
- package/dist/admin/pages/CollectionCreatePage.d.ts +2 -10
- package/dist/admin/pages/CollectionListPage.d.ts +2 -10
- package/dist/admin/pages/CollectionUpdatePage.d.ts +2 -10
- package/dist/admin/pages/DashboardPage.d.ts +2 -10
- package/dist/admin/pages/LoginPage.d.ts +2 -10
- package/dist/admin/pages/LogoutPage.d.ts +2 -10
- package/dist/admin/pages/ScreenPage.d.ts +2 -10
- package/dist/admin/plugins/route-mapping.d.ts +1 -10
- package/dist/admin/types.d.ts +1 -10
- package/dist/auth/AuthModal.d.ts +2 -10
- package/dist/auth/TinaCloudProvider.d.ts +1 -10
- package/dist/auth/authenticate.d.ts +3 -12
- package/dist/auth/index.d.ts +1 -10
- package/dist/auth/popupWindow.d.ts +1 -10
- package/dist/auth/useGenerator.d.ts +1 -10
- package/dist/auth/useTinaAuthRedirect.d.ts +1 -10
- package/dist/client.d.ts +1 -10
- package/dist/client.es.js +1 -29
- package/dist/client.js +3 -31
- package/dist/edit-state.d.ts +1 -10
- package/dist/hooks/create-page-plugin.d.ts +1 -10
- package/dist/hooks/formify/formify-utils.d.ts +1 -10
- package/dist/hooks/formify/formify.d.ts +1 -10
- package/dist/hooks/formify/index.d.ts +1 -10
- package/dist/hooks/formify/reducer.d.ts +1 -10
- package/dist/hooks/formify/spec/runner.d.ts +1 -10
- package/dist/hooks/formify/spec/util.d.ts +1 -10
- package/dist/hooks/formify/types.d.ts +1 -10
- package/dist/hooks/formify/util.d.ts +1 -10
- package/dist/hooks/use-content-creator.d.ts +1 -10
- package/dist/hooks/use-graphql-forms.d.ts +1 -10
- package/dist/index.d.ts +1 -10
- package/dist/index.es.js +325 -76
- package/dist/index.js +326 -77
- package/dist/internalClient/formify.d.ts +1 -10
- package/dist/internalClient/index.d.ts +2 -13
- package/dist/rich-text/index.d.ts +2 -10
- package/dist/rich-text/prism.d.ts +2 -10
- package/dist/style.css +38 -8
- package/dist/tina-cms.d.ts +2 -10
- package/dist/types/cms.d.ts +1 -10
- package/dist/unifiedClient/index.d.ts +1 -11
- package/dist/utils/client.d.ts +1 -10
- package/dist/utils/index.d.ts +1 -10
- package/package.json +5 -6
- package/dist/utils/parseUrl.d.ts +0 -18
package/dist/client.js
CHANGED
|
@@ -1,43 +1,15 @@
|
|
|
1
1
|
(function(global, factory) {
|
|
2
|
-
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("fetch-ponyfill")
|
|
3
|
-
})(this, function(exports2, fetchPonyfill
|
|
2
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("fetch-ponyfill")) : typeof define === "function" && define.amd ? define(["exports", "fetch-ponyfill"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.tinacms = {}, global.NOOP));
|
|
3
|
+
})(this, function(exports2, fetchPonyfill) {
|
|
4
4
|
"use strict";
|
|
5
5
|
function _interopDefaultLegacy(e) {
|
|
6
6
|
return e && typeof e === "object" && "default" in e ? e : { "default": e };
|
|
7
7
|
}
|
|
8
8
|
var fetchPonyfill__default = /* @__PURE__ */ _interopDefaultLegacy(fetchPonyfill);
|
|
9
|
-
var UrlPattern__default = /* @__PURE__ */ _interopDefaultLegacy(UrlPattern);
|
|
10
9
|
const { fetch, Headers } = fetchPonyfill__default["default"]();
|
|
11
10
|
const TINA_HOST = "content.tinajs.io";
|
|
12
11
|
class TinaClient {
|
|
13
12
|
constructor({ token, url, queries }) {
|
|
14
|
-
this.parseURL = (overrideUrl) => {
|
|
15
|
-
const url2 = overrideUrl || this.apiUrl;
|
|
16
|
-
if (url2.includes("localhost")) {
|
|
17
|
-
return {
|
|
18
|
-
host: "localhost",
|
|
19
|
-
branch: null,
|
|
20
|
-
isLocalClient: true,
|
|
21
|
-
clientId: null
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
const params = new URL(url2);
|
|
25
|
-
const pattern = new UrlPattern__default["default"]("/content/:clientId/github/*", {
|
|
26
|
-
escapeChar: " "
|
|
27
|
-
});
|
|
28
|
-
const result = pattern.match(params.pathname);
|
|
29
|
-
const branch = result == null ? void 0 : result._;
|
|
30
|
-
const clientId = result == null ? void 0 : result.clientId;
|
|
31
|
-
if (!branch || !clientId) {
|
|
32
|
-
throw new Error(`Invalid URL format provided. Expected: https://${TINA_HOST}/content/<ClientID>/github/<Branch> but but received ${url2}`);
|
|
33
|
-
}
|
|
34
|
-
return {
|
|
35
|
-
host: params.host,
|
|
36
|
-
clientId,
|
|
37
|
-
branch,
|
|
38
|
-
isLocalClient: false
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
13
|
this.apiUrl = url;
|
|
42
14
|
this.readonlyToken = token;
|
|
43
15
|
this.queries = queries(this);
|
|
@@ -69,7 +41,7 @@
|
|
|
69
41
|
const json = await res.json();
|
|
70
42
|
if (json.errors) {
|
|
71
43
|
throw new Error(`Unable to fetch, please see our FAQ for more information: https://tina.io/docs/errors/faq/
|
|
72
|
-
|
|
44
|
+
|
|
73
45
|
Errors:
|
|
74
46
|
${json.errors.map((error) => error.message).join("\n")}`);
|
|
75
47
|
}
|
package/dist/edit-state.d.ts
CHANGED
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License.
|
|
5
|
-
You may obtain a copy of the License at
|
|
6
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software
|
|
8
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
-
See the License for the specific language governing permissions and
|
|
11
|
-
limitations under the License.
|
|
2
|
+
|
|
12
3
|
*/
|
|
13
4
|
import { isEditing, setEditing } from '@tinacms/sharedctx';
|
|
14
5
|
import React from 'react';
|
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License.
|
|
5
|
-
You may obtain a copy of the License at
|
|
6
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software
|
|
8
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
-
See the License for the specific language governing permissions and
|
|
11
|
-
limitations under the License.
|
|
2
|
+
|
|
12
3
|
*/
|
|
13
4
|
import { AddContentPlugin, TinaCMS } from '@tinacms/toolkit';
|
|
14
5
|
declare type CollectionShape = {
|
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License.
|
|
5
|
-
You may obtain a copy of the License at
|
|
6
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software
|
|
8
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
-
See the License for the specific language governing permissions and
|
|
11
|
-
limitations under the License.
|
|
2
|
+
|
|
12
3
|
*/
|
|
13
4
|
import * as G from 'graphql';
|
|
14
5
|
import type { BlueprintPath } from './types';
|
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License.
|
|
5
|
-
You may obtain a copy of the License at
|
|
6
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software
|
|
8
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
-
See the License for the specific language governing permissions and
|
|
11
|
-
limitations under the License.
|
|
2
|
+
|
|
12
3
|
*/
|
|
13
4
|
import * as G from 'graphql';
|
|
14
5
|
import type { DocumentBlueprint } from './types';
|
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License.
|
|
5
|
-
You may obtain a copy of the License at
|
|
6
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software
|
|
8
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
-
See the License for the specific language governing permissions and
|
|
11
|
-
limitations under the License.
|
|
2
|
+
|
|
12
3
|
*/
|
|
13
4
|
import type { TinaCMS } from '@tinacms/toolkit';
|
|
14
5
|
import { formify } from './formify';
|
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License.
|
|
5
|
-
You may obtain a copy of the License at
|
|
6
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software
|
|
8
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
-
See the License for the specific language governing permissions and
|
|
11
|
-
limitations under the License.
|
|
2
|
+
|
|
12
3
|
*/
|
|
13
4
|
import { FormNode, State, Action, OnChangeEvent } from './types';
|
|
14
5
|
export declare function reducer(state: State, action: Action): State;
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License.
|
|
5
|
-
You may obtain a copy of the License at
|
|
6
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software
|
|
8
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
-
See the License for the specific language governing permissions and
|
|
11
|
-
limitations under the License.
|
|
2
|
+
|
|
12
3
|
*/
|
|
13
4
|
export declare const testRunner: (query: any, events: any, dirname: any, expectNoChange?: boolean) => Promise<void>;
|
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License.
|
|
5
|
-
You may obtain a copy of the License at
|
|
6
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software
|
|
8
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
-
See the License for the specific language governing permissions and
|
|
11
|
-
limitations under the License.
|
|
2
|
+
|
|
12
3
|
*/
|
|
13
4
|
import { TinaCMS } from '@tinacms/toolkit';
|
|
14
5
|
import 'isomorphic-fetch';
|
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License.
|
|
5
|
-
You may obtain a copy of the License at
|
|
6
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software
|
|
8
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
-
See the License for the specific language governing permissions and
|
|
11
|
-
limitations under the License.
|
|
2
|
+
|
|
12
3
|
*/
|
|
13
4
|
/// <reference types="react" />
|
|
14
5
|
import type * as G from 'graphql';
|
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License.
|
|
5
|
-
You may obtain a copy of the License at
|
|
6
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software
|
|
8
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
-
See the License for the specific language governing permissions and
|
|
11
|
-
limitations under the License.
|
|
2
|
+
|
|
12
3
|
*/
|
|
13
4
|
import { Form, Field, TinaCMS } from '@tinacms/toolkit';
|
|
14
5
|
import type { DocumentBlueprint, FieldBlueprint, FormifiedDocumentNode, OnChangeEvent, FormNode, State, ChangeSet, BlueprintPath } from './types';
|
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License.
|
|
5
|
-
You may obtain a copy of the License at
|
|
6
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software
|
|
8
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
-
See the License for the specific language governing permissions and
|
|
11
|
-
limitations under the License.
|
|
2
|
+
|
|
12
3
|
*/
|
|
13
4
|
import { OnNewDocument } from './create-page-plugin';
|
|
14
5
|
export declare type FilterCollections = (options: {
|
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License.
|
|
5
|
-
You may obtain a copy of the License at
|
|
6
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software
|
|
8
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
-
See the License for the specific language governing permissions and
|
|
11
|
-
limitations under the License.
|
|
2
|
+
|
|
12
3
|
*/
|
|
13
4
|
import { Form } from '@tinacms/toolkit';
|
|
14
5
|
import type { FormOptions, TinaCMS } from '@tinacms/toolkit';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
you may not use this file except in compliance with the License.
|
|
5
|
-
You may obtain a copy of the License at
|
|
6
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
Unless required by applicable law or agreed to in writing, software
|
|
8
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
-
See the License for the specific language governing permissions and
|
|
11
|
-
limitations under the License.
|
|
2
|
+
|
|
12
3
|
*/
|
|
13
4
|
export * from './internalClient';
|
|
14
5
|
export * from './auth';
|