@dxos/plugin-github 0.6.8-main.046e6cf
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/README.md +15 -0
- package/dist/lib/browser/chunk-NJP5BGD2.mjs +24 -0
- package/dist/lib/browser/chunk-NJP5BGD2.mjs.map +7 -0
- package/dist/lib/browser/index.css +7 -0
- package/dist/lib/browser/index.css.map +7 -0
- package/dist/lib/browser/index.mjs +1531 -0
- package/dist/lib/browser/index.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -0
- package/dist/lib/browser/meta.mjs +11 -0
- package/dist/lib/browser/meta.mjs.map +7 -0
- package/dist/types/src/GithubPlugin.d.ts +4 -0
- package/dist/types/src/GithubPlugin.d.ts.map +1 -0
- package/dist/types/src/components/EmbeddedMain/EmbeddedMain.d.ts +4 -0
- package/dist/types/src/components/EmbeddedMain/EmbeddedMain.d.ts.map +1 -0
- package/dist/types/src/components/EmbeddedMain/GfmPreview.d.ts +9 -0
- package/dist/types/src/components/EmbeddedMain/GfmPreview.d.ts.map +1 -0
- package/dist/types/src/components/EmbeddedMain/index.d.ts +2 -0
- package/dist/types/src/components/EmbeddedMain/index.d.ts.map +1 -0
- package/dist/types/src/components/ExportDialog.d.ts +8 -0
- package/dist/types/src/components/ExportDialog.d.ts.map +1 -0
- package/dist/types/src/components/GithubApiProviders/GitHubSettings.d.ts +3 -0
- package/dist/types/src/components/GithubApiProviders/GitHubSettings.d.ts.map +1 -0
- package/dist/types/src/components/GithubApiProviders/OctokitProvider.d.ts +15 -0
- package/dist/types/src/components/GithubApiProviders/OctokitProvider.d.ts.map +1 -0
- package/dist/types/src/components/GithubApiProviders/index.d.ts +3 -0
- package/dist/types/src/components/GithubApiProviders/index.d.ts.map +1 -0
- package/dist/types/src/components/GithubEchoResolverProviders/DocumentTreeItem.d.ts +6 -0
- package/dist/types/src/components/GithubEchoResolverProviders/DocumentTreeItem.d.ts.map +1 -0
- package/dist/types/src/components/GithubEchoResolverProviders/ResolverContext.d.ts +7 -0
- package/dist/types/src/components/GithubEchoResolverProviders/ResolverContext.d.ts.map +1 -0
- package/dist/types/src/components/GithubEchoResolverProviders/ResolverDialog.d.ts +6 -0
- package/dist/types/src/components/GithubEchoResolverProviders/ResolverDialog.d.ts.map +1 -0
- package/dist/types/src/components/GithubEchoResolverProviders/ResolverProps.d.ts +16 -0
- package/dist/types/src/components/GithubEchoResolverProviders/ResolverProps.d.ts.map +1 -0
- package/dist/types/src/components/GithubEchoResolverProviders/ResolverTree.d.ts +3 -0
- package/dist/types/src/components/GithubEchoResolverProviders/ResolverTree.d.ts.map +1 -0
- package/dist/types/src/components/GithubEchoResolverProviders/SpacePickerTreeItem.d.ts +11 -0
- package/dist/types/src/components/GithubEchoResolverProviders/SpacePickerTreeItem.d.ts.map +1 -0
- package/dist/types/src/components/GithubEchoResolverProviders/index.d.ts +3 -0
- package/dist/types/src/components/GithubEchoResolverProviders/index.d.ts.map +1 -0
- package/dist/types/src/components/GithubEchoResolverProviders/spaceResolvers.d.ts +6 -0
- package/dist/types/src/components/GithubEchoResolverProviders/spaceResolvers.d.ts.map +1 -0
- package/dist/types/src/components/ImportDialog.d.ts +7 -0
- package/dist/types/src/components/ImportDialog.d.ts.map +1 -0
- package/dist/types/src/components/Issue.d.ts +5 -0
- package/dist/types/src/components/Issue.d.ts.map +1 -0
- package/dist/types/src/components/Loading/Loading.d.ts +15 -0
- package/dist/types/src/components/Loading/Loading.d.ts.map +1 -0
- package/dist/types/src/components/Loading/Loading.stories.d.ts +52 -0
- package/dist/types/src/components/Loading/Loading.stories.d.ts.map +1 -0
- package/dist/types/src/components/Loading/index.d.ts +2 -0
- package/dist/types/src/components/Loading/index.d.ts.map +1 -0
- package/dist/types/src/components/MarkdownActions.d.ts +7 -0
- package/dist/types/src/components/MarkdownActions.d.ts.map +1 -0
- package/dist/types/src/components/UrlDialog.d.ts +6 -0
- package/dist/types/src/components/UrlDialog.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +9 -0
- package/dist/types/src/components/index.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +3 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -0
- package/dist/types/src/hooks/useDocGhId.d.ts +6 -0
- package/dist/types/src/hooks/useDocGhId.d.ts.map +1 -0
- package/dist/types/src/hooks/useGhIdFromUrl.d.ts +2 -0
- package/dist/types/src/hooks/useGhIdFromUrl.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +4 -0
- package/dist/types/src/index.d.ts.map +1 -0
- package/dist/types/src/meta.d.ts +16 -0
- package/dist/types/src/meta.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +56 -0
- package/dist/types/src/translations.d.ts.map +1 -0
- package/dist/types/src/types.d.ts +30 -0
- package/dist/types/src/types.d.ts.map +1 -0
- package/package.json +76 -0
- package/src/GithubPlugin.tsx +129 -0
- package/src/components/EmbeddedMain/EmbeddedMain.tsx +296 -0
- package/src/components/EmbeddedMain/GfmPreview.tsx +110 -0
- package/src/components/EmbeddedMain/embedded.css +3 -0
- package/src/components/EmbeddedMain/index.ts +5 -0
- package/src/components/ExportDialog.tsx +157 -0
- package/src/components/GithubApiProviders/GitHubSettings.tsx +72 -0
- package/src/components/GithubApiProviders/OctokitProvider.tsx +60 -0
- package/src/components/GithubApiProviders/index.ts +6 -0
- package/src/components/GithubEchoResolverProviders/DocumentTreeItem.tsx +26 -0
- package/src/components/GithubEchoResolverProviders/ResolverContext.tsx +140 -0
- package/src/components/GithubEchoResolverProviders/ResolverDialog.tsx +34 -0
- package/src/components/GithubEchoResolverProviders/ResolverProps.ts +23 -0
- package/src/components/GithubEchoResolverProviders/ResolverTree.tsx +86 -0
- package/src/components/GithubEchoResolverProviders/SpacePickerTreeItem.tsx +105 -0
- package/src/components/GithubEchoResolverProviders/index.ts +6 -0
- package/src/components/GithubEchoResolverProviders/spaceResolvers.ts +86 -0
- package/src/components/ImportDialog.tsx +72 -0
- package/src/components/Issue.tsx +62 -0
- package/src/components/Loading/Loading.stories.tsx +28 -0
- package/src/components/Loading/Loading.tsx +70 -0
- package/src/components/Loading/index.ts +5 -0
- package/src/components/MarkdownActions.tsx +136 -0
- package/src/components/UrlDialog.tsx +52 -0
- package/src/components/index.ts +12 -0
- package/src/hooks/index.ts +6 -0
- package/src/hooks/useDocGhId.ts +38 -0
- package/src/hooks/useGhIdFromUrl.ts +26 -0
- package/src/index.ts +9 -0
- package/src/meta.tsx +21 -0
- package/src/translations.ts +72 -0
- package/src/types.ts +51 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResolverProps.d.ts","sourceRoot":"","sources":["../../../../../src/components/GithubEchoResolverProviders/ResolverProps.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAErD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC;IACjD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,EAAE,YAAY,GAAG,IAAI,CAAC;IAC9B,WAAW,EAAE,QAAQ,CAAC,cAAc,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC,CAAC;CAC5D,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,kBAAkB,GAAG,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResolverTree.d.ts","sourceRoot":"","sources":["../../../../../src/components/GithubEchoResolverProviders/ResolverTree.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAkC,MAAM,OAAO,CAAC;AAWvD,eAAO,MAAM,YAAY,yBAsExB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type Space } from '@dxos/react-client/echo';
|
|
3
|
+
export declare const SpacePickerTreeItem: ({ identityHex, space, source, id, setSpace, selected, }: {
|
|
4
|
+
identityHex: string;
|
|
5
|
+
space: Space;
|
|
6
|
+
setSpace: (nextSpace: Space | null) => void;
|
|
7
|
+
source: string;
|
|
8
|
+
id: string;
|
|
9
|
+
selected?: boolean;
|
|
10
|
+
}) => React.JSX.Element;
|
|
11
|
+
//# sourceMappingURL=SpacePickerTreeItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SpacePickerTreeItem.d.ts","sourceRoot":"","sources":["../../../../../src/components/GithubEchoResolverProviders/SpacePickerTreeItem.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAKjD,OAAO,EAAE,KAAK,KAAK,EAAgC,MAAM,yBAAyB,CAAC;AAQnF,eAAO,MAAM,mBAAmB,4DAO7B;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,CAAC,SAAS,EAAE,KAAK,GAAG,IAAI,KAAK,IAAI,CAAC;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,sBAwEA,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/GithubEchoResolverProviders/index.ts"],"names":[],"mappings":"AAIA,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type Space } from '@dxos/react-client/echo';
|
|
2
|
+
export declare const matchSpace: (space: Space, identityHex: string, source?: string, id?: string) => boolean;
|
|
3
|
+
export declare const bindSpace: (space: Space, identityHex: string, source: string, id: string) => string[];
|
|
4
|
+
export declare const unbindSpace: (space: Space, identityHex: string, source: string, id: string) => string[];
|
|
5
|
+
export declare const displayName: (source: string, id: string) => string;
|
|
6
|
+
//# sourceMappingURL=spaceResolvers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spaceResolvers.d.ts","sourceRoot":"","sources":["../../../../../src/components/GithubEchoResolverProviders/spaceResolvers.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAQrD,eAAO,MAAM,UAAU,UAAW,KAAK,eAAe,MAAM,WAAW,MAAM,OAAO,MAAM,YAUzF,CAAC;AAWF,eAAO,MAAM,SAAS,UAAW,KAAK,eAAe,MAAM,UAAU,MAAM,MAAM,MAAM,KAAG,MAAM,EAO/F,CAAC;AAgBF,eAAO,MAAM,WAAW,UAAW,KAAK,eAAe,MAAM,UAAU,MAAM,MAAM,MAAM,KAAG,MAAM,EAOjG,CAAC;AAYF,eAAO,MAAM,WAAW,WAAY,MAAM,MAAM,MAAM,KAAG,MAOxD,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { GhIdentifier } from '../types';
|
|
3
|
+
export declare const ImportDialog: ({ docGhId, onUpdate }: {
|
|
4
|
+
docGhId: GhIdentifier;
|
|
5
|
+
onUpdate: (content: string) => void;
|
|
6
|
+
}) => React.JSX.Element;
|
|
7
|
+
//# sourceMappingURL=ImportDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImportDialog.d.ts","sourceRoot":"","sources":["../../../../src/components/ImportDialog.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAO3C,OAAO,KAAK,EAAoB,YAAY,EAAqB,MAAM,UAAU,CAAC;AAElF,eAAO,MAAM,YAAY,0BAA2B;IAAE,OAAO,EAAE,YAAY,CAAC;IAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,sBA0DjH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Issue.d.ts","sourceRoot":"","sources":["../../../../src/components/Issue.tsx"],"names":[],"mappings":"AAIA,OAAO,EAA6B,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClF,OAAO,KAAwC,MAAM,OAAO,CAAC;AAoD7D,QAAA,MAAM,KAAK,8FAA4G,CAAC;AAIxH,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { type ComponentProps } from 'react';
|
|
2
|
+
export type LoadingSize = 'sm' | 'md' | 'lg' | 'xl';
|
|
3
|
+
export type LoadingColor = 'primary' | 'neutral';
|
|
4
|
+
export interface LoadingSlots {
|
|
5
|
+
root?: Omit<ComponentProps<'div'>, 'children'>;
|
|
6
|
+
svg?: Pick<ComponentProps<'svg'>, 'className'>;
|
|
7
|
+
}
|
|
8
|
+
export interface LoadingProps {
|
|
9
|
+
label: string;
|
|
10
|
+
size?: LoadingSize;
|
|
11
|
+
color?: LoadingColor;
|
|
12
|
+
slots?: LoadingSlots;
|
|
13
|
+
}
|
|
14
|
+
export declare const Loading: ({ size, color, label, slots }: LoadingProps) => React.JSX.Element;
|
|
15
|
+
//# sourceMappingURL=Loading.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Loading.d.ts","sourceRoot":"","sources":["../../../../../src/components/Loading/Loading.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAKnD,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEpD,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,SAAS,CAAC;AAEjD,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,CAAC;IAC/C,GAAG,CAAC,EAAE,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC,CAAC;CAChD;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,KAAK,CAAC,EAAE,YAAY,CAAC;CACtB;AAUD,eAAO,MAAM,OAAO,kCAAwC,YAAY,sBAoCvE,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import '@dxosTheme';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: ({ size, color, label, slots }: import("./Loading").LoadingProps) => import("react").JSX.Element;
|
|
5
|
+
argTypes: {
|
|
6
|
+
size: {
|
|
7
|
+
control: string;
|
|
8
|
+
options: string[];
|
|
9
|
+
};
|
|
10
|
+
color: {
|
|
11
|
+
control: string;
|
|
12
|
+
options: string[];
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export default _default;
|
|
17
|
+
export declare const Default: {
|
|
18
|
+
args: {
|
|
19
|
+
label: string;
|
|
20
|
+
size: string;
|
|
21
|
+
color: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export declare const Small: {
|
|
25
|
+
args: {
|
|
26
|
+
size: string;
|
|
27
|
+
label: string;
|
|
28
|
+
color: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export declare const Neutral: {
|
|
32
|
+
args: {
|
|
33
|
+
color: string;
|
|
34
|
+
label: string;
|
|
35
|
+
size: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export declare const Large: {
|
|
39
|
+
args: {
|
|
40
|
+
size: string;
|
|
41
|
+
label: string;
|
|
42
|
+
color: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
export declare const ExtraLarge: {
|
|
46
|
+
args: {
|
|
47
|
+
size: string;
|
|
48
|
+
label: string;
|
|
49
|
+
color: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=Loading.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Loading.stories.d.ts","sourceRoot":"","sources":["../../../../../src/components/Loading/Loading.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;;;;;;;;;;;;;;;AAIpB,wBAaE;AAEF,eAAO,MAAM,OAAO;;;;;;CAA+D,CAAC;AACpF,eAAO,MAAM,KAAK;;;;;;CAA4C,CAAC;AAC/D,eAAO,MAAM,OAAO;;;;;;CAAkD,CAAC;AACvE,eAAO,MAAM,KAAK;;;;;;CAA4C,CAAC;AAC/D,eAAO,MAAM,UAAU;;;;;;CAA4C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/Loading/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type MarkdownProperties } from '@dxos/plugin-markdown';
|
|
3
|
+
export declare const MarkdownActions: ({ content, properties }: {
|
|
4
|
+
content: string;
|
|
5
|
+
properties: MarkdownProperties;
|
|
6
|
+
}) => React.JSX.Element;
|
|
7
|
+
//# sourceMappingURL=MarkdownActions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarkdownActions.d.ts","sourceRoot":"","sources":["../../../../src/components/MarkdownActions.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAsB,MAAM,OAAO,CAAC;AAI3C,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAYhE,eAAO,MAAM,eAAe,4BAA6B;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,kBAAkB,CAAA;CAAE,sBAkH3G,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UrlDialog.d.ts","sourceRoot":"","sources":["../../../../src/components/UrlDialog.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAExC,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAMhE,eAAO,MAAM,SAAS,mBAAoB;IAAE,UAAU,EAAE,kBAAkB,CAAA;CAAE,sBAuC3E,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './EmbeddedMain';
|
|
2
|
+
export * from './ExportDialog';
|
|
3
|
+
export * from './GithubApiProviders';
|
|
4
|
+
export * from './GithubEchoResolverProviders';
|
|
5
|
+
export * from './ImportDialog';
|
|
6
|
+
export * from './Issue';
|
|
7
|
+
export * from './MarkdownActions';
|
|
8
|
+
export * from './UrlDialog';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/index.ts"],"names":[],"mappings":"AAIA,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDocGhId.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useDocGhId.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,eAAO,MAAM,UAAU,SAAU;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,wBA2BlE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useGhIdFromUrl.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useGhIdFromUrl.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc,eAAgB,MAAM,kBAmB/B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,eAAe,YAAY,CAAC;AAE5B,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type IconProps } from '@phosphor-icons/react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare const GITHUB_PLUGIN = "dxos.org/plugin/github";
|
|
4
|
+
export declare const GITHUB_PLUGIN_SHORT_ID = "github";
|
|
5
|
+
declare const _default: {
|
|
6
|
+
id: string;
|
|
7
|
+
shortId?: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
homePage?: string;
|
|
11
|
+
tags?: string[];
|
|
12
|
+
iconComponent?: React.FC<IconProps>;
|
|
13
|
+
iconSymbol?: string;
|
|
14
|
+
};
|
|
15
|
+
export default _default;
|
|
16
|
+
//# sourceMappingURL=meta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,eAAO,MAAM,aAAa,2BAA2B,CAAC;AACtD,eAAO,MAAM,sBAAsB,WAAW,CAAC;;;;;;;;;;;AAE/C,wBAQG"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
'en-US': {
|
|
3
|
+
"dxos.org/plugin/github": {
|
|
4
|
+
'plugin name': string;
|
|
5
|
+
'markdown actions label': string;
|
|
6
|
+
'unbind to file in github label': string;
|
|
7
|
+
'bind to file in github label': string;
|
|
8
|
+
'github pat label': string;
|
|
9
|
+
'github pat description': string;
|
|
10
|
+
'github pat description href': string;
|
|
11
|
+
'empty github pat message': string;
|
|
12
|
+
'set github pat label': string;
|
|
13
|
+
'error github pat message': string;
|
|
14
|
+
'error github markdown path message': string;
|
|
15
|
+
'paste url to file in github label': string;
|
|
16
|
+
'paste url to file in github description': string;
|
|
17
|
+
'paste url to file in github placeholder': string;
|
|
18
|
+
'confirm export title': string;
|
|
19
|
+
'export to github success message': string;
|
|
20
|
+
'github branch name label': string;
|
|
21
|
+
'github branch name placeholder': string;
|
|
22
|
+
'github commit message label': string;
|
|
23
|
+
'github commit message placeholder': string;
|
|
24
|
+
'save and close description': string;
|
|
25
|
+
'close embed description': string;
|
|
26
|
+
'resolver init document message': string;
|
|
27
|
+
'comment stale title': string;
|
|
28
|
+
'comment stale body': string;
|
|
29
|
+
'open in github label': string;
|
|
30
|
+
'stale rescue title': string;
|
|
31
|
+
'stale rescue description': string;
|
|
32
|
+
'embedded options label': string;
|
|
33
|
+
'unset repo space label': string;
|
|
34
|
+
'loading preview message': string;
|
|
35
|
+
'preview gfm label': string;
|
|
36
|
+
'exit gfm preview label': string;
|
|
37
|
+
'save and close label': string;
|
|
38
|
+
'export to github label': string;
|
|
39
|
+
'import from github label': string;
|
|
40
|
+
'resolver tree label': string;
|
|
41
|
+
'resolver tree description': string;
|
|
42
|
+
'resolver no spaces message': string;
|
|
43
|
+
'resolver create space label': string;
|
|
44
|
+
'bound members message_one': string;
|
|
45
|
+
'bound members message_other': string;
|
|
46
|
+
'select label': string;
|
|
47
|
+
'selected label': string;
|
|
48
|
+
'open in composer label': string;
|
|
49
|
+
'confirm import title': string;
|
|
50
|
+
'confirm import body': string;
|
|
51
|
+
'target blank description': string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
}[];
|
|
55
|
+
export default _default;
|
|
56
|
+
//# sourceMappingURL=translations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,wBAiEE"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type Dispatch, type SetStateAction } from 'react';
|
|
2
|
+
import { type GraphBuilderProvides, type TranslationsProvides, type SettingsProvides, type SurfaceProvides } from '@dxos/app-framework';
|
|
3
|
+
import { type DocumentType } from '@dxos/plugin-markdown/types';
|
|
4
|
+
import { type Space } from '@dxos/react-client/echo';
|
|
5
|
+
export type EditorViewState = 'editor' | 'preview';
|
|
6
|
+
export type MarkdownDocumentProps = {
|
|
7
|
+
space: Space;
|
|
8
|
+
document: DocumentType;
|
|
9
|
+
layout: 'standalone' | 'embedded';
|
|
10
|
+
editorViewState: EditorViewState;
|
|
11
|
+
setEditorViewState: Dispatch<SetStateAction<EditorViewState>>;
|
|
12
|
+
};
|
|
13
|
+
export type GhSharedProps = {
|
|
14
|
+
owner: string;
|
|
15
|
+
repo: string;
|
|
16
|
+
};
|
|
17
|
+
export type GhFileIdentifier = GhSharedProps & {
|
|
18
|
+
ref: string;
|
|
19
|
+
path: string;
|
|
20
|
+
};
|
|
21
|
+
export type GhIssueIdentifier = GhSharedProps & {
|
|
22
|
+
issueNumber: number;
|
|
23
|
+
};
|
|
24
|
+
export type GhIdentifier = GhFileIdentifier | GhIssueIdentifier;
|
|
25
|
+
export type ExportViewState = 'create-pr' | 'pending' | 'response' | null;
|
|
26
|
+
export type GithubSettingsProps = {
|
|
27
|
+
pat?: string;
|
|
28
|
+
};
|
|
29
|
+
export type GithubPluginProvides = SurfaceProvides & GraphBuilderProvides & SettingsProvides<GithubSettingsProps> & TranslationsProvides;
|
|
30
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAErD,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEnD,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,YAAY,CAAC;IACvB,MAAM,EAAE,YAAY,GAAG,UAAU,CAAC;IAClC,eAAe,EAAE,eAAe,CAAC;IACjC,kBAAkB,EAAE,QAAQ,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,CAAC;CAC/D,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG;IAC7C,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG;IAC9C,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,gBAAgB,GAAG,iBAAiB,CAAC;AAEhE,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,IAAI,CAAC;AAE1E,MAAM,MAAM,mBAAmB,GAAG;IAChC,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,eAAe,GAChD,oBAAoB,GACpB,gBAAgB,CAAC,mBAAmB,CAAC,GACrC,oBAAoB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dxos/plugin-github",
|
|
3
|
+
"version": "0.6.8-main.046e6cf",
|
|
4
|
+
"description": "DXOS Surface plugin for integrating with GitHub",
|
|
5
|
+
"homepage": "https://dxos.org",
|
|
6
|
+
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"author": "DXOS.org",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"browser": "./dist/lib/browser/index.mjs",
|
|
12
|
+
"types": "./dist/types/src/index.d.ts"
|
|
13
|
+
},
|
|
14
|
+
"./meta": {
|
|
15
|
+
"browser": "./dist/lib/browser/meta.mjs",
|
|
16
|
+
"types": "./dist/types/src/meta.d.ts"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"types": "dist/types/src/index.d.ts",
|
|
20
|
+
"typesVersions": {
|
|
21
|
+
"*": {
|
|
22
|
+
"meta": [
|
|
23
|
+
"dist/types/src/meta.d.ts"
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"dist",
|
|
29
|
+
"src"
|
|
30
|
+
],
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@preact/signals-core": "^1.6.0",
|
|
33
|
+
"dompurify": "^3.0.3",
|
|
34
|
+
"github-markdown-css": "^5.2.0",
|
|
35
|
+
"lodash.get": "^4.4.2",
|
|
36
|
+
"lodash.update": "^4.10.2",
|
|
37
|
+
"octokit": "^2.0.14",
|
|
38
|
+
"@dxos/app-framework": "0.6.8-main.046e6cf",
|
|
39
|
+
"@dxos/async": "0.6.8-main.046e6cf",
|
|
40
|
+
"@dxos/echo-schema": "0.6.8-main.046e6cf",
|
|
41
|
+
"@dxos/local-storage": "0.6.8-main.046e6cf",
|
|
42
|
+
"@dxos/log": "0.6.8-main.046e6cf",
|
|
43
|
+
"@dxos/plugin-client": "0.6.8-main.046e6cf",
|
|
44
|
+
"@dxos/plugin-graph": "0.6.8-main.046e6cf",
|
|
45
|
+
"@dxos/plugin-markdown": "0.6.8-main.046e6cf",
|
|
46
|
+
"@dxos/plugin-settings": "0.6.8-main.046e6cf",
|
|
47
|
+
"@dxos/plugin-space": "0.6.8-main.046e6cf",
|
|
48
|
+
"@dxos/react-client": "0.6.8-main.046e6cf",
|
|
49
|
+
"@dxos/util": "0.6.8-main.046e6cf",
|
|
50
|
+
"@dxos/react-ui-editor": "0.6.8-main.046e6cf"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@phosphor-icons/react": "^2.1.5",
|
|
54
|
+
"@types/dompurify": "^3.0.2",
|
|
55
|
+
"@types/lodash.get": "^4.4.7",
|
|
56
|
+
"@types/lodash.update": "^4.10.7",
|
|
57
|
+
"@types/react": "~18.2.0",
|
|
58
|
+
"@types/react-dom": "~18.2.0",
|
|
59
|
+
"react": "~18.2.0",
|
|
60
|
+
"react-dom": "~18.2.0",
|
|
61
|
+
"vite": "^5.3.4",
|
|
62
|
+
"@dxos/react-ui": "0.6.8-main.046e6cf",
|
|
63
|
+
"@dxos/react-ui-theme": "0.6.8-main.046e6cf",
|
|
64
|
+
"@dxos/storybook-utils": "0.6.8-main.046e6cf"
|
|
65
|
+
},
|
|
66
|
+
"peerDependencies": {
|
|
67
|
+
"@phosphor-icons/react": "^2.1.5",
|
|
68
|
+
"react": "^18.0.0",
|
|
69
|
+
"react-dom": "^18.0.0",
|
|
70
|
+
"@dxos/react-ui": "0.6.8-main.046e6cf",
|
|
71
|
+
"@dxos/react-ui-theme": "0.6.8-main.046e6cf"
|
|
72
|
+
},
|
|
73
|
+
"publishConfig": {
|
|
74
|
+
"access": "public"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { GithubLogo, type IconProps } from '@phosphor-icons/react';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
|
|
8
|
+
import { resolvePlugin, type PluginDefinition } from '@dxos/app-framework';
|
|
9
|
+
import { LocalStorageStore } from '@dxos/local-storage';
|
|
10
|
+
import { log } from '@dxos/log';
|
|
11
|
+
import { parseClientPlugin } from '@dxos/plugin-client';
|
|
12
|
+
import { createExtension, type Node } from '@dxos/plugin-graph';
|
|
13
|
+
import { isMarkdownProperties } from '@dxos/plugin-markdown';
|
|
14
|
+
import { DocumentType } from '@dxos/plugin-markdown/types';
|
|
15
|
+
import { memoizeQuery } from '@dxos/plugin-space';
|
|
16
|
+
import { getMeta, isSpace, Filter, type Space } from '@dxos/react-client/echo';
|
|
17
|
+
|
|
18
|
+
import { EmbeddedMain, ImportDialog, OctokitProvider, GitHubSettings, UrlDialog, MarkdownActions } from './components';
|
|
19
|
+
import meta, { GITHUB_PLUGIN, GITHUB_PLUGIN_SHORT_ID } from './meta';
|
|
20
|
+
import translations from './translations';
|
|
21
|
+
import { type GhIdentifier, type GithubPluginProvides, type GithubSettingsProps } from './types';
|
|
22
|
+
|
|
23
|
+
export const GithubPlugin = (): PluginDefinition<GithubPluginProvides> => {
|
|
24
|
+
const settings = new LocalStorageStore<GithubSettingsProps>(GITHUB_PLUGIN);
|
|
25
|
+
|
|
26
|
+
return {
|
|
27
|
+
meta,
|
|
28
|
+
ready: async () => {
|
|
29
|
+
settings.prop({ key: 'pat', type: LocalStorageStore.string({ allowUndefined: true }) });
|
|
30
|
+
},
|
|
31
|
+
unload: async () => {
|
|
32
|
+
settings.close();
|
|
33
|
+
},
|
|
34
|
+
provides: {
|
|
35
|
+
settings: settings.values,
|
|
36
|
+
translations,
|
|
37
|
+
graph: {
|
|
38
|
+
builder: (plugins) => {
|
|
39
|
+
const client = resolvePlugin(plugins, parseClientPlugin)?.provides.client;
|
|
40
|
+
if (!client) {
|
|
41
|
+
return [];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return createExtension({
|
|
45
|
+
id: GITHUB_PLUGIN,
|
|
46
|
+
filter: (node): node is Node<Space> => isSpace(node.data),
|
|
47
|
+
connector: ({ node }) => {
|
|
48
|
+
const documents = memoizeQuery(
|
|
49
|
+
node.data,
|
|
50
|
+
Filter.schema(DocumentType, (doc) =>
|
|
51
|
+
getMeta(doc)?.keys?.find((key) => key?.source?.includes('github')),
|
|
52
|
+
),
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
if (documents.length > 0) {
|
|
56
|
+
return [
|
|
57
|
+
{
|
|
58
|
+
id: `${GITHUB_PLUGIN_SHORT_ID}:${node.id}`,
|
|
59
|
+
data: GITHUB_PLUGIN_SHORT_ID,
|
|
60
|
+
type: GITHUB_PLUGIN,
|
|
61
|
+
properties: {
|
|
62
|
+
label: ['plugin name', { ns: GITHUB_PLUGIN }],
|
|
63
|
+
icon: (props: IconProps) => <GithubLogo {...props} />,
|
|
64
|
+
iconSymbol: 'ph--github-logo--regular',
|
|
65
|
+
},
|
|
66
|
+
// TODO(wittjosiah): Add documents.
|
|
67
|
+
// nodes: documents.map((doc) => ({}),
|
|
68
|
+
},
|
|
69
|
+
];
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
context: (props) => (
|
|
76
|
+
<OctokitProvider pat={settings.values.pat} onPatChanged={(pat) => (settings.values.pat = pat)} {...props} />
|
|
77
|
+
),
|
|
78
|
+
surface: {
|
|
79
|
+
component: ({ data, role }) => {
|
|
80
|
+
switch (data.component) {
|
|
81
|
+
case `${GITHUB_PLUGIN}/embedded`:
|
|
82
|
+
return <EmbeddedMain />;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
switch (role) {
|
|
86
|
+
case 'dialog':
|
|
87
|
+
switch (data.content) {
|
|
88
|
+
case 'dxos.org/plugin/github/BindDialog':
|
|
89
|
+
return isMarkdownProperties(data.properties) ? <UrlDialog properties={data.properties} /> : null;
|
|
90
|
+
// TODO(burdon): Model should not be passed via surfaces.
|
|
91
|
+
// return isEditorModel(data.model) ? (
|
|
92
|
+
// <ExportDialog
|
|
93
|
+
// model={data.model}
|
|
94
|
+
// type={data.type as ExportViewState}
|
|
95
|
+
// target={data.target as string | null}
|
|
96
|
+
// docGhId={data.docGhId as GhIdentifier}
|
|
97
|
+
// />
|
|
98
|
+
// ) : null;
|
|
99
|
+
case 'dxos.org/plugin/github/ExportDialog':
|
|
100
|
+
return null;
|
|
101
|
+
case 'dxos.org/plugin/github/ImportDialog':
|
|
102
|
+
return (
|
|
103
|
+
<ImportDialog
|
|
104
|
+
docGhId={data.docGhId as GhIdentifier}
|
|
105
|
+
onUpdate={(content) => {
|
|
106
|
+
// TODO(burdon): Fire intent.
|
|
107
|
+
log.info('onUpdate', content);
|
|
108
|
+
}}
|
|
109
|
+
/>
|
|
110
|
+
);
|
|
111
|
+
default:
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
case 'menuitem':
|
|
115
|
+
return typeof data.content === 'string' &&
|
|
116
|
+
isMarkdownProperties(data.properties) &&
|
|
117
|
+
!data.properties.readonly ? (
|
|
118
|
+
<MarkdownActions content={data.content} properties={data.properties} />
|
|
119
|
+
) : null;
|
|
120
|
+
case 'settings':
|
|
121
|
+
return data.plugin === meta.id ? <GitHubSettings /> : null;
|
|
122
|
+
default:
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
};
|