@appkit/dek-lib 0.32.0 → 0.34.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.
Files changed (37) hide show
  1. package/dist/components/Background/Background.d.ts +1 -1
  2. package/dist/components/Background/Background.styled.d.ts +9 -0
  3. package/dist/components/Board/Board.d.ts +4 -4
  4. package/dist/components/Board/Board.styled.d.ts +8 -0
  5. package/dist/components/BoardProvider/BoardProvider.d.ts +7 -3
  6. package/dist/components/BoardScreen/BoardScreen.d.ts +6 -0
  7. package/dist/components/BoardScreen/BoardScreen.styled.d.ts +7 -0
  8. package/dist/components/BoardStylesProvider/BoardStylesProvider.d.ts +8 -0
  9. package/dist/components/BoardStylesProvider/BoardStylesProvider.styled.d.ts +7 -0
  10. package/dist/components/BoardStylesProvider/components/BoardPreviewOverlay/BoardPreviewOverlay.d.ts +2 -0
  11. package/dist/components/BoardStylesProvider/components/BoardPreviewOverlay/BoardPreviewOverlay.styled.d.ts +7 -0
  12. package/dist/components/BoardStylesProvider/components/BoardStyles.d.ts +6 -0
  13. package/dist/components/BoardWrapper/BoardWrapper.d.ts +6 -0
  14. package/dist/components/Command/Command.d.ts +5 -0
  15. package/dist/components/Component/Component.d.ts +8 -0
  16. package/dist/components/PreviewBoardLoader/PreviewBoardLoader.d.ts +2 -0
  17. package/dist/components/PreviewBoardLoader/PreviewBoardLoader.styled.d.ts +7 -0
  18. package/dist/data/fetchUserData.d.ts +1 -1
  19. package/dist/data/fetchUserPlugins.d.ts +1 -1
  20. package/dist/data/getClient.d.ts +1 -1
  21. package/dist/data/types/gql.d.ts +2 -2
  22. package/dist/data/types/graphql.d.ts +23 -3
  23. package/dist/data/watchUser.d.ts +1 -1
  24. package/dist/index.d.ts +6 -1
  25. package/dist/index.es.js +57314 -57091
  26. package/dist/index.umd.js +58166 -57943
  27. package/dist/lib/contexts/PreviewConfigContext.d.ts +12 -0
  28. package/dist/lib/contexts/UserConfigContext.d.ts +4 -0
  29. package/dist/lib/data.d.ts +3 -2
  30. package/dist/lib/globals.d.ts +2 -1
  31. package/dist/lib/hooks/useAuthorization.d.ts +2 -0
  32. package/dist/lib/hooks/usePreviewContext.d.ts +2 -0
  33. package/dist/lib/hooks/useUserConfig.d.ts +1 -3
  34. package/dist/lib/hooks/useUserConfigLoader.d.ts +4 -0
  35. package/dist/lib/plugins.d.ts +1 -1
  36. package/package.json +1 -1
  37. package/dist/components/BoardProvider/BoardStyles.d.ts +0 -5
@@ -1,2 +1,2 @@
1
- declare const Background: () => any;
1
+ declare const Background: () => import("react/jsx-runtime").JSX.Element;
2
2
  export default Background;
@@ -1,10 +1,19 @@
1
1
  /// <reference types="react" />
2
2
  type ContainerImageProps = {
3
3
  $imageUrl: string;
4
+ $width?: number;
5
+ $height?: number;
4
6
  };
5
7
  export declare const ContainerImage: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ContainerImageProps>>;
6
8
  type ContainerOverlayProps = {
7
9
  $opacity: number;
10
+ $width?: number;
11
+ $height?: number;
8
12
  };
9
13
  export declare const ContainerOverlay: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ContainerOverlayProps>>;
14
+ type ContainerProps = {
15
+ $width?: number;
16
+ $height?: number;
17
+ };
18
+ export declare const Container: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ContainerProps>>;
10
19
  export {};
@@ -1,6 +1,6 @@
1
- import { DekPluginElementProps } from '@appkit/dek-plugin';
2
- type Props = DekPluginElementProps & {
3
- layout?: string;
1
+ import { PreviewConfig } from '../../lib/contexts/PreviewConfigContext';
2
+ type Props = {
3
+ previewConfig?: PreviewConfig;
4
4
  };
5
- declare const Board: ({ api, layout }: Props) => import("react/jsx-runtime").JSX.Element;
5
+ declare const Board: ({ previewConfig }: Props) => import("react/jsx-runtime").JSX.Element | null;
6
6
  export default Board;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ type ContainerProps = {
3
+ $width?: number;
4
+ $height?: number;
5
+ $zoom?: number;
6
+ };
7
+ export declare const Container: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ContainerProps>>;
8
+ export {};
@@ -1,9 +1,13 @@
1
1
  import { DekPluginFactory } from '@appkit/dek-plugin';
2
+ import { ReactNode } from 'react';
3
+ import { PreviewConfig } from '../../lib/contexts/PreviewConfigContext';
2
4
  type Props = {
3
- email: string;
4
- password: string;
5
+ authToken: string;
5
6
  plugin?: DekPluginFactory;
6
7
  pluginConfig?: any;
8
+ previewConfig?: PreviewConfig;
9
+ zoom?: number;
10
+ children?: ReactNode;
7
11
  };
8
- declare const BoardProvider: ({ email, password, plugin, pluginConfig }: Props) => import("react/jsx-runtime").JSX.Element;
12
+ declare const BoardProvider: ({ authToken, plugin, pluginConfig, zoom, children, }: Props) => import("react/jsx-runtime").JSX.Element;
9
13
  export default BoardProvider;
@@ -0,0 +1,6 @@
1
+ import { ReactNode } from 'react';
2
+ type Props = {
3
+ children?: ReactNode;
4
+ };
5
+ declare const BoardScreen: ({ children }: Props) => import("react/jsx-runtime").JSX.Element;
6
+ export default BoardScreen;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ type ContainerProps = {
3
+ $width?: number;
4
+ $height?: number;
5
+ };
6
+ export declare const Container: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ContainerProps>>;
7
+ export {};
@@ -0,0 +1,8 @@
1
+ import { ReactNode } from 'react';
2
+ type Props = {
3
+ transitionDelay?: number;
4
+ zoom?: number;
5
+ children?: ReactNode;
6
+ };
7
+ declare const BoardStylesProvider: ({ zoom, transitionDelay, children, }: Props) => import("react/jsx-runtime").JSX.Element;
8
+ export default BoardStylesProvider;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ type ContainerProps = {
3
+ $width?: number;
4
+ $height?: number;
5
+ };
6
+ export declare const Container: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ContainerProps>>;
7
+ export {};
@@ -0,0 +1,2 @@
1
+ declare const BoardPreviewOverlay: () => import("react/jsx-runtime").JSX.Element;
2
+ export default BoardPreviewOverlay;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ type ContainerProps = {
3
+ $width?: number;
4
+ $height?: number;
5
+ };
6
+ export declare const Container: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ContainerProps>>;
7
+ export {};
@@ -0,0 +1,6 @@
1
+ type Props = {
2
+ zoom?: number;
3
+ transitionDelay: number;
4
+ };
5
+ declare const BoardStyles: ({ zoom, transitionDelay }: Props) => import("react/jsx-runtime").JSX.Element;
6
+ export default BoardStyles;
@@ -0,0 +1,6 @@
1
+ import { DekPluginElementProps } from '@appkit/dek-plugin';
2
+ type Props = DekPluginElementProps & {
3
+ layout?: string;
4
+ };
5
+ declare const BoardWrapper: ({ api, layout }: Props) => import("react/jsx-runtime").JSX.Element;
6
+ export default BoardWrapper;
@@ -0,0 +1,5 @@
1
+ type Props = {
2
+ commandTitle: string;
3
+ };
4
+ declare const Command: ({ commandTitle }: Props) => JSX.Element | null | undefined;
5
+ export default Command;
@@ -0,0 +1,8 @@
1
+ import { ComponentProp } from '../../lib/utils/parsePropsForComponent';
2
+ type Props = {
3
+ integrationKey: string;
4
+ componentKey: string;
5
+ componentProps?: ComponentProp[];
6
+ };
7
+ declare const Component: ({ integrationKey, componentKey }: Props) => import("react/jsx-runtime").JSX.Element;
8
+ export default Component;
@@ -0,0 +1,2 @@
1
+ declare const PreviewBoardLoader: () => import("react/jsx-runtime").JSX.Element | null;
2
+ export default PreviewBoardLoader;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ type ContainerProps = {
3
+ $width?: number;
4
+ $height?: number;
5
+ };
6
+ export declare const Container: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, ContainerProps>>;
7
+ export {};
@@ -1,4 +1,4 @@
1
1
  import { UserDataQuery } from './types/graphql';
2
2
  export type UserData = UserDataQuery['currentUser'];
3
- declare function fetchUserData(email: string, password: string): Promise<UserData>;
3
+ declare function fetchUserData(authToken: string): Promise<UserData>;
4
4
  export default fetchUserData;
@@ -1,5 +1,5 @@
1
1
  import { ApolloQueryResult } from '@apollo/client';
2
2
  import { UserPluginsAndIntegrationsQuery } from './types/graphql';
3
3
  export type FetchUserPluginsResult = ApolloQueryResult<UserPluginsAndIntegrationsQuery>['data']['currentUser'];
4
- declare function fetchUserPlugins(email: string, password: string): Promise<FetchUserPluginsResult>;
4
+ declare function fetchUserPlugins(authToken: string): Promise<FetchUserPluginsResult>;
5
5
  export default fetchUserPlugins;
@@ -1,3 +1,3 @@
1
1
  import { ApolloClient, NormalizedCacheObject } from '@apollo/client';
2
- declare function getClient(email: string, password: string): Promise<ApolloClient<NormalizedCacheObject>>;
2
+ declare function getClient(authToken: string): Promise<ApolloClient<NormalizedCacheObject>>;
3
3
  export default getClient;
@@ -11,7 +11,7 @@ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/
11
11
  * Therefore it is highly recommended to use the babel or swc plugin for production.
12
12
  */
13
13
  declare const documents: {
14
- "\n query userData {\n currentUser {\n id\n name\n email\n location\n avatar\n boards {\n id\n title\n key\n layout\n base {\n integration\n key\n }\n zones {\n key\n integrationKey\n componentKey\n props {\n key\n value\n }\n containerProps {\n key\n value\n }\n }\n }\n commandGroups {\n title\n key\n commands {\n title\n integrationKey\n componentKey\n props {\n key\n value\n }\n containerProps {\n key\n value\n }\n }\n }\n }\n }\n": DocumentNode<types.UserDataQuery, types.Exact<{
14
+ "\n query userData {\n currentUser {\n id\n name\n email\n location\n avatar\n boards {\n id\n title\n key\n layout\n base {\n integration\n key\n }\n zones {\n key\n integrationKey\n componentKey\n props {\n key\n value\n }\n containerProps {\n key\n value\n }\n }\n }\n commandGroups {\n title\n key\n commands {\n title\n integrationKey\n componentKey\n props {\n key\n value\n }\n containerProps {\n key\n value\n }\n }\n }\n commands {\n title\n integrationKey\n componentKey\n props {\n key\n value\n }\n containerProps {\n key\n value\n }\n }\n }\n }\n": DocumentNode<types.UserDataQuery, types.Exact<{
15
15
  [key: string]: never;
16
16
  }>>;
17
17
  "\n query userPluginsAndIntegrations {\n currentUser {\n plugins {\n name\n code\n version\n }\n integrations {\n key\n pluginName\n pluginVersion\n pluginConfig {\n key\n value\n }\n }\n }\n }\n": DocumentNode<types.UserPluginsAndIntegrationsQuery, types.Exact<{
@@ -37,7 +37,7 @@ export declare function gql(source: string): unknown;
37
37
  /**
38
38
  * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
39
39
  */
40
- export declare function gql(source: "\n query userData {\n currentUser {\n id\n name\n email\n location\n avatar\n boards {\n id\n title\n key\n layout\n base {\n integration\n key\n }\n zones {\n key\n integrationKey\n componentKey\n props {\n key\n value\n }\n containerProps {\n key\n value\n }\n }\n }\n commandGroups {\n title\n key\n commands {\n title\n integrationKey\n componentKey\n props {\n key\n value\n }\n containerProps {\n key\n value\n }\n }\n }\n }\n }\n"): (typeof documents)["\n query userData {\n currentUser {\n id\n name\n email\n location\n avatar\n boards {\n id\n title\n key\n layout\n base {\n integration\n key\n }\n zones {\n key\n integrationKey\n componentKey\n props {\n key\n value\n }\n containerProps {\n key\n value\n }\n }\n }\n commandGroups {\n title\n key\n commands {\n title\n integrationKey\n componentKey\n props {\n key\n value\n }\n containerProps {\n key\n value\n }\n }\n }\n }\n }\n"];
40
+ export declare function gql(source: "\n query userData {\n currentUser {\n id\n name\n email\n location\n avatar\n boards {\n id\n title\n key\n layout\n base {\n integration\n key\n }\n zones {\n key\n integrationKey\n componentKey\n props {\n key\n value\n }\n containerProps {\n key\n value\n }\n }\n }\n commandGroups {\n title\n key\n commands {\n title\n integrationKey\n componentKey\n props {\n key\n value\n }\n containerProps {\n key\n value\n }\n }\n }\n commands {\n title\n integrationKey\n componentKey\n props {\n key\n value\n }\n containerProps {\n key\n value\n }\n }\n }\n }\n"): (typeof documents)["\n query userData {\n currentUser {\n id\n name\n email\n location\n avatar\n boards {\n id\n title\n key\n layout\n base {\n integration\n key\n }\n zones {\n key\n integrationKey\n componentKey\n props {\n key\n value\n }\n containerProps {\n key\n value\n }\n }\n }\n commandGroups {\n title\n key\n commands {\n title\n integrationKey\n componentKey\n props {\n key\n value\n }\n containerProps {\n key\n value\n }\n }\n }\n commands {\n title\n integrationKey\n componentKey\n props {\n key\n value\n }\n containerProps {\n key\n value\n }\n }\n }\n }\n"];
41
41
  /**
42
42
  * The gql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
43
43
  */
@@ -451,6 +451,7 @@ export type Integration = {
451
451
  createdAt: Scalars['DateTime']['output'];
452
452
  id: Scalars['ID']['output'];
453
453
  key: Scalars['String']['output'];
454
+ plugin: Plugin;
454
455
  pluginConfig: Array<PluginConfig>;
455
456
  pluginName: Scalars['String']['output'];
456
457
  pluginVersion?: Maybe<Scalars['String']['output']>;
@@ -722,14 +723,17 @@ export type PluginConfigInput = {
722
723
  };
723
724
  export type PluginsQueryInput = {
724
725
  archived?: InputMaybe<YesNoAnyInput>;
725
- author?: InputMaybe<RegexExpressionInput>;
726
+ author?: InputMaybe<Scalars['String']['input']>;
727
+ authorMatch?: InputMaybe<RegexExpressionInput>;
726
728
  createdAt?: InputMaybe<DateRangeInput>;
727
- name?: InputMaybe<RegexExpressionInput>;
729
+ name?: InputMaybe<Scalars['String']['input']>;
730
+ nameMatch?: InputMaybe<RegexExpressionInput>;
728
731
  private?: InputMaybe<YesNoAnyInput>;
729
732
  publishedAt?: InputMaybe<DateRangeInput>;
730
733
  updatedAt?: InputMaybe<DateRangeInput>;
731
734
  userIds?: InputMaybe<Array<InputMaybe<Scalars['ID']['input']>>>;
732
- version?: InputMaybe<RegexExpressionInput>;
735
+ version?: InputMaybe<Scalars['String']['input']>;
736
+ versionMatch?: InputMaybe<RegexExpressionInput>;
733
737
  };
734
738
  export type PluginsResult = {
735
739
  __typename?: 'PluginsResult';
@@ -1251,6 +1255,22 @@ export type UserDataQuery = {
1251
1255
  }>;
1252
1256
  }>;
1253
1257
  }>;
1258
+ commands: Array<{
1259
+ __typename?: 'Command';
1260
+ title: string;
1261
+ integrationKey: string;
1262
+ componentKey: string;
1263
+ props: Array<{
1264
+ __typename?: 'CommandProp';
1265
+ key: string;
1266
+ value: string;
1267
+ }>;
1268
+ containerProps: Array<{
1269
+ __typename?: 'CommandProp';
1270
+ key: string;
1271
+ value: string;
1272
+ }>;
1273
+ }>;
1254
1274
  };
1255
1275
  };
1256
1276
  export type UserPluginsAndIntegrationsQueryVariables = Exact<{
@@ -1,2 +1,2 @@
1
- declare function watchUser(email: string, password: string, cb: () => void): Promise<void>;
1
+ declare function watchUser(authToken: string, cb: () => void): Promise<void>;
2
2
  export default watchUser;
package/dist/index.d.ts CHANGED
@@ -1,10 +1,15 @@
1
1
  export { default as Board } from './components/Board/Board';
2
2
  export { default as BoardProvider } from './components/BoardProvider/BoardProvider';
3
+ export { default as Command } from './components/Command/Command';
3
4
  export { default as CommandGroup } from './components/CommandGroup/CommandGroup';
5
+ export { default as Component } from './components/Component/Component';
4
6
  export { default as Router } from './components/Router/Router';
5
7
  export { default as RouteResolver } from './components/RouteResolver/RouteResolver';
6
8
  export { default as Zone } from './components/Zone/Zone';
9
+ export type { PreviewConfig } from './lib/contexts/PreviewConfigContext';
10
+ export { authorize } from './lib/data';
11
+ export { default as useAuthorization } from './lib/hooks/useAuthorization';
7
12
  export { default as loadCustomDekPlugin } from './lib/utils/loadCustomPlugin';
8
- export { default as useUserConfig } from './lib/hooks/useUserConfig';
13
+ export { default as useUserConfigLoader } from './lib/hooks/useUserConfigLoader';
9
14
  export { default as getPluginApi } from './lib/utils/getPluginApi';
10
15
  export { default as parsePropsForComponent } from './lib/utils/parsePropsForComponent';