@webiny/app 5.25.0-beta.0 → 5.25.0-beta.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.
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const Routes: () => JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
2
  import React from "react";
3
3
  import { plugins } from "@webiny/plugins";
4
- import { Switch } from "@webiny/react-router";
4
+ import { Routes as ReactRouterRoutes } from "@webiny/react-router";
5
5
  export var Routes = function Routes() {
6
6
  // We cannot call `sort` on the array returned by the `plugins.byType` call - it is read-only.
7
7
  var routes = _toConsumableArray(plugins.byType("route")).sort(function (a, b) {
@@ -25,7 +25,7 @@ export var Routes = function Routes() {
25
25
  return 0;
26
26
  });
27
27
 
28
- return /*#__PURE__*/React.createElement(Switch, null, routes.map(function (_ref) {
28
+ return /*#__PURE__*/React.createElement(ReactRouterRoutes, null, routes.map(function (_ref) {
29
29
  var route = _ref.route,
30
30
  name = _ref.name;
31
31
  return /*#__PURE__*/React.cloneElement(route, {
@@ -1 +1 @@
1
- {"version":3,"sources":["Routes.tsx"],"names":["React","plugins","Switch","Routes","routes","byType","sort","a","b","pathA","route","props","path","pathB","includes","map","name","cloneElement","key"],"mappings":";AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,OAAT,QAAwB,iBAAxB;AACA,SAASC,MAAT,QAAuB,sBAAvB;AAGA,OAAO,IAAMC,MAAM,GAAG,SAATA,MAAS,GAAM;AACxB;AACA,MAAMC,MAAM,GAAG,mBAAIH,OAAO,CAACI,MAAR,CAA4B,OAA5B,CAAJ,EAA0CC,IAA1C,CAA+C,UAACC,CAAD,EAAIC,CAAJ,EAAU;AACpE,QAAMC,KAAK,GAAGF,CAAC,CAACG,KAAF,CAAQC,KAAR,CAAcC,IAAd,IAAsB,GAApC;AACA,QAAMC,KAAK,GAAGL,CAAC,CAACE,KAAF,CAAQC,KAAR,CAAcC,IAAd,IAAsB,GAApC,CAFoE,CAIpE;;AACA,QAAIH,KAAK,KAAK,GAAV,IAAiBI,KAAK,KAAK,GAA/B,EAAoC;AAChC,aAAO,CAAC,CAAR;AACH,KAPmE,CASpE;;;AACA,QAAIJ,KAAK,KAAK,GAAV,IAAiBA,KAAK,KAAK,GAA/B,EAAoC;AAChC,aAAO,CAAP;AACH,KAZmE,CAcpE;;;AACA,QAAI,CAAC,GAAD,EAAM,GAAN,EAAWK,QAAX,CAAoBD,KAApB,CAAJ,EAAgC;AAC5B,aAAO,CAAC,CAAR;AACH;;AAED,WAAO,CAAP;AACH,GApBc,CAAf;;AAsBA,sBACI,oBAAC,MAAD,QAAST,MAAM,CAACW,GAAP,CAAW;AAAA,QAAGL,KAAH,QAAGA,KAAH;AAAA,QAAUM,IAAV,QAAUA,IAAV;AAAA,wBAAqBhB,KAAK,CAACiB,YAAN,CAAmBP,KAAnB,EAA0B;AAAEQ,MAAAA,GAAG,EAAEF;AAAP,KAA1B,CAArB;AAAA,GAAX,CAAT,CADJ;AAGH,CA3BM","sourcesContent":["import React from \"react\";\nimport { plugins } from \"@webiny/plugins\";\nimport { Switch } from \"@webiny/react-router\";\nimport { RoutePlugin } from \"../types\";\n\nexport const Routes = () => {\n // We cannot call `sort` on the array returned by the `plugins.byType` call - it is read-only.\n const routes = [...plugins.byType<RoutePlugin>(\"route\")].sort((a, b) => {\n const pathA = a.route.props.path || \"*\";\n const pathB = b.route.props.path || \"*\";\n\n // This will sort paths at the very bottom of the list\n if (pathA === \"/\" && pathB === \"*\") {\n return -1;\n }\n\n // This will push * and / to the bottom of the list\n if (pathA === \"*\" || pathA === \"/\") {\n return 1;\n }\n\n // This will push * and / to the bottom of the list\n if ([\"*\", \"/\"].includes(pathB)) {\n return -1;\n }\n\n return 0;\n });\n\n return (\n <Switch>{routes.map(({ route, name }) => React.cloneElement(route, { key: name }))}</Switch>\n );\n};\n"]}
1
+ {"version":3,"sources":["Routes.tsx"],"names":["React","plugins","Routes","ReactRouterRoutes","routes","byType","sort","a","b","pathA","route","props","path","pathB","includes","map","name","cloneElement","key"],"mappings":";AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,OAAT,QAAwB,iBAAxB;AACA,SAASC,MAAM,IAAIC,iBAAnB,QAA4C,sBAA5C;AAGA,OAAO,IAAMD,MAAM,GAAG,SAATA,MAAS,GAAM;AACxB;AACA,MAAME,MAAM,GAAG,mBAAIH,OAAO,CAACI,MAAR,CAA4B,OAA5B,CAAJ,EAA0CC,IAA1C,CAA+C,UAACC,CAAD,EAAIC,CAAJ,EAAU;AACpE,QAAMC,KAAK,GAAGF,CAAC,CAACG,KAAF,CAAQC,KAAR,CAAcC,IAAd,IAAsB,GAApC;AACA,QAAMC,KAAK,GAAGL,CAAC,CAACE,KAAF,CAAQC,KAAR,CAAcC,IAAd,IAAsB,GAApC,CAFoE,CAIpE;;AACA,QAAIH,KAAK,KAAK,GAAV,IAAiBI,KAAK,KAAK,GAA/B,EAAoC;AAChC,aAAO,CAAC,CAAR;AACH,KAPmE,CASpE;;;AACA,QAAIJ,KAAK,KAAK,GAAV,IAAiBA,KAAK,KAAK,GAA/B,EAAoC;AAChC,aAAO,CAAP;AACH,KAZmE,CAcpE;;;AACA,QAAI,CAAC,GAAD,EAAM,GAAN,EAAWK,QAAX,CAAoBD,KAApB,CAAJ,EAAgC;AAC5B,aAAO,CAAC,CAAR;AACH;;AAED,WAAO,CAAP;AACH,GApBc,CAAf;;AAsBA,sBACI,oBAAC,iBAAD,QACKT,MAAM,CAACW,GAAP,CAAW;AAAA,QAAGL,KAAH,QAAGA,KAAH;AAAA,QAAUM,IAAV,QAAUA,IAAV;AAAA,wBAAqBhB,KAAK,CAACiB,YAAN,CAAmBP,KAAnB,EAA0B;AAAEQ,MAAAA,GAAG,EAAEF;AAAP,KAA1B,CAArB;AAAA,GAAX,CADL,CADJ;AAKH,CA7BM","sourcesContent":["import React from \"react\";\nimport { plugins } from \"@webiny/plugins\";\nimport { Routes as ReactRouterRoutes } from \"@webiny/react-router\";\nimport { RoutePlugin } from \"../types\";\n\nexport const Routes = () => {\n // We cannot call `sort` on the array returned by the `plugins.byType` call - it is read-only.\n const routes = [...plugins.byType<RoutePlugin>(\"route\")].sort((a, b) => {\n const pathA = a.route.props.path || \"*\";\n const pathB = b.route.props.path || \"*\";\n\n // This will sort paths at the very bottom of the list\n if (pathA === \"/\" && pathB === \"*\") {\n return -1;\n }\n\n // This will push * and / to the bottom of the list\n if (pathA === \"*\" || pathA === \"/\") {\n return 1;\n }\n\n // This will push * and / to the bottom of the list\n if ([\"*\", \"/\"].includes(pathB)) {\n return -1;\n }\n\n return 0;\n });\n\n return (\n <ReactRouterRoutes>\n {routes.map(({ route, name }) => React.cloneElement(route, { key: name }))}\n </ReactRouterRoutes>\n );\n};\n"]}
@@ -1,3 +1,4 @@
1
+ /// <reference types="web" />
1
2
  interface Params {
2
3
  after?: string;
3
4
  before?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/app",
3
- "version": "5.25.0-beta.0",
3
+ "version": "5.25.0-beta.3",
4
4
  "main": "index.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -15,20 +15,21 @@
15
15
  "license": "MIT",
16
16
  "dependencies": {
17
17
  "@apollo/react-hooks": "3.1.5",
18
- "@babel/runtime": "7.17.2",
18
+ "@babel/runtime": "7.17.7",
19
19
  "@emotion/styled": "10.3.0",
20
20
  "@types/react": "16.14.2",
21
- "@webiny/i18n": "5.25.0-beta.0",
22
- "@webiny/i18n-react": "5.25.0-beta.0",
23
- "@webiny/plugins": "5.25.0-beta.0",
24
- "@webiny/react-router": "5.25.0-beta.0",
25
- "@webiny/ui": "5.25.0-beta.0",
21
+ "@webiny/i18n": "5.25.0-beta.3",
22
+ "@webiny/i18n-react": "5.25.0-beta.3",
23
+ "@webiny/plugins": "5.25.0-beta.3",
24
+ "@webiny/react-router": "5.25.0-beta.3",
25
+ "@webiny/ui": "5.25.0-beta.3",
26
26
  "apollo-cache": "1.3.5",
27
27
  "apollo-cache-inmemory": "1.6.6",
28
28
  "apollo-client": "2.6.10",
29
29
  "apollo-link": "1.2.14",
30
30
  "apollo-link-context": "1.0.20",
31
31
  "apollo-link-error": "1.1.13",
32
+ "apollo-link-http-common": "0.2.16",
32
33
  "apollo-utilities": "1.3.4",
33
34
  "boolean": "3.2.0",
34
35
  "graphql": "15.8.0",
@@ -47,8 +48,8 @@
47
48
  "@babel/preset-react": "^7.16.0",
48
49
  "@babel/preset-typescript": "^7.16.0",
49
50
  "@types/warning": "^3.0.0",
50
- "@webiny/cli": "^5.25.0-beta.0",
51
- "@webiny/project-utils": "^5.25.0-beta.0",
51
+ "@webiny/cli": "^5.25.0-beta.3",
52
+ "@webiny/project-utils": "^5.25.0-beta.3",
52
53
  "babel-plugin-lodash": "^3.3.4",
53
54
  "rimraf": "^3.0.2",
54
55
  "typescript": "4.5.5"
@@ -68,5 +69,5 @@
68
69
  ]
69
70
  }
70
71
  },
71
- "gitHead": "2d3e7833575e88fde77d84e5490e746933a5ec28"
72
+ "gitHead": "3364dbf65ade9f33f4decff7e45da1efd02b2af0"
72
73
  }
@@ -4,12 +4,12 @@ export interface ApolloCacheObject {
4
4
  [key: string]: any;
5
5
  }
6
6
  interface ApolloCacheObjectIdPluginCallable<T> {
7
- (data: T): any;
7
+ (data: T): string | null;
8
8
  }
9
9
  export declare class ApolloCacheObjectIdPlugin<T extends ApolloCacheObject = ApolloCacheObject> extends Plugin {
10
10
  static readonly type: string;
11
11
  private readonly _getObjectId?;
12
12
  constructor(getObjectId?: ApolloCacheObjectIdPluginCallable<T>);
13
- getObjectId(data: T): any;
13
+ getObjectId(data: T): string | null;
14
14
  }
15
15
  export {};
@@ -1 +1 @@
1
- {"version":3,"sources":["ApolloCacheObjectIdPlugin.ts"],"names":["Plugin","ApolloCacheObjectIdPlugin","getObjectId","_getObjectId","data","Error"],"mappings":";;;;;;AAAA,SAASA,MAAT,QAAuB,iBAAvB;AAYA,WAAaC,yBAAb;AAAA;;AAAA;;AAMI,qCAAmBC,WAAnB,EAAuE;AAAA;;AAAA;;AACnE;;AADmE;;AAEnE,UAAKC,YAAL,GAAoBD,WAApB;AAFmE;AAGtE;;AATL;AAAA;AAAA,WAWI,qBAAmBE,IAAnB,EAA4B;AACxB,UAAI,OAAO,KAAKD,YAAZ,KAA6B,UAAjC,EAA6C;AACzC,cAAME,KAAK,kHAAX;AAGH;;AAED,aAAO,KAAKF,YAAL,CAAkBC,IAAlB,CAAP;AACH;AAnBL;;AAAA;AAAA,EAEUJ,MAFV;;gBAAaC,yB,UAGsC,qB","sourcesContent":["import { Plugin } from \"@webiny/plugins\";\n\nexport interface ApolloCacheObject {\n __typename?: string;\n [key: string]: any;\n}\n\ninterface ApolloCacheObjectIdPluginCallable<T> {\n // TODO @ts-refactor probably a string but @pavel check it out\n (data: T): any;\n}\n\nexport class ApolloCacheObjectIdPlugin<\n T extends ApolloCacheObject = ApolloCacheObject\n> extends Plugin {\n public static override readonly type: string = \"cache-get-object-id\";\n private readonly _getObjectId?: ApolloCacheObjectIdPluginCallable<T>;\n\n public constructor(getObjectId?: ApolloCacheObjectIdPluginCallable<T>) {\n super();\n this._getObjectId = getObjectId;\n }\n\n public getObjectId(data: T) {\n if (typeof this._getObjectId !== \"function\") {\n throw Error(\n `You must provide a \"getObjectId\" callable to the plugin constructor or extend the ApolloCacheObjectIdPlugin.`\n );\n }\n\n return this._getObjectId(data);\n }\n}\n"]}
1
+ {"version":3,"sources":["ApolloCacheObjectIdPlugin.ts"],"names":["Plugin","ApolloCacheObjectIdPlugin","getObjectId","_getObjectId","data","Error"],"mappings":";;;;;;AAAA,SAASA,MAAT,QAAuB,iBAAvB;AAWA,WAAaC,yBAAb;AAAA;;AAAA;;AAMI,qCAAmBC,WAAnB,EAAuE;AAAA;;AAAA;;AACnE;;AADmE;;AAEnE,UAAKC,YAAL,GAAoBD,WAApB;AAFmE;AAGtE;;AATL;AAAA;AAAA,WAWI,qBAAmBE,IAAnB,EAA4B;AACxB,UAAI,OAAO,KAAKD,YAAZ,KAA6B,UAAjC,EAA6C;AACzC,cAAME,KAAK,kHAAX;AAGH;;AAED,aAAO,KAAKF,YAAL,CAAkBC,IAAlB,CAAP;AACH;AAnBL;;AAAA;AAAA,EAEUJ,MAFV;;gBAAaC,yB,UAGsC,qB","sourcesContent":["import { Plugin } from \"@webiny/plugins\";\n\nexport interface ApolloCacheObject {\n __typename?: string;\n [key: string]: any;\n}\n\ninterface ApolloCacheObjectIdPluginCallable<T> {\n (data: T): string | null;\n}\n\nexport class ApolloCacheObjectIdPlugin<\n T extends ApolloCacheObject = ApolloCacheObject\n> extends Plugin {\n public static override readonly type: string = \"cache-get-object-id\";\n private readonly _getObjectId?: ApolloCacheObjectIdPluginCallable<T>;\n\n public constructor(getObjectId?: ApolloCacheObjectIdPluginCallable<T>) {\n super();\n this._getObjectId = getObjectId;\n }\n\n public getObjectId(data: T) {\n if (typeof this._getObjectId !== \"function\") {\n throw Error(\n `You must provide a \"getObjectId\" callable to the plugin constructor or extend the ApolloCacheObjectIdPlugin.`\n );\n }\n\n return this._getObjectId(data);\n }\n}\n"]}
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  export declare const OverlayWrapper: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement>, keyof import("react").HTMLAttributes<HTMLDivElement>>, object>;
3
2
  export declare const Pre: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLPreElement>, HTMLPreElement>, Pick<import("react").ClassAttributes<HTMLPreElement> & import("react").HTMLAttributes<HTMLPreElement>, keyof import("react").HTMLAttributes<HTMLPreElement>>, object>;
package/types.d.ts CHANGED
@@ -49,7 +49,8 @@ export interface ImageProps {
49
49
  title?: string;
50
50
  alt?: string;
51
51
  style?: CSSProperties;
52
- width?: number;
52
+ width?: string | number;
53
+ height?: string | number;
53
54
  }
54
55
  /**
55
56
  * "getImageSrc" has to be defined as a separate property, so its functionality can be reused outside of
package/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["types.ts"],"names":["Plugin"],"mappings":"AACA,SAASA,MAAT,QAAuB,uBAAvB;AA6CA,SAASA,MAAT","sourcesContent":["import * as React from \"react\";\nimport { Plugin } from \"@webiny/plugins/types\";\nimport { ApolloClient } from \"apollo-client\";\nimport { CSSProperties } from \"react\";\n\nexport interface FileItem {\n id: string;\n name: string;\n key: string;\n src: string;\n size: number;\n type: string;\n tags: string[];\n createdOn: string;\n createdBy: {\n id: string;\n };\n [key: string]: any;\n}\n\nexport type WebinyInitPlugin = Plugin & {\n type: \"webiny-init\";\n init(): void;\n};\n\nexport type UploadOptions = {\n apolloClient: ApolloClient<object>;\n};\n\nexport type UiStatePlugin = Plugin & {\n type: \"ui-state\";\n render(): React.ReactElement;\n};\n\nexport type FileUploaderPlugin = Plugin & {\n type: \"file-uploader\";\n // TODO: @adrian define type for the returned object\n upload(file: FileItem, options: UploadOptions): Promise<any>;\n};\n\nexport type AppFileManagerStoragePlugin = Plugin & {\n type: \"app-file-manager-storage\";\n // TODO: @adrian define type for the returned object\n upload(file: FileItem, options: UploadOptions): Promise<any>;\n};\n\nexport { Plugin };\n\nexport interface ImageProps {\n src: string;\n preset?: string;\n transform?: {\n [key: string]: any;\n };\n // \"auto\" is a special keyword - if present, plugins insert their own srcSet.\n srcSet?: { [key: string]: any } | \"auto\";\n className?: string;\n title?: string;\n alt?: string;\n style?: CSSProperties;\n width?: number;\n}\n\n/**\n * \"getImageSrc\" has to be defined as a separate property, so its functionality can be reused outside of\n * the Image component. This is ideal in cases where manual creation of image src is needed.\n */\nexport type ImageComponentPlugin = Plugin & {\n type: \"image-component\";\n render: (props: ImageProps) => React.ReactElement;\n getImageSrc: (props?: Record<string, any>) => string;\n presets: { [key: string]: any };\n};\n\n/**\n * Enables registering new routes.\n * @see https://docs.webiny.com/docs/webiny-apps/admin/development/plugins-reference/app#route\n */\nexport type RoutePlugin = Plugin & {\n type: \"route\";\n route: React.ReactElement;\n};\n\ninterface CacheGetObjectIdPluginObj {\n __typename: string;\n modelId: string;\n [key: string]: any;\n}\nexport type CacheGetObjectIdPlugin = Plugin & {\n type: \"cache-get-object-id\";\n getObjectId(obj: CacheGetObjectIdPluginObj): string | undefined;\n};\n"]}
1
+ {"version":3,"sources":["types.ts"],"names":["Plugin"],"mappings":"AACA,SAASA,MAAT,QAAuB,uBAAvB;AA6CA,SAASA,MAAT","sourcesContent":["import * as React from \"react\";\nimport { Plugin } from \"@webiny/plugins/types\";\nimport { ApolloClient } from \"apollo-client\";\nimport { CSSProperties } from \"react\";\n\nexport interface FileItem {\n id: string;\n name: string;\n key: string;\n src: string;\n size: number;\n type: string;\n tags: string[];\n createdOn: string;\n createdBy: {\n id: string;\n };\n [key: string]: any;\n}\n\nexport type WebinyInitPlugin = Plugin & {\n type: \"webiny-init\";\n init(): void;\n};\n\nexport type UploadOptions = {\n apolloClient: ApolloClient<object>;\n};\n\nexport type UiStatePlugin = Plugin & {\n type: \"ui-state\";\n render(): React.ReactElement;\n};\n\nexport type FileUploaderPlugin = Plugin & {\n type: \"file-uploader\";\n // TODO: @adrian define type for the returned object\n upload(file: FileItem, options: UploadOptions): Promise<any>;\n};\n\nexport type AppFileManagerStoragePlugin = Plugin & {\n type: \"app-file-manager-storage\";\n // TODO: @adrian define type for the returned object\n upload(file: FileItem, options: UploadOptions): Promise<any>;\n};\n\nexport { Plugin };\n\nexport interface ImageProps {\n src: string;\n preset?: string;\n transform?: {\n [key: string]: any;\n };\n // \"auto\" is a special keyword - if present, plugins insert their own srcSet.\n srcSet?: { [key: string]: any } | \"auto\";\n className?: string;\n title?: string;\n alt?: string;\n style?: CSSProperties;\n width?: string | number;\n height?: string | number;\n}\n\n/**\n * \"getImageSrc\" has to be defined as a separate property, so its functionality can be reused outside of\n * the Image component. This is ideal in cases where manual creation of image src is needed.\n */\nexport type ImageComponentPlugin = Plugin & {\n type: \"image-component\";\n render: (props: ImageProps) => React.ReactElement;\n getImageSrc: (props?: Record<string, any>) => string;\n presets: { [key: string]: any };\n};\n\n/**\n * Enables registering new routes.\n * @see https://docs.webiny.com/docs/webiny-apps/admin/development/plugins-reference/app#route\n */\nexport type RoutePlugin = Plugin & {\n type: \"route\";\n route: React.ReactElement;\n};\n\ninterface CacheGetObjectIdPluginObj {\n __typename: string;\n modelId: string;\n [key: string]: any;\n}\nexport type CacheGetObjectIdPlugin = Plugin & {\n type: \"cache-get-object-id\";\n getObjectId(obj: CacheGetObjectIdPluginObj): string | undefined;\n};\n"]}