@dxos/plugin-kanban 0.7.5-labs.e27f9b9 → 0.7.5-labs.f400bbc
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/dist/lib/browser/artifact-definition-NJGTNX74.mjs +177 -0
- package/dist/lib/browser/artifact-definition-NJGTNX74.mjs.map +7 -0
- package/dist/lib/browser/{chunk-FAA5WRZY.mjs → chunk-ILL6UKZE.mjs} +34 -9
- package/dist/lib/browser/chunk-ILL6UKZE.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +26 -15
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-EYGCUTQP.mjs → intent-resolver-6BD4KUAU.mjs} +51 -5
- package/dist/lib/browser/intent-resolver-6BD4KUAU.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-SARIDX5F.mjs → react-surface-6NYIVXVG.mjs} +96 -51
- package/dist/lib/browser/react-surface-6NYIVXVG.mjs.map +7 -0
- package/dist/lib/browser/types.mjs +7 -1
- package/dist/lib/node/artifact-definition-FDZAT4PG.cjs +192 -0
- package/dist/lib/node/artifact-definition-FDZAT4PG.cjs.map +7 -0
- package/dist/lib/node/{chunk-PLKK6ZJE.cjs → chunk-63KJGDFJ.cjs} +40 -12
- package/dist/lib/node/chunk-63KJGDFJ.cjs.map +7 -0
- package/dist/lib/node/index.cjs +33 -23
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/{intent-resolver-DPMA6342.cjs → intent-resolver-DHL5HBJM.cjs} +57 -11
- package/dist/lib/node/intent-resolver-DHL5HBJM.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-J5WY2F5B.cjs → react-surface-65D6R6Z7.cjs} +107 -64
- package/dist/lib/node/react-surface-65D6R6Z7.cjs.map +7 -0
- package/dist/lib/node/types.cjs +10 -4
- package/dist/lib/node/types.cjs.map +2 -2
- package/dist/lib/node-esm/artifact-definition-OD3OJAWN.mjs +178 -0
- package/dist/lib/node-esm/artifact-definition-OD3OJAWN.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-3753HLJC.mjs → chunk-TZ3QKBLD.mjs} +34 -9
- package/dist/lib/node-esm/chunk-TZ3QKBLD.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +26 -15
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-KY3JF673.mjs → intent-resolver-QQWZXC5O.mjs} +51 -5
- package/dist/lib/node-esm/intent-resolver-QQWZXC5O.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-66YOBKYF.mjs → react-surface-4JPB2SZX.mjs} +96 -51
- package/dist/lib/node-esm/react-surface-4JPB2SZX.mjs.map +7 -0
- package/dist/lib/node-esm/types.mjs +7 -1
- package/dist/types/src/KanbanPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/artifact-definition.d.ts +11 -0
- package/dist/types/src/capabilities/artifact-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +1 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/KanbanContainer.d.ts +1 -2
- package/dist/types/src/components/KanbanContainer.d.ts.map +1 -1
- package/dist/types/src/components/KanbanViewEditor.d.ts +1 -2
- package/dist/types/src/components/KanbanViewEditor.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +1 -0
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +3 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +32 -16
- package/dist/types/src/types.d.ts.map +1 -1
- package/package.json +26 -21
- package/src/KanbanPlugin.tsx +22 -10
- package/src/capabilities/artifact-definition.ts +135 -0
- package/src/capabilities/index.ts +1 -0
- package/src/capabilities/intent-resolver.ts +22 -2
- package/src/capabilities/react-surface.tsx +63 -2
- package/src/components/KanbanContainer.tsx +10 -10
- package/src/components/KanbanViewEditor.tsx +6 -23
- package/src/meta.ts +3 -1
- package/src/translations.ts +1 -0
- package/src/types.ts +34 -7
- package/dist/lib/browser/chunk-FAA5WRZY.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-EYGCUTQP.mjs.map +0 -7
- package/dist/lib/browser/react-surface-SARIDX5F.mjs.map +0 -7
- package/dist/lib/node/chunk-PLKK6ZJE.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-DPMA6342.cjs.map +0 -7
- package/dist/lib/node/react-surface-J5WY2F5B.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-3753HLJC.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-KY3JF673.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-66YOBKYF.mjs.map +0 -7
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
|
+
CreateKanbanSchema,
|
|
4
|
+
InitialPivotColumnAnnotationId,
|
|
5
|
+
InitialSchemaAnnotationId,
|
|
3
6
|
KanbanAction,
|
|
4
7
|
createKanban,
|
|
5
8
|
isKanban
|
|
6
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-TZ3QKBLD.mjs";
|
|
7
10
|
export {
|
|
11
|
+
CreateKanbanSchema,
|
|
12
|
+
InitialPivotColumnAnnotationId,
|
|
13
|
+
InitialSchemaAnnotationId,
|
|
8
14
|
KanbanAction,
|
|
9
15
|
createKanban,
|
|
10
16
|
isKanban
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KanbanPlugin.d.ts","sourceRoot":"","sources":["../../../src/KanbanPlugin.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"KanbanPlugin.d.ts","sourceRoot":"","sources":["../../../src/KanbanPlugin.tsx"],"names":[],"mappings":"AAeA,eAAO,MAAM,YAAY,4CA+CrB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type PromiseIntentDispatcher } from '@dxos/app-framework';
|
|
2
|
+
import { type Space } from '@dxos/react-client/echo';
|
|
3
|
+
declare global {
|
|
4
|
+
interface ToolContextExtensions {
|
|
5
|
+
space?: Space;
|
|
6
|
+
dispatch?: PromiseIntentDispatcher;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
declare const _default: () => import("@dxos/app-framework").Capability<import("@dxos/artifact").ArtifactDefinition>;
|
|
10
|
+
export default _default;
|
|
11
|
+
//# sourceMappingURL=artifact-definition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-definition.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/artifact-definition.ts"],"names":[],"mappings":"AAMA,OAAO,EAAkD,KAAK,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAMnH,OAAO,EAA4B,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAU/E,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,KAAK,CAAC,EAAE,KAAK,CAAC;QACd,QAAQ,CAAC,EAAE,uBAAuB,CAAC;KACpC;CACF;;AAED,wBAyGE"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare const ArtifactDefinition: (props?: unknown) => Promise<() => Promise<import("@dxos/app-framework").Capability<import("@dxos/artifact").ArtifactDefinition> | import("@dxos/app-framework").AnyCapability[]>>;
|
|
1
2
|
export declare const IntentResolver: (props?: unknown) => Promise<() => Promise<import("@dxos/app-framework").Capability<import("@dxos/app-framework").Capabilities.IntentResolver> | import("@dxos/app-framework").AnyCapability[]>>;
|
|
2
3
|
export declare const ReactSurface: (props?: unknown) => Promise<() => Promise<import("@dxos/app-framework").Capability<import("@dxos/app-framework").Capabilities.ReactSurface> | import("@dxos/app-framework").AnyCapability[]>>;
|
|
3
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc,kMAA0C,CAAC;AACtE,eAAO,MAAM,YAAY,gMAAwC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,kBAAkB,oLAA8C,CAAC;AAC9E,eAAO,MAAM,cAAc,kMAA0C,CAAC;AACtE,eAAO,MAAM,YAAY,gMAAwC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intent-resolver.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/intent-resolver.ts"],"names":[],"mappings":"AAIA,OAAO,EAAe,YAAY,EAAkB,MAAM,qBAAqB,CAAC;;AAQhF,
|
|
1
|
+
{"version":3,"file":"intent-resolver.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/intent-resolver.ts"],"names":[],"mappings":"AAIA,OAAO,EAAe,YAAY,EAAkB,MAAM,qBAAqB,CAAC;;AAQhF,wBAoDK"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-surface.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/react-surface.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAA8B,MAAM,qBAAqB,CAAC;;
|
|
1
|
+
{"version":3,"file":"react-surface.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/react-surface.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAA8B,MAAM,qBAAqB,CAAC;;AAY/E,wBAsEK"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { type KanbanType } from '@dxos/react-ui-kanban';
|
|
3
2
|
export declare const KanbanContainer: ({ kanban }: {
|
|
4
3
|
kanban: KanbanType;
|
|
5
4
|
role: string;
|
|
6
|
-
}) =>
|
|
5
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
6
|
//# sourceMappingURL=KanbanContainer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KanbanContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/KanbanContainer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"KanbanContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/KanbanContainer.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,UAAU,EAA0B,MAAM,uBAAuB,CAAC;AAMhF,eAAO,MAAM,eAAe,eAAgB;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,4CA+D/E,CAAC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { type KanbanType } from '@dxos/react-ui-kanban';
|
|
3
2
|
type KanbanViewEditorProps = {
|
|
4
3
|
kanban: KanbanType;
|
|
5
4
|
};
|
|
6
|
-
export declare const KanbanViewEditor: ({ kanban }: KanbanViewEditorProps) =>
|
|
5
|
+
export declare const KanbanViewEditor: ({ kanban }: KanbanViewEditorProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
7
6
|
export {};
|
|
8
7
|
//# sourceMappingURL=KanbanViewEditor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KanbanViewEditor.d.ts","sourceRoot":"","sources":["../../../../src/components/KanbanViewEditor.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"KanbanViewEditor.d.ts","sourceRoot":"","sources":["../../../../src/components/KanbanViewEditor.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,KAAK,UAAU,EAAwB,MAAM,uBAAuB,CAAC;AAK9E,KAAK,qBAAqB,GAAG;IAAE,MAAM,EAAE,UAAU,CAAA;CAAE,CAAC;AAEpD,eAAO,MAAM,gBAAgB,eAAgB,qBAAqB,mDAsEjE,CAAC"}
|
package/dist/types/src/meta.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,aAAa,2BAA2B,CAAC;AAEtD,eAAO,MAAM,IAAI
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,aAAa,2BAA2B,CAAC;AAEtD,eAAO,MAAM,IAAI;;;;;;;;CASK,CAAC"}
|
|
@@ -15,6 +15,7 @@ declare const _default: {
|
|
|
15
15
|
'delete item label'?: undefined;
|
|
16
16
|
'create kanban label'?: undefined;
|
|
17
17
|
'card field deleted label'?: undefined;
|
|
18
|
+
'card deleted label'?: undefined;
|
|
18
19
|
} | {
|
|
19
20
|
'plugin name': string;
|
|
20
21
|
'kanban title label': string;
|
|
@@ -29,6 +30,7 @@ declare const _default: {
|
|
|
29
30
|
'delete item label': string;
|
|
30
31
|
'create kanban label': string;
|
|
31
32
|
'card field deleted label': string;
|
|
33
|
+
'card deleted label': string;
|
|
32
34
|
'typename label'?: undefined;
|
|
33
35
|
};
|
|
34
36
|
"dxos.org/plugin/kanban": {
|
|
@@ -45,6 +47,7 @@ declare const _default: {
|
|
|
45
47
|
'delete item label': string;
|
|
46
48
|
'create kanban label': string;
|
|
47
49
|
'card field deleted label': string;
|
|
50
|
+
'card deleted label': string;
|
|
48
51
|
};
|
|
49
52
|
};
|
|
50
53
|
}[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,wBAwBE"}
|
|
@@ -9,14 +9,25 @@ import { KanbanType } from '@dxos/react-ui-kanban';
|
|
|
9
9
|
* (e.g., a column object containing an array of ordered items) or projections constructed
|
|
10
10
|
* by the model (e.g., a query of items based on metadata within a column object).
|
|
11
11
|
*/
|
|
12
|
+
export declare const InitialSchemaAnnotationId: unique symbol;
|
|
13
|
+
export declare const InitialPivotColumnAnnotationId: unique symbol;
|
|
14
|
+
export declare const CreateKanbanSchema: S.Struct<{
|
|
15
|
+
name: S.optional<typeof S.String>;
|
|
16
|
+
initialSchema: S.optional<S.SchemaClass<string, string, never>>;
|
|
17
|
+
initialPivotColumn: S.optional<S.SchemaClass<string, string, never>>;
|
|
18
|
+
}>;
|
|
19
|
+
export type CreateKanbanType = S.Schema.Type<typeof CreateKanbanSchema>;
|
|
12
20
|
export declare namespace KanbanAction {
|
|
13
21
|
const Create_base: S.TaggedClass<Create, "dxos.org/plugin/kanban/action/create", {
|
|
14
22
|
readonly _tag: S.tag<"dxos.org/plugin/kanban/action/create">;
|
|
15
23
|
} & {
|
|
16
|
-
input: S.Struct<{
|
|
17
|
-
name: S.optional<typeof S.String>;
|
|
24
|
+
input: S.extend<S.Struct<{
|
|
18
25
|
space: S.Schema<Space, Space, never>;
|
|
19
|
-
}
|
|
26
|
+
}>, S.Struct<{
|
|
27
|
+
name: S.optional<typeof S.String>;
|
|
28
|
+
initialSchema: S.optional<S.SchemaClass<string, string, never>>;
|
|
29
|
+
initialPivotColumn: S.optional<S.SchemaClass<string, string, never>>;
|
|
30
|
+
}>>;
|
|
20
31
|
output: S.Struct<{
|
|
21
32
|
object: typeof KanbanType;
|
|
22
33
|
}>;
|
|
@@ -32,19 +43,10 @@ export declare namespace KanbanAction {
|
|
|
32
43
|
deletionData: S.optional<S.Struct<{
|
|
33
44
|
field: S.mutable<S.Struct<{
|
|
34
45
|
id: typeof S.String;
|
|
35
|
-
path: S.Schema<import("@dxos/
|
|
36
|
-
visible: S.optional<typeof S.
|
|
37
|
-
/**
|
|
38
|
-
* Kanban data model.
|
|
39
|
-
* A Kanban board is a collection of columns, each of which contains a collection of items.
|
|
40
|
-
* The layout of columns and items is controlled by models.
|
|
41
|
-
* The underlying data model may be represented by direct object relationships
|
|
42
|
-
* (e.g., a column object containing an array of ordered items) or projections constructed
|
|
43
|
-
* by the model (e.g., a query of items based on metadata within a column object).
|
|
44
|
-
*/
|
|
45
|
-
Boolean>;
|
|
46
|
+
path: S.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>;
|
|
47
|
+
visible: S.optional<typeof S.Boolean>;
|
|
46
48
|
size: S.optional<typeof S.Number>;
|
|
47
|
-
referencePath: S.optional<S.Schema<import("@dxos/
|
|
49
|
+
referencePath: S.optional<S.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>>;
|
|
48
50
|
}>>;
|
|
49
51
|
props: typeof S.Any;
|
|
50
52
|
index: typeof S.Number;
|
|
@@ -54,6 +56,16 @@ export declare namespace KanbanAction {
|
|
|
54
56
|
}>;
|
|
55
57
|
export class DeleteCardField extends DeleteCardField_base {
|
|
56
58
|
}
|
|
59
|
+
const DeleteCard_base: S.TaggedClass<DeleteCard, "dxos.org/plugin/kanban/action/delete-card", {
|
|
60
|
+
readonly _tag: S.tag<"dxos.org/plugin/kanban/action/delete-card">;
|
|
61
|
+
} & {
|
|
62
|
+
input: S.Struct<{
|
|
63
|
+
card: typeof S.Any;
|
|
64
|
+
}>;
|
|
65
|
+
output: typeof S.Void;
|
|
66
|
+
}>;
|
|
67
|
+
export class DeleteCard extends DeleteCard_base {
|
|
68
|
+
}
|
|
57
69
|
export {};
|
|
58
70
|
}
|
|
59
71
|
export interface KanbanModel {
|
|
@@ -63,5 +75,9 @@ export type Location = {
|
|
|
63
75
|
idx?: number;
|
|
64
76
|
};
|
|
65
77
|
export declare const isKanban: (object: unknown) => object is KanbanType;
|
|
66
|
-
export declare const createKanban: (
|
|
78
|
+
export declare const createKanban: (props: {
|
|
79
|
+
space: Space;
|
|
80
|
+
initialSchema?: string;
|
|
81
|
+
initialPivotColumn?: string;
|
|
82
|
+
}) => Promise<KanbanType>;
|
|
67
83
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AACtC,OAAO,EAAE,KAAK,KAAK,EAAe,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAMnD;;;;;;;GAOG;AAEH,eAAO,MAAM,yBAAyB,eAA6D,CAAC;AACpG,eAAO,MAAM,8BAA8B,eAAkE,CAAC;AAE9G,eAAO,MAAM,kBAAkB;;;;EAc7B,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAExE,yBAAiB,YAAY,CAAC;;;;;;;;;;;;;;;IAG5B,MAAM,OAAO,MAAO,SAAQ,WAK1B;KAAG;;;;;;;;;+BA3CL,EAAG,MAAM;0BAAW,EAAI,MAAK;6BACxB,EAAE,QAAQ,QAAO,EAAI,OAAM;0BAEjC,EAAG,QAAQ,QAAO,EAAI,MAAK;mCAGxB,EAAG,QAAQ,CAAC,EAAE,MAChB;;;;;;;;IAsCA,MAAM,OAAO,eAAgB,SAAQ,oBAgBnC;KAAG;;;;;;;;;IAEL,MAAM,OAAO,UAAW,SAAQ,eAK9B;KAAG;;CACN;AAUD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,UAAU,CAAC;CAClB;AAED,MAAM,MAAM,QAAQ,GAAG;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,eAAO,MAAM,QAAQ,WAAY,OAAO,KAAG,MAAM,IAAI,UAA4D,CAAC;AAElH,eAAO,MAAM,YAAY,UAAiB;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAAC,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAAE,wBAG9G,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-kanban",
|
|
3
|
-
"version": "0.7.5-labs.
|
|
3
|
+
"version": "0.7.5-labs.f400bbc",
|
|
4
4
|
"description": "Kanban DXOS Surface plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"author": "DXOS.org",
|
|
9
9
|
"sideEffects": true,
|
|
10
|
+
"type": "module",
|
|
10
11
|
"exports": {
|
|
11
12
|
".": {
|
|
12
13
|
"types": "./dist/types/src/index.d.ts",
|
|
@@ -34,21 +35,24 @@
|
|
|
34
35
|
"dependencies": {
|
|
35
36
|
"@effect/schema": "^0.75.5",
|
|
36
37
|
"@preact/signals-core": "^1.6.0",
|
|
37
|
-
"@dxos/app-framework": "0.7.5-labs.
|
|
38
|
-
"@dxos/
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/plugin-
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/react-
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/
|
|
38
|
+
"@dxos/app-framework": "0.7.5-labs.f400bbc",
|
|
39
|
+
"@dxos/assistant": "0.7.5-labs.f400bbc",
|
|
40
|
+
"@dxos/artifact": "0.7.5-labs.f400bbc",
|
|
41
|
+
"@dxos/echo-schema": "0.7.5-labs.f400bbc",
|
|
42
|
+
"@dxos/effect": "0.7.5-labs.f400bbc",
|
|
43
|
+
"@dxos/async": "0.7.5-labs.f400bbc",
|
|
44
|
+
"@dxos/invariant": "0.7.5-labs.f400bbc",
|
|
45
|
+
"@dxos/plugin-client": "0.7.5-labs.f400bbc",
|
|
46
|
+
"@dxos/plugin-graph": "0.7.5-labs.f400bbc",
|
|
47
|
+
"@dxos/plugin-search": "0.7.5-labs.f400bbc",
|
|
48
|
+
"@dxos/plugin-space": "0.7.5-labs.f400bbc",
|
|
49
|
+
"@dxos/random": "0.7.5-labs.f400bbc",
|
|
50
|
+
"@dxos/react-client": "0.7.5-labs.f400bbc",
|
|
51
|
+
"@dxos/react-ui-form": "0.7.5-labs.f400bbc",
|
|
52
|
+
"@dxos/react-ui-kanban": "0.7.5-labs.f400bbc",
|
|
53
|
+
"@dxos/schema": "0.7.5-labs.f400bbc",
|
|
54
|
+
"@dxos/react-ui-stack": "0.7.5-labs.f400bbc",
|
|
55
|
+
"@dxos/util": "0.7.5-labs.f400bbc"
|
|
52
56
|
},
|
|
53
57
|
"devDependencies": {
|
|
54
58
|
"@types/react": "~18.2.0",
|
|
@@ -56,15 +60,16 @@
|
|
|
56
60
|
"react": "~18.2.0",
|
|
57
61
|
"react-dom": "~18.2.0",
|
|
58
62
|
"vite": "5.4.7",
|
|
59
|
-
"@dxos/react-ui": "0.7.5-labs.
|
|
60
|
-
"@dxos/
|
|
61
|
-
"@dxos/
|
|
63
|
+
"@dxos/react-ui-theme": "0.7.5-labs.f400bbc",
|
|
64
|
+
"@dxos/storybook-utils": "0.7.5-labs.f400bbc",
|
|
65
|
+
"@dxos/react-ui": "0.7.5-labs.f400bbc"
|
|
62
66
|
},
|
|
63
67
|
"peerDependencies": {
|
|
68
|
+
"effect": "^3.12.3",
|
|
64
69
|
"react": "~18.2.0",
|
|
65
70
|
"react-dom": "~18.2.0",
|
|
66
|
-
"@dxos/react-ui": "0.7.5-labs.
|
|
67
|
-
"@dxos/react-ui-theme": "0.7.5-labs.
|
|
71
|
+
"@dxos/react-ui": "0.7.5-labs.f400bbc",
|
|
72
|
+
"@dxos/react-ui-theme": "0.7.5-labs.f400bbc"
|
|
68
73
|
},
|
|
69
74
|
"publishConfig": {
|
|
70
75
|
"access": "public"
|
package/src/KanbanPlugin.tsx
CHANGED
|
@@ -3,14 +3,15 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { createIntent, defineModule, contributes, Capabilities, Events, definePlugin } from '@dxos/app-framework';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { ClientEvents } from '@dxos/plugin-client';
|
|
7
|
+
import { SpaceCapabilities } from '@dxos/plugin-space';
|
|
8
|
+
import { defineObjectForm } from '@dxos/plugin-space/types';
|
|
8
9
|
import { KanbanType, translations as kanbanTranslations } from '@dxos/react-ui-kanban';
|
|
9
10
|
|
|
10
|
-
import { IntentResolver, ReactSurface } from './capabilities';
|
|
11
|
+
import { ArtifactDefinition, IntentResolver, ReactSurface } from './capabilities';
|
|
11
12
|
import { KANBAN_PLUGIN, meta } from './meta';
|
|
12
13
|
import translations from './translations';
|
|
13
|
-
import { KanbanAction } from './types';
|
|
14
|
+
import { CreateKanbanSchema, KanbanAction } from './types';
|
|
14
15
|
|
|
15
16
|
export const KanbanPlugin = () =>
|
|
16
17
|
definePlugin(meta, [
|
|
@@ -26,26 +27,37 @@ export const KanbanPlugin = () =>
|
|
|
26
27
|
contributes(Capabilities.Metadata, {
|
|
27
28
|
id: KanbanType.typename,
|
|
28
29
|
metadata: {
|
|
29
|
-
createObject: (props: { name?: string }, options: { space: Space }) =>
|
|
30
|
-
createIntent(KanbanAction.Create, { ...props, space: options.space }),
|
|
31
30
|
placeholder: ['kanban title placeholder', { ns: KANBAN_PLUGIN }],
|
|
32
31
|
icon: 'ph--kanban--regular',
|
|
33
32
|
},
|
|
34
33
|
}),
|
|
35
34
|
}),
|
|
36
35
|
defineModule({
|
|
37
|
-
id: `${meta.id}/module/
|
|
36
|
+
id: `${meta.id}/module/object-form`,
|
|
38
37
|
activatesOn: ClientEvents.SetupSchema,
|
|
39
|
-
activate: () =>
|
|
38
|
+
activate: () =>
|
|
39
|
+
contributes(
|
|
40
|
+
SpaceCapabilities.ObjectForm,
|
|
41
|
+
defineObjectForm({
|
|
42
|
+
objectSchema: KanbanType,
|
|
43
|
+
formSchema: CreateKanbanSchema,
|
|
44
|
+
getIntent: (props, options) => createIntent(KanbanAction.Create, { ...props, space: options.space }),
|
|
45
|
+
}),
|
|
46
|
+
),
|
|
40
47
|
}),
|
|
41
48
|
defineModule({
|
|
42
49
|
id: `${meta.id}/module/react-surface`,
|
|
43
|
-
activatesOn: Events.
|
|
50
|
+
activatesOn: Events.SetupReactSurface,
|
|
44
51
|
activate: ReactSurface,
|
|
45
52
|
}),
|
|
46
53
|
defineModule({
|
|
47
54
|
id: `${meta.id}/module/intent-resolver`,
|
|
48
|
-
activatesOn: Events.
|
|
55
|
+
activatesOn: Events.SetupIntentResolver,
|
|
49
56
|
activate: IntentResolver,
|
|
50
57
|
}),
|
|
58
|
+
defineModule({
|
|
59
|
+
id: `${meta.id}/module/artifact-definition`,
|
|
60
|
+
activatesOn: Events.SetupArtifactDefinition,
|
|
61
|
+
activate: ArtifactDefinition,
|
|
62
|
+
}),
|
|
51
63
|
]);
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { pipe } from 'effect';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, chain, contributes, createIntent, type PromiseIntentDispatcher } from '@dxos/app-framework';
|
|
8
|
+
import { defineArtifact, defineTool, ToolResult } from '@dxos/artifact';
|
|
9
|
+
import { createArtifactElement } from '@dxos/assistant';
|
|
10
|
+
import { isInstanceOf, S } from '@dxos/echo-schema';
|
|
11
|
+
import { invariant } from '@dxos/invariant';
|
|
12
|
+
import { SpaceAction } from '@dxos/plugin-space/types';
|
|
13
|
+
import { Filter, fullyQualifiedId, type Space } from '@dxos/react-client/echo';
|
|
14
|
+
import { KanbanType } from '@dxos/react-ui-kanban';
|
|
15
|
+
|
|
16
|
+
import { meta } from '../meta';
|
|
17
|
+
import { KanbanAction } from '../types';
|
|
18
|
+
|
|
19
|
+
const QualifiedId = S.String.annotations({
|
|
20
|
+
description: 'The fully qualified ID of the kanban `spaceID:objectID`',
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
declare global {
|
|
24
|
+
interface ToolContextExtensions {
|
|
25
|
+
space?: Space;
|
|
26
|
+
dispatch?: PromiseIntentDispatcher;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export default () => {
|
|
31
|
+
const definition = defineArtifact({
|
|
32
|
+
id: meta.id,
|
|
33
|
+
name: meta.name,
|
|
34
|
+
instructions: `
|
|
35
|
+
- Before adding items to a kanban board, inspect the board to see its schema
|
|
36
|
+
- When adding items, you must not include the 'id' field -- it is automatically generated
|
|
37
|
+
- BEFORE adding items, always make sure the board has been shown to the user!
|
|
38
|
+
`,
|
|
39
|
+
schema: KanbanType,
|
|
40
|
+
tools: [
|
|
41
|
+
defineTool(meta.id, {
|
|
42
|
+
name: 'create',
|
|
43
|
+
description: `
|
|
44
|
+
Create a new kanban board using an existing schema.
|
|
45
|
+
Use schema_create first to create a schema, or schema_list to choose an existing one.`,
|
|
46
|
+
caption: 'Creating kanban board...',
|
|
47
|
+
schema: S.Struct({
|
|
48
|
+
typename: S.String.annotations({
|
|
49
|
+
description: 'The fully qualified typename of the schema to use for the kanban cards.',
|
|
50
|
+
}),
|
|
51
|
+
pivotColumn: S.optional(S.String).annotations({
|
|
52
|
+
description: 'Optional field name to use as the column pivot.',
|
|
53
|
+
}),
|
|
54
|
+
}),
|
|
55
|
+
execute: async ({ typename, pivotColumn }, { extensions }) => {
|
|
56
|
+
invariant(extensions?.space, 'No space');
|
|
57
|
+
invariant(extensions?.dispatch, 'No intent dispatcher');
|
|
58
|
+
|
|
59
|
+
// Validate schema exists first
|
|
60
|
+
const schema = await extensions.space.db.schemaRegistry.query({ typename }).firstOrUndefined();
|
|
61
|
+
if (!schema) {
|
|
62
|
+
return ToolResult.Error(`Schema not found: ${typename}`);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const intent = pipe(
|
|
66
|
+
createIntent(KanbanAction.Create, {
|
|
67
|
+
space: extensions.space,
|
|
68
|
+
initialSchema: typename,
|
|
69
|
+
initialPivotColumn: pivotColumn,
|
|
70
|
+
}),
|
|
71
|
+
chain(SpaceAction.AddObject, { target: extensions.space }),
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
const { data, error } = await extensions.dispatch(intent);
|
|
75
|
+
if (!data || error) {
|
|
76
|
+
return ToolResult.Error(error?.message ?? 'Failed to create kanban board');
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return ToolResult.Success(createArtifactElement(data.id));
|
|
80
|
+
},
|
|
81
|
+
}),
|
|
82
|
+
defineTool(meta.id, {
|
|
83
|
+
name: 'list',
|
|
84
|
+
description: 'List all kanban boards in the current space.',
|
|
85
|
+
caption: 'Listing kanban boards...',
|
|
86
|
+
schema: S.Struct({}),
|
|
87
|
+
execute: async (_input, { extensions }) => {
|
|
88
|
+
invariant(extensions?.space, 'No space');
|
|
89
|
+
const space = extensions.space;
|
|
90
|
+
const { objects: boards } = await space.db.query(Filter.schema(KanbanType)).run();
|
|
91
|
+
|
|
92
|
+
const boardInfo = await Promise.all(
|
|
93
|
+
boards.map(async (board: KanbanType) => {
|
|
94
|
+
const view = await board.cardView?.load();
|
|
95
|
+
return {
|
|
96
|
+
id: fullyQualifiedId(board),
|
|
97
|
+
typename: view?.query.type,
|
|
98
|
+
};
|
|
99
|
+
}),
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
return ToolResult.Success(boardInfo);
|
|
103
|
+
},
|
|
104
|
+
}),
|
|
105
|
+
defineTool(meta.id, {
|
|
106
|
+
name: 'inspect',
|
|
107
|
+
description: 'Get details about a specific kanban board.',
|
|
108
|
+
caption: 'Inspecting kanban board...',
|
|
109
|
+
schema: S.Struct({ id: QualifiedId }),
|
|
110
|
+
execute: async ({ id }, { extensions }) => {
|
|
111
|
+
invariant(extensions?.space, 'No space');
|
|
112
|
+
const space = extensions.space;
|
|
113
|
+
const { objects: boards } = await space.db.query(Filter.schema(KanbanType)).run();
|
|
114
|
+
const board = boards.find((board: KanbanType) => fullyQualifiedId(board) === id);
|
|
115
|
+
invariant(isInstanceOf(KanbanType, board));
|
|
116
|
+
|
|
117
|
+
const view = await board.cardView?.load();
|
|
118
|
+
invariant(view);
|
|
119
|
+
|
|
120
|
+
const typename = view.query.type;
|
|
121
|
+
const schema = await space.db.schemaRegistry.query({ typename }).firstOrUndefined();
|
|
122
|
+
invariant(schema);
|
|
123
|
+
|
|
124
|
+
return ToolResult.Success({
|
|
125
|
+
schema,
|
|
126
|
+
columnField: board.columnFieldId,
|
|
127
|
+
viewFields: view.fields,
|
|
128
|
+
});
|
|
129
|
+
},
|
|
130
|
+
}),
|
|
131
|
+
],
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
return contributes(Capabilities.ArtifactDefinition, definition);
|
|
135
|
+
};
|
|
@@ -4,5 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
import { lazy } from '@dxos/app-framework';
|
|
6
6
|
|
|
7
|
+
export const ArtifactDefinition = lazy(() => import('./artifact-definition'));
|
|
7
8
|
export const IntentResolver = lazy(() => import('./intent-resolver'));
|
|
8
9
|
export const ReactSurface = lazy(() => import('./react-surface'));
|
|
@@ -14,14 +14,15 @@ export default () =>
|
|
|
14
14
|
contributes(Capabilities.IntentResolver, [
|
|
15
15
|
createResolver({
|
|
16
16
|
intent: KanbanAction.Create,
|
|
17
|
-
resolve: async ({ space }) => ({
|
|
18
|
-
data: { object: await createKanban(space) },
|
|
17
|
+
resolve: async ({ space, initialSchema, initialPivotColumn }) => ({
|
|
18
|
+
data: { object: await createKanban({ space, initialSchema, initialPivotColumn }) },
|
|
19
19
|
}),
|
|
20
20
|
}),
|
|
21
21
|
createResolver({
|
|
22
22
|
intent: KanbanAction.DeleteCardField,
|
|
23
23
|
resolve: ({ kanban, fieldId, deletionData }, undo) => {
|
|
24
24
|
invariant(kanban.cardView);
|
|
25
|
+
invariant(kanban.cardView.target?.query.type);
|
|
25
26
|
|
|
26
27
|
const schema =
|
|
27
28
|
kanban.cardView.target && getSpace(kanban)?.db.schemaRegistry.getSchema(kanban.cardView.target.query.type);
|
|
@@ -42,4 +43,23 @@ export default () =>
|
|
|
42
43
|
}
|
|
43
44
|
},
|
|
44
45
|
}),
|
|
46
|
+
createResolver({
|
|
47
|
+
intent: KanbanAction.DeleteCard,
|
|
48
|
+
resolve: ({ card }, undo) => {
|
|
49
|
+
const space = getSpace(card);
|
|
50
|
+
invariant(space);
|
|
51
|
+
|
|
52
|
+
if (!undo) {
|
|
53
|
+
space.db.remove(card);
|
|
54
|
+
return {
|
|
55
|
+
undoable: {
|
|
56
|
+
message: ['card deleted label', { ns: KANBAN_PLUGIN }],
|
|
57
|
+
data: { card },
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
} else {
|
|
61
|
+
space.db.add(card);
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
}),
|
|
45
65
|
]);
|
|
@@ -2,14 +2,19 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React from 'react';
|
|
5
|
+
import React, { useMemo } from 'react';
|
|
6
6
|
|
|
7
7
|
import { Capabilities, contributes, createSurface } from '@dxos/app-framework';
|
|
8
|
+
import { type S } from '@dxos/echo-schema';
|
|
9
|
+
import { findAnnotation } from '@dxos/effect';
|
|
10
|
+
import { type CollectionType } from '@dxos/plugin-space/types';
|
|
11
|
+
import { getSpace, isSpace, type Space } from '@dxos/react-client/echo';
|
|
12
|
+
import { type InputProps, SelectInput, useFormValues } from '@dxos/react-ui-form';
|
|
8
13
|
import { type KanbanType } from '@dxos/react-ui-kanban';
|
|
9
14
|
|
|
10
15
|
import { KanbanContainer, KanbanViewEditor } from '../components';
|
|
11
16
|
import { KANBAN_PLUGIN } from '../meta';
|
|
12
|
-
import { isKanban } from '../types';
|
|
17
|
+
import { isKanban, InitialSchemaAnnotationId, InitialPivotColumnAnnotationId } from '../types';
|
|
13
18
|
|
|
14
19
|
export default () =>
|
|
15
20
|
contributes(Capabilities.ReactSurface, [
|
|
@@ -25,4 +30,60 @@ export default () =>
|
|
|
25
30
|
filter: (data): data is { subject: KanbanType } => isKanban(data.subject),
|
|
26
31
|
component: ({ data }) => <KanbanViewEditor kanban={data.subject} />,
|
|
27
32
|
}),
|
|
33
|
+
createSurface({
|
|
34
|
+
id: `${KANBAN_PLUGIN}/create-initial-schema-form-[schema]`,
|
|
35
|
+
role: 'form-input',
|
|
36
|
+
filter: (data): data is { prop: string; schema: S.Schema<any>; target: Space | CollectionType | undefined } => {
|
|
37
|
+
const annotation = findAnnotation<boolean>((data.schema as S.Schema.All).ast, InitialSchemaAnnotationId);
|
|
38
|
+
return !!annotation;
|
|
39
|
+
},
|
|
40
|
+
component: ({ data: { target }, ...inputProps }) => {
|
|
41
|
+
const props = inputProps as any as InputProps;
|
|
42
|
+
const space = isSpace(target) ? target : getSpace(target);
|
|
43
|
+
if (!space) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
const schemata = space?.db.schemaRegistry.query().runSync();
|
|
47
|
+
|
|
48
|
+
return <SelectInput {...props} options={schemata.map((schema) => ({ value: schema.typename }))} />;
|
|
49
|
+
},
|
|
50
|
+
}),
|
|
51
|
+
createSurface({
|
|
52
|
+
id: `${KANBAN_PLUGIN}/create-initial-schema-form-[pivot-column]`,
|
|
53
|
+
role: 'form-input',
|
|
54
|
+
filter: (data): data is { prop: string; schema: S.Schema<any>; target: Space | CollectionType | undefined } => {
|
|
55
|
+
const annotation = findAnnotation<boolean>((data.schema as S.Schema.All).ast, InitialPivotColumnAnnotationId);
|
|
56
|
+
return !!annotation;
|
|
57
|
+
},
|
|
58
|
+
component: ({ data: { target }, ...inputProps }) => {
|
|
59
|
+
const props = inputProps as any as InputProps;
|
|
60
|
+
const space = isSpace(target) ? target : getSpace(target);
|
|
61
|
+
if (!space) {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
const { initialSchema } = useFormValues();
|
|
65
|
+
const [selectedSchema] = space?.db.schemaRegistry.query({ typename: initialSchema }).runSync();
|
|
66
|
+
|
|
67
|
+
const singleSelectColumns = useMemo(() => {
|
|
68
|
+
if (!selectedSchema?.jsonSchema?.properties) {
|
|
69
|
+
return [];
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const columns = Object.entries(selectedSchema.jsonSchema.properties).reduce<string[]>((acc, [key, value]) => {
|
|
73
|
+
if (typeof value === 'object' && value?.format === 'single-select') {
|
|
74
|
+
acc.push(key);
|
|
75
|
+
}
|
|
76
|
+
return acc;
|
|
77
|
+
}, []);
|
|
78
|
+
|
|
79
|
+
return columns;
|
|
80
|
+
}, [selectedSchema?.jsonSchema]);
|
|
81
|
+
|
|
82
|
+
if (!initialSchema) {
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return <SelectInput {...props} options={singleSelectColumns.map((column) => ({ value: column }))} />;
|
|
87
|
+
},
|
|
88
|
+
}),
|
|
28
89
|
]);
|