@webiny/app-serverless-cms 5.21.0-beta.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/Admin.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ import { AdminProps as BaseAdminProps } from "@webiny/app-admin";
3
+ export interface AdminProps extends BaseAdminProps {
4
+ createApolloClient?: BaseAdminProps["createApolloClient"];
5
+ }
6
+ export declare const Admin: React.NamedExoticComponent<AdminProps>;
package/Admin.js ADDED
@@ -0,0 +1,37 @@
1
+ import React, { memo } from "react";
2
+ import { plugins } from "@webiny/plugins";
3
+ import { Admin as BaseAdmin, AppInstaller, Provider } from "@webiny/app-admin";
4
+ import { Tenancy } from "@webiny/app-tenancy";
5
+ import { Security } from "@webiny/app-security";
6
+ import { I18N } from "@webiny/app-i18n";
7
+ import { I18NContent } from "@webiny/app-i18n-content";
8
+ import { PageBuilder } from "@webiny/app-page-builder";
9
+ import { FormBuilder } from "@webiny/app-form-builder";
10
+ import { HeadlessCMS } from "@webiny/app-headless-cms";
11
+ import { RMWC } from "@webiny/app-admin-rmwc";
12
+ import { FileManager } from "@webiny/app-file-manager";
13
+ import { GraphQLPlayground } from "@webiny/app-graphql-playground";
14
+ import { AccessManagement } from "@webiny/app-security-access-management";
15
+ import { imagePlugin } from "@webiny/app/plugins";
16
+ import fileManagerPlugins from "@webiny/app-file-manager/admin/plugins";
17
+ import fileStorageS3Plugin from "@webiny/app-file-manager-s3";
18
+ import { createApolloClient as defaultApolloClientFactory } from "./apolloClientFactory";
19
+ import apolloLinks from "./apolloLinks";
20
+ import { createViewCompositionProvider } from "@webiny/app-admin/base/providers/ViewCompositionProvider";
21
+
22
+ var App = function App(props) {
23
+ var createApolloClient = props.createApolloClient || defaultApolloClientFactory;
24
+ var ViewCompositionProvider = createViewCompositionProvider();
25
+ plugins.register(imagePlugin(), fileManagerPlugins(), fileStorageS3Plugin(), apolloLinks);
26
+ return /*#__PURE__*/React.createElement(BaseAdmin, {
27
+ createApolloClient: createApolloClient
28
+ }, /*#__PURE__*/React.createElement(RMWC, null), /*#__PURE__*/React.createElement(Tenancy, null), /*#__PURE__*/React.createElement(Security, null), /*#__PURE__*/React.createElement(AccessManagement, null), /*#__PURE__*/React.createElement(AppInstaller, null), /*#__PURE__*/React.createElement(FileManager, null), /*#__PURE__*/React.createElement(GraphQLPlayground, {
29
+ createApolloClient: createApolloClient
30
+ }), /*#__PURE__*/React.createElement(I18N, null), /*#__PURE__*/React.createElement(I18NContent, null), /*#__PURE__*/React.createElement(Provider, {
31
+ hoc: ViewCompositionProvider
32
+ }), /*#__PURE__*/React.createElement(PageBuilder, null), /*#__PURE__*/React.createElement(FormBuilder, null), /*#__PURE__*/React.createElement(HeadlessCMS, {
33
+ createApolloClient: createApolloClient
34
+ }), props.children);
35
+ };
36
+
37
+ export var Admin = /*#__PURE__*/memo(App);
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Webiny
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,42 @@
1
+ # @webiny/app-i18n
2
+ [![](https://img.shields.io/npm/dw/@webiny/app-i18n.svg)](https://www.npmjs.com/package/@webiny/app-i18n)
3
+ [![](https://img.shields.io/npm/v/@webiny/app-i18n.svg)](https://www.npmjs.com/package/@webiny/app-i18n)
4
+ [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
5
+ [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
6
+
7
+ An app for creating forms that can be embedded into pages created with [Webiny Page Builder](../api-page-builder).
8
+
9
+ Use together with [@webiny/api-i18n](../api-i18n) package.
10
+
11
+ ## Install
12
+ ```
13
+ npm install --save @webiny/app-i18n
14
+ ```
15
+
16
+ Or if you prefer yarn:
17
+ ```
18
+ yarn add @webiny/app-i18n
19
+ ```
20
+
21
+ ## Setup
22
+ To setup, you must register a set of plugins. For more information on
23
+ plugins, please visit [Webiny documentation](https://docs.webiny.com/docs/developer-tutorials/plugins-crash-course).
24
+
25
+ #### Admin
26
+ ```
27
+ import { plugins } from "@webiny/plugins";
28
+ import i18nPlugins from "@webiny/app-i18n/admin/plugins";
29
+
30
+ plugins.register(i18nPlugins);
31
+ ```
32
+
33
+ Note: the `i18nCmsPlugins` contains plugins for the Page Builder, which will
34
+ enable you to embed i18n in your pages.
35
+
36
+ #### Site
37
+ ```
38
+ import { plugins } from "@webiny/plugins";
39
+ import i18nPlugins from "@webiny/app-i18n/site/plugins";
40
+
41
+ plugins.register(i18nPlugins);
42
+ ```
@@ -0,0 +1,4 @@
1
+ import ApolloClient from "apollo-client";
2
+ export declare const createApolloClient: ({ uri }: {
3
+ uri: any;
4
+ }) => ApolloClient<import("apollo-cache-inmemory").NormalizedCacheObject>;
@@ -0,0 +1,47 @@
1
+ import ApolloClient from "apollo-client";
2
+ import { ApolloLink } from "apollo-link";
3
+ import { BatchHttpLink } from "apollo-link-batch-http";
4
+ import { InMemoryCache } from "@webiny/app/apollo-client/InMemoryCache";
5
+ import { plugins } from "@webiny/plugins";
6
+ import { ApolloDynamicLink } from "@webiny/app/plugins/ApolloDynamicLink";
7
+ import { ApolloCacheObjectIdPlugin } from "@webiny/app/plugins/ApolloCacheObjectIdPlugin";
8
+ export var createApolloClient = function createApolloClient(_ref) {
9
+ var uri = _ref.uri;
10
+ return new ApolloClient({
11
+ link: ApolloLink.from([
12
+ /**
13
+ * This will process links from plugins on every request.
14
+ */
15
+ new ApolloDynamicLink(),
16
+ /**
17
+ * This batches requests made to the API to pack multiple requests into a single HTTP request.
18
+ */
19
+ new BatchHttpLink({
20
+ uri: uri
21
+ })]),
22
+ cache: new InMemoryCache({
23
+ addTypename: true,
24
+ dataIdFromObject: function dataIdFromObject(obj) {
25
+ /**
26
+ * Since every data type coming from API can have a different data structure,
27
+ * we cannot rely on having an `id` field.
28
+ */
29
+ var getters = plugins.byType(ApolloCacheObjectIdPlugin.type);
30
+
31
+ for (var i = 0; i < getters.length; i++) {
32
+ var id = getters[i].getObjectId(obj);
33
+
34
+ if (typeof id !== "undefined") {
35
+ return id;
36
+ }
37
+ }
38
+ /**
39
+ * As a fallback, try getting object's `id`.
40
+ */
41
+
42
+
43
+ return obj.id || null;
44
+ }
45
+ })
46
+ });
47
+ };
@@ -0,0 +1,5 @@
1
+ import { ConsoleLinkPlugin } from "@webiny/app/plugins/ConsoleLinkPlugin";
2
+ import { NetworkErrorLinkPlugin } from "@webiny/app/plugins/NetworkErrorLinkPlugin";
3
+ import { OmitTypenameLinkPlugin } from "@webiny/app/plugins/OmitTypenameLinkPlugin";
4
+ declare const _default: (OmitTypenameLinkPlugin | ConsoleLinkPlugin | NetworkErrorLinkPlugin)[];
5
+ export default _default;
package/apolloLinks.js ADDED
@@ -0,0 +1,16 @@
1
+ import { ConsoleLinkPlugin } from "@webiny/app/plugins/ConsoleLinkPlugin";
2
+ import { NetworkErrorLinkPlugin } from "@webiny/app/plugins/NetworkErrorLinkPlugin";
3
+ import { OmitTypenameLinkPlugin } from "@webiny/app/plugins/OmitTypenameLinkPlugin";
4
+ export default [
5
+ /**
6
+ * This link removes `__typename` from the variables being sent to the API.
7
+ */
8
+ new OmitTypenameLinkPlugin(),
9
+ /**
10
+ * This link checks for presence of `extensions.console` in the response and logs all items to browser console.
11
+ */
12
+ new ConsoleLinkPlugin(),
13
+ /**
14
+ * This plugin creates an ApolloLink that checks for `NetworkError` and shows an ErrorOverlay in the browser.
15
+ */
16
+ new NetworkErrorLinkPlugin()];
package/index.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ export { Admin } from "./Admin";
2
+ export type { AdminProps } from "./Admin";
3
+ export { useAdmin, useUserMenuItem, useUserMenu, useMenuItem, useNavigation, useTags, AddLogo, AddMenu, AddRoute, AddUserMenuItem, Layout, LayoutRenderer, LoginScreen, LoginScreenRenderer, LocaleSelector, LocaleSelectorRenderer, Brand, BrandRenderer, Provider, Compose, Plugins, makeComposable, MenuItem, MenuItemRenderer, MenuItems, Navigation, NavigationRenderer, Tags, UserMenu, UserMenuHandle, UserMenuHandleRenderer, UserMenuItems, UserMenuItem, UserMenuItemRenderer, AddGraphQLQuerySelection } from "@webiny/app-admin";
4
+ export type { ComposeProps, HigherOrderComponent, ProviderProps, LayoutProps, LoginScreenProps, MenuContext, MenuData, MenuItemsProps, MenuProps, UserMenuItemsProps, UserMenuItemProps, UserMenuItemData } from "@webiny/app-admin";
5
+ export { HasPermission, useSecurity, usePermission } from "@webiny/app-security";
6
+ export { useTenancy } from "@webiny/app-tenancy";
7
+ export type { Tenant } from "@webiny/app-tenancy";
8
+ export { AddPbWebsiteSettings } from "@webiny/app-page-builder";
package/index.js ADDED
@@ -0,0 +1,5 @@
1
+ export { Admin } from "./Admin";
2
+ export { useAdmin, useUserMenuItem, useUserMenu, useMenuItem, useNavigation, useTags, AddLogo, AddMenu, AddRoute, AddUserMenuItem, Layout, LayoutRenderer, LoginScreen, LoginScreenRenderer, LocaleSelector, LocaleSelectorRenderer, Brand, BrandRenderer, Provider, Compose, Plugins, makeComposable, MenuItem, MenuItemRenderer, MenuItems, Navigation, NavigationRenderer, Tags, UserMenu, UserMenuHandle, UserMenuHandleRenderer, UserMenuItems, UserMenuItem, UserMenuItemRenderer, AddGraphQLQuerySelection } from "@webiny/app-admin";
3
+ export { HasPermission, useSecurity, usePermission } from "@webiny/app-security";
4
+ export { useTenancy } from "@webiny/app-tenancy";
5
+ export { AddPbWebsiteSettings } from "@webiny/app-page-builder";
package/package.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "@webiny/app-serverless-cms",
3
+ "version": "5.21.0-beta.0",
4
+ "main": "index.js",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/webiny/webiny-js.git"
8
+ },
9
+ "author": "Webiny Ltd.",
10
+ "license": "MIT",
11
+ "dependencies": {
12
+ "@babel/runtime": "7.16.3",
13
+ "@emotion/core": "10.1.1",
14
+ "@webiny/app": "5.21.0-beta.0",
15
+ "@webiny/app-admin": "5.21.0-beta.0",
16
+ "@webiny/app-admin-rmwc": "5.21.0-beta.0",
17
+ "@webiny/app-file-manager": "5.21.0-beta.0",
18
+ "@webiny/app-file-manager-s3": "5.21.0-beta.0",
19
+ "@webiny/app-form-builder": "5.21.0-beta.0",
20
+ "@webiny/app-graphql-playground": "5.21.0-beta.0",
21
+ "@webiny/app-headless-cms": "5.21.0-beta.0",
22
+ "@webiny/app-i18n": "5.21.0-beta.0",
23
+ "@webiny/app-i18n-content": "5.21.0-beta.0",
24
+ "@webiny/app-page-builder": "5.21.0-beta.0",
25
+ "@webiny/app-security": "5.21.0-beta.0",
26
+ "@webiny/app-security-access-management": "5.21.0-beta.0",
27
+ "@webiny/app-tenancy": "5.21.0-beta.0",
28
+ "@webiny/plugins": "5.21.0-beta.0",
29
+ "apollo-cache": "1.3.5",
30
+ "apollo-client": "2.6.10",
31
+ "apollo-link": "1.2.14",
32
+ "apollo-link-batch-http": "1.2.14",
33
+ "apollo-utilities": "1.3.4",
34
+ "react": "16.14.0",
35
+ "react-dom": "16.14.0"
36
+ },
37
+ "devDependencies": {
38
+ "@babel/cli": "^7.5.5",
39
+ "@babel/core": "^7.5.5",
40
+ "@babel/preset-env": "^7.5.5",
41
+ "@babel/preset-react": "^7.0.0",
42
+ "@babel/preset-typescript": "^7.8.3",
43
+ "@webiny/cli": "^5.21.0-beta.0",
44
+ "@webiny/project-utils": "^5.21.0-beta.0",
45
+ "babel-plugin-emotion": "^9.2.8",
46
+ "babel-plugin-named-asset-import": "^1.0.0-next.3e165448",
47
+ "rimraf": "^3.0.2",
48
+ "ttypescript": "^1.5.12",
49
+ "typescript": "^4.1.3"
50
+ },
51
+ "publishConfig": {
52
+ "access": "public",
53
+ "directory": "dist"
54
+ },
55
+ "scripts": {
56
+ "build": "yarn webiny run build",
57
+ "watch": "yarn webiny run watch"
58
+ },
59
+ "svgo": {
60
+ "plugins": {
61
+ "removeViewBox": false
62
+ }
63
+ },
64
+ "gitHead": "cad155812edbdd577a1cc858b41038fdd7a6d2d9"
65
+ }
package/styles.scss ADDED
@@ -0,0 +1,9 @@
1
+ // Import admin app styles
2
+ @import "~@webiny/app-admin/styles.scss";
3
+ //
4
+ // Import `RichTextEditor` styles
5
+ @import "~@webiny/app-admin/components/RichTextEditor/styles.scss";
6
+ @import "~@webiny/app-admin/components/RichTextEditor/tools/header/styles.scss";
7
+ @import "~@webiny/app-admin/components/RichTextEditor/tools/paragraph/styles.scss";
8
+ @import "~@webiny/app-admin/components/RichTextEditor/tools/textColor/styles.scss";
9
+ @import "~@webiny/app-admin/components/RichTextEditor/tools/image/styles.scss";