@dxos/plugin-kanban 0.8.2-main.f11618f → 0.8.2-staging.42af850
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-OSLO5B6P.mjs → artifact-definition-7AVKC5KJ.mjs} +24 -23
- package/dist/lib/browser/artifact-definition-7AVKC5KJ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-3MVG4VGQ.mjs → chunk-NJ6WHYLY.mjs} +26 -30
- package/dist/lib/browser/chunk-NJ6WHYLY.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +4 -4
- package/dist/lib/browser/{intent-resolver-OFEXRD4O.mjs → intent-resolver-2R6I36UA.mjs} +10 -9
- package/dist/lib/browser/intent-resolver-2R6I36UA.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-RJ5WMSWU.mjs → react-surface-W43CBHJ2.mjs} +174 -157
- package/dist/lib/browser/react-surface-W43CBHJ2.mjs.map +7 -0
- package/dist/lib/browser/types.mjs +1 -1
- package/dist/lib/node/{artifact-definition-ZOUZLESK.cjs → artifact-definition-GAKXWPS3.cjs} +32 -31
- package/dist/lib/node/artifact-definition-GAKXWPS3.cjs.map +7 -0
- package/dist/lib/node/{chunk-ZRCL6XVF.cjs → chunk-3BKBOGOH.cjs} +27 -31
- package/dist/lib/node/chunk-3BKBOGOH.cjs.map +7 -0
- package/dist/lib/node/index.cjs +16 -16
- package/dist/lib/node/{intent-resolver-BCCCN7LD.cjs → intent-resolver-3WEAK7UE.cjs} +17 -16
- package/dist/lib/node/intent-resolver-3WEAK7UE.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/react-surface-YEBNJKHD.cjs +344 -0
- package/dist/lib/node/react-surface-YEBNJKHD.cjs.map +7 -0
- package/dist/lib/node/types.cjs +6 -6
- package/dist/lib/node/types.cjs.map +1 -1
- package/dist/lib/node-esm/{artifact-definition-A7GJP5BI.mjs → artifact-definition-RH5KY7FP.mjs} +24 -23
- package/dist/lib/node-esm/artifact-definition-RH5KY7FP.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-ZJJYPR6C.mjs → chunk-4J76H6FE.mjs} +26 -30
- package/dist/lib/node-esm/chunk-4J76H6FE.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +4 -4
- package/dist/lib/node-esm/{intent-resolver-4LPFRDUP.mjs → intent-resolver-XHHFK6V7.mjs} +10 -9
- package/dist/lib/node-esm/intent-resolver-XHHFK6V7.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-C7CETLHO.mjs → react-surface-Q73OORPI.mjs} +174 -157
- package/dist/lib/node-esm/react-surface-Q73OORPI.mjs.map +7 -0
- package/dist/lib/node-esm/types.mjs +1 -1
- package/dist/types/src/capabilities/artifact-definition.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +1 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +2 -2
- 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.map +1 -1
- package/dist/types/src/components/KanbanContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/KanbanViewEditor.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/testing/initialize-kanban.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +2 -28
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +34 -34
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +33 -29
- package/src/capabilities/artifact-definition.ts +15 -14
- package/src/capabilities/intent-resolver.ts +3 -3
- package/src/capabilities/react-surface.tsx +10 -5
- package/src/components/KanbanContainer.stories.tsx +18 -13
- package/src/components/KanbanContainer.tsx +1 -1
- package/src/components/KanbanViewEditor.tsx +12 -8
- package/src/meta.ts +1 -2
- package/src/testing/initialize-kanban.ts +7 -7
- package/src/types.ts +25 -26
- package/dist/lib/browser/artifact-definition-OSLO5B6P.mjs.map +0 -7
- package/dist/lib/browser/chunk-3MVG4VGQ.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-OFEXRD4O.mjs.map +0 -7
- package/dist/lib/browser/react-surface-RJ5WMSWU.mjs.map +0 -7
- package/dist/lib/node/artifact-definition-ZOUZLESK.cjs.map +0 -7
- package/dist/lib/node/chunk-ZRCL6XVF.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-BCCCN7LD.cjs.map +0 -7
- package/dist/lib/node/react-surface-LQ7CQFWF.cjs +0 -327
- package/dist/lib/node/react-surface-LQ7CQFWF.cjs.map +0 -7
- package/dist/lib/node-esm/artifact-definition-A7GJP5BI.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZJJYPR6C.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-4LPFRDUP.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-C7CETLHO.mjs.map +0 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
2
|
import { KanbanType } from '@dxos/react-ui-kanban';
|
|
3
3
|
/**
|
|
4
4
|
* Kanban data model.
|
|
@@ -10,58 +10,58 @@ import { KanbanType } from '@dxos/react-ui-kanban';
|
|
|
10
10
|
*/
|
|
11
11
|
export declare const TypenameAnnotationId: unique symbol;
|
|
12
12
|
export declare const PivotColumnAnnotationId: unique symbol;
|
|
13
|
-
export declare const CreateKanbanSchema:
|
|
14
|
-
name:
|
|
15
|
-
typename:
|
|
16
|
-
initialPivotColumn:
|
|
13
|
+
export declare const CreateKanbanSchema: Schema.Struct<{
|
|
14
|
+
name: Schema.optional<typeof Schema.String>;
|
|
15
|
+
typename: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
16
|
+
initialPivotColumn: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
17
17
|
}>;
|
|
18
|
-
export type CreateKanbanType =
|
|
18
|
+
export type CreateKanbanType = Schema.Schema.Type<typeof CreateKanbanSchema>;
|
|
19
19
|
export declare namespace KanbanAction {
|
|
20
|
-
const Create_base:
|
|
21
|
-
readonly _tag:
|
|
20
|
+
const Create_base: Schema.TaggedClass<Create, "dxos.org/plugin/kanban/action/create", {
|
|
21
|
+
readonly _tag: Schema.tag<"dxos.org/plugin/kanban/action/create">;
|
|
22
22
|
} & {
|
|
23
|
-
input:
|
|
24
|
-
space:
|
|
25
|
-
}>,
|
|
26
|
-
name:
|
|
27
|
-
typename:
|
|
28
|
-
initialPivotColumn:
|
|
23
|
+
input: Schema.extend<Schema.Struct<{
|
|
24
|
+
space: Schema.Schema<import("@dxos/client-protocol").Space, import("@dxos/client-protocol").Space, never>;
|
|
25
|
+
}>, Schema.Struct<{
|
|
26
|
+
name: Schema.optional<typeof Schema.String>;
|
|
27
|
+
typename: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
28
|
+
initialPivotColumn: Schema.optional<Schema.SchemaClass<string, string, never>>;
|
|
29
29
|
}>>;
|
|
30
|
-
output:
|
|
30
|
+
output: Schema.Struct<{
|
|
31
31
|
object: typeof KanbanType;
|
|
32
32
|
}>;
|
|
33
33
|
}>;
|
|
34
34
|
export class Create extends Create_base {
|
|
35
35
|
}
|
|
36
|
-
const DeleteCardField_base:
|
|
37
|
-
readonly _tag:
|
|
36
|
+
const DeleteCardField_base: Schema.TaggedClass<DeleteCardField, "dxos.org/plugin/kanban/action/delete-card-field", {
|
|
37
|
+
readonly _tag: Schema.tag<"dxos.org/plugin/kanban/action/delete-card-field">;
|
|
38
38
|
} & {
|
|
39
|
-
input:
|
|
39
|
+
input: Schema.Struct<{
|
|
40
40
|
kanban: typeof KanbanType;
|
|
41
|
-
fieldId: typeof
|
|
42
|
-
deletionData:
|
|
43
|
-
field:
|
|
44
|
-
id: typeof
|
|
45
|
-
path:
|
|
46
|
-
visible:
|
|
47
|
-
size:
|
|
48
|
-
referencePath:
|
|
41
|
+
fieldId: typeof Schema.String;
|
|
42
|
+
deletionData: Schema.optional<Schema.Struct<{
|
|
43
|
+
field: Schema.mutable<Schema.Struct<{
|
|
44
|
+
id: typeof Schema.String;
|
|
45
|
+
path: Schema.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>;
|
|
46
|
+
visible: Schema.optional<typeof Schema.Boolean>;
|
|
47
|
+
size: Schema.optional<typeof Schema.Number>;
|
|
48
|
+
referencePath: Schema.optional<Schema.Schema<import("@dxos/effect").JsonPath, import("@dxos/effect").JsonPath, never>>;
|
|
49
49
|
}>>;
|
|
50
|
-
props: typeof
|
|
51
|
-
index: typeof
|
|
50
|
+
props: typeof Schema.Any;
|
|
51
|
+
index: typeof Schema.Number;
|
|
52
52
|
}>>;
|
|
53
53
|
}>;
|
|
54
|
-
output: typeof
|
|
54
|
+
output: typeof Schema.Void;
|
|
55
55
|
}>;
|
|
56
56
|
export class DeleteCardField extends DeleteCardField_base {
|
|
57
57
|
}
|
|
58
|
-
const DeleteCard_base:
|
|
59
|
-
readonly _tag:
|
|
58
|
+
const DeleteCard_base: Schema.TaggedClass<DeleteCard, "dxos.org/plugin/kanban/action/delete-card", {
|
|
59
|
+
readonly _tag: Schema.tag<"dxos.org/plugin/kanban/action/delete-card">;
|
|
60
60
|
} & {
|
|
61
|
-
input:
|
|
62
|
-
card: typeof
|
|
61
|
+
input: Schema.Struct<{
|
|
62
|
+
card: typeof Schema.Any;
|
|
63
63
|
}>;
|
|
64
|
-
output: typeof
|
|
64
|
+
output: typeof Schema.Void;
|
|
65
65
|
}>;
|
|
66
66
|
export class DeleteCard extends DeleteCard_base {
|
|
67
67
|
}
|
|
@@ -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":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAKnD;;;;;;;GAOG;AAGH,eAAO,MAAM,oBAAoB,eAAwD,CAAC;AAC1F,eAAO,MAAM,uBAAuB,eAA2D,CAAC;AAEhG,eAAO,MAAM,kBAAkB;;;;EAc7B,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE7E,yBAAiB,YAAY,CAAC;;;;;;;;;;;;;;;IAG5B,MAAM,OAAO,MAAO,SAAQ,WAK1B;KAAG;;;;;;;;;;;;;;;;;;;;;IAEL,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,GAAI,QAAQ,OAAO,KAAG,MAAM,IAAI,UAA4D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"5.
|
|
1
|
+
{"version":"5.8.3"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-kanban",
|
|
3
|
-
"version": "0.8.2-
|
|
3
|
+
"version": "0.8.2-staging.42af850",
|
|
4
4
|
"description": "Kanban DXOS Surface plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -33,25 +33,29 @@
|
|
|
33
33
|
"src"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@preact/
|
|
37
|
-
"@
|
|
38
|
-
"
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/plugin-
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/react-
|
|
36
|
+
"@preact-signals/safe-react": "^0.9.0",
|
|
37
|
+
"@preact/signals-core": "^1.9.0",
|
|
38
|
+
"effect": "3.14.21",
|
|
39
|
+
"@dxos/ai": "0.8.2-staging.42af850",
|
|
40
|
+
"@dxos/app-framework": "0.8.2-staging.42af850",
|
|
41
|
+
"@dxos/artifact": "0.8.2-staging.42af850",
|
|
42
|
+
"@dxos/assistant": "0.8.2-staging.42af850",
|
|
43
|
+
"@dxos/async": "0.8.2-staging.42af850",
|
|
44
|
+
"@dxos/echo": "0.8.2-staging.42af850",
|
|
45
|
+
"@dxos/echo-schema": "0.8.2-staging.42af850",
|
|
46
|
+
"@dxos/effect": "0.8.2-staging.42af850",
|
|
47
|
+
"@dxos/invariant": "0.8.2-staging.42af850",
|
|
48
|
+
"@dxos/plugin-graph": "0.8.2-staging.42af850",
|
|
49
|
+
"@dxos/plugin-client": "0.8.2-staging.42af850",
|
|
50
|
+
"@dxos/plugin-space": "0.8.2-staging.42af850",
|
|
51
|
+
"@dxos/plugin-search": "0.8.2-staging.42af850",
|
|
52
|
+
"@dxos/random": "0.8.2-staging.42af850",
|
|
53
|
+
"@dxos/react-ui-form": "0.8.2-staging.42af850",
|
|
54
|
+
"@dxos/react-client": "0.8.2-staging.42af850",
|
|
55
|
+
"@dxos/react-ui-kanban": "0.8.2-staging.42af850",
|
|
56
|
+
"@dxos/schema": "0.8.2-staging.42af850",
|
|
57
|
+
"@dxos/react-ui-stack": "0.8.2-staging.42af850",
|
|
58
|
+
"@dxos/util": "0.8.2-staging.42af850"
|
|
55
59
|
},
|
|
56
60
|
"devDependencies": {
|
|
57
61
|
"@types/react": "~18.2.0",
|
|
@@ -59,19 +63,19 @@
|
|
|
59
63
|
"react": "~18.2.0",
|
|
60
64
|
"react-dom": "~18.2.0",
|
|
61
65
|
"vite": "5.4.7",
|
|
62
|
-
"@dxos/plugin-preview": "0.8.2-
|
|
63
|
-
"@dxos/plugin-theme": "0.8.2-
|
|
64
|
-
"@dxos/react-ui": "0.8.2-
|
|
65
|
-
"@dxos/react-ui-syntax-highlighter": "0.8.2-
|
|
66
|
-
"@dxos/react-ui-theme": "0.8.2-
|
|
67
|
-
"@dxos/storybook-utils": "0.8.2-
|
|
66
|
+
"@dxos/plugin-preview": "0.8.2-staging.42af850",
|
|
67
|
+
"@dxos/plugin-theme": "0.8.2-staging.42af850",
|
|
68
|
+
"@dxos/react-ui": "0.8.2-staging.42af850",
|
|
69
|
+
"@dxos/react-ui-syntax-highlighter": "0.8.2-staging.42af850",
|
|
70
|
+
"@dxos/react-ui-theme": "0.8.2-staging.42af850",
|
|
71
|
+
"@dxos/storybook-utils": "0.8.2-staging.42af850"
|
|
68
72
|
},
|
|
69
73
|
"peerDependencies": {
|
|
70
|
-
"effect": "3.13.3",
|
|
74
|
+
"effect": "^3.13.3",
|
|
71
75
|
"react": "~18.2.0",
|
|
72
76
|
"react-dom": "~18.2.0",
|
|
73
|
-
"@dxos/react-ui": "0.8.2-
|
|
74
|
-
"@dxos/react-ui-theme": "0.8.2-
|
|
77
|
+
"@dxos/react-ui": "0.8.2-staging.42af850",
|
|
78
|
+
"@dxos/react-ui-theme": "0.8.2-staging.42af850"
|
|
75
79
|
},
|
|
76
80
|
"publishConfig": {
|
|
77
81
|
"access": "public"
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { pipe } from 'effect';
|
|
5
|
+
import { Schema, pipe } from 'effect';
|
|
6
6
|
|
|
7
|
+
import { createTool, ToolResult } from '@dxos/ai';
|
|
7
8
|
import { Capabilities, chain, contributes, createIntent, type PromiseIntentDispatcher } from '@dxos/app-framework';
|
|
8
|
-
import { defineArtifact
|
|
9
|
+
import { defineArtifact } from '@dxos/artifact';
|
|
9
10
|
import { createArtifactElement } from '@dxos/assistant';
|
|
10
|
-
import { isInstanceOf
|
|
11
|
+
import { isInstanceOf } from '@dxos/echo-schema';
|
|
11
12
|
import { invariant } from '@dxos/invariant';
|
|
12
13
|
import { SpaceAction } from '@dxos/plugin-space/types';
|
|
13
14
|
import { Filter, fullyQualifiedId, type Space } from '@dxos/react-client/echo';
|
|
@@ -16,7 +17,7 @@ import { KanbanType } from '@dxos/react-ui-kanban';
|
|
|
16
17
|
import { meta } from '../meta';
|
|
17
18
|
import { KanbanAction } from '../types';
|
|
18
19
|
|
|
19
|
-
const QualifiedId =
|
|
20
|
+
const QualifiedId = Schema.String.annotations({
|
|
20
21
|
description: 'The fully qualified ID of the kanban `spaceID:objectID`',
|
|
21
22
|
});
|
|
22
23
|
|
|
@@ -38,17 +39,17 @@ export default () => {
|
|
|
38
39
|
`,
|
|
39
40
|
schema: KanbanType,
|
|
40
41
|
tools: [
|
|
41
|
-
|
|
42
|
+
createTool(meta.id, {
|
|
42
43
|
name: 'create',
|
|
43
44
|
description: `
|
|
44
45
|
Create a new kanban board using an existing schema.
|
|
45
46
|
Use schema_create first to create a schema, or schema_list to choose an existing one.`,
|
|
46
47
|
caption: 'Creating kanban board...',
|
|
47
|
-
schema:
|
|
48
|
-
typename:
|
|
48
|
+
schema: Schema.Struct({
|
|
49
|
+
typename: Schema.String.annotations({
|
|
49
50
|
description: 'The fully qualified typename of the schema to use for the kanban cards.',
|
|
50
51
|
}),
|
|
51
|
-
pivotColumn:
|
|
52
|
+
pivotColumn: Schema.optional(Schema.String).annotations({
|
|
52
53
|
description: 'Optional field name to use as the column pivot.',
|
|
53
54
|
}),
|
|
54
55
|
}),
|
|
@@ -79,15 +80,15 @@ export default () => {
|
|
|
79
80
|
return ToolResult.Success(createArtifactElement(data.id));
|
|
80
81
|
},
|
|
81
82
|
}),
|
|
82
|
-
|
|
83
|
+
createTool(meta.id, {
|
|
83
84
|
name: 'list',
|
|
84
85
|
description: 'List all kanban boards in the current space.',
|
|
85
86
|
caption: 'Listing kanban boards...',
|
|
86
|
-
schema:
|
|
87
|
+
schema: Schema.Struct({}),
|
|
87
88
|
execute: async (_input, { extensions }) => {
|
|
88
89
|
invariant(extensions?.space, 'No space');
|
|
89
90
|
const space = extensions.space;
|
|
90
|
-
const { objects: boards } = await space.db.query(Filter.
|
|
91
|
+
const { objects: boards } = await space.db.query(Filter.type(KanbanType)).run();
|
|
91
92
|
|
|
92
93
|
const boardInfo = await Promise.all(
|
|
93
94
|
boards.map(async (board: KanbanType) => {
|
|
@@ -102,15 +103,15 @@ export default () => {
|
|
|
102
103
|
return ToolResult.Success(boardInfo);
|
|
103
104
|
},
|
|
104
105
|
}),
|
|
105
|
-
|
|
106
|
+
createTool(meta.id, {
|
|
106
107
|
name: 'inspect',
|
|
107
108
|
description: 'Get details about a specific kanban board.',
|
|
108
109
|
caption: 'Inspecting kanban board...',
|
|
109
|
-
schema:
|
|
110
|
+
schema: Schema.Struct({ id: QualifiedId }),
|
|
110
111
|
execute: async ({ id }, { extensions }) => {
|
|
111
112
|
invariant(extensions?.space, 'No space');
|
|
112
113
|
const space = extensions.space;
|
|
113
|
-
const { objects: boards } = await space.db.query(Filter.
|
|
114
|
+
const { objects: boards } = await space.db.query(Filter.type(KanbanType)).run();
|
|
114
115
|
const board = boards.find((board: KanbanType) => fullyQualifiedId(board) === id);
|
|
115
116
|
invariant(isInstanceOf(KanbanType, board));
|
|
116
117
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { contributes, Capabilities, createResolver, type
|
|
5
|
+
import { contributes, Capabilities, createResolver, type PluginContext } from '@dxos/app-framework';
|
|
6
6
|
import { invariant } from '@dxos/invariant';
|
|
7
7
|
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
8
8
|
import { getSpace } from '@dxos/react-client/echo';
|
|
@@ -12,12 +12,12 @@ import { KANBAN_PLUGIN } from '../meta';
|
|
|
12
12
|
import { initializeKanban } from '../testing';
|
|
13
13
|
import { KanbanAction } from '../types';
|
|
14
14
|
|
|
15
|
-
export default (context:
|
|
15
|
+
export default (context: PluginContext) =>
|
|
16
16
|
contributes(Capabilities.IntentResolver, [
|
|
17
17
|
createResolver({
|
|
18
18
|
intent: KanbanAction.Create,
|
|
19
19
|
resolve: async ({ space, name, typename, initialPivotColumn }) => {
|
|
20
|
-
const client = context.
|
|
20
|
+
const client = context.getCapability(ClientCapabilities.Client);
|
|
21
21
|
const { kanban } = await initializeKanban({ client, space, name, typename, initialPivotColumn });
|
|
22
22
|
return { data: { object: kanban } };
|
|
23
23
|
},
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { type Schema } from 'effect';
|
|
5
6
|
import React, { useMemo } from 'react';
|
|
6
7
|
|
|
7
8
|
import { Capabilities, contributes, createSurface, useCapabilities } from '@dxos/app-framework';
|
|
8
|
-
import { getTypenameOrThrow, toJsonSchema
|
|
9
|
+
import { getTypenameOrThrow, toJsonSchema } from '@dxos/echo-schema';
|
|
9
10
|
import { findAnnotation } from '@dxos/effect';
|
|
10
11
|
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
11
12
|
import { type CollectionType } from '@dxos/plugin-space/types';
|
|
@@ -35,12 +36,14 @@ export default () =>
|
|
|
35
36
|
createSurface({
|
|
36
37
|
id: `${KANBAN_PLUGIN}/create-initial-schema-form`,
|
|
37
38
|
role: 'form-input',
|
|
38
|
-
filter: (
|
|
39
|
+
filter: (
|
|
40
|
+
data,
|
|
41
|
+
): data is { prop: string; schema: Schema.Schema<any>; target: Space | CollectionType | undefined } => {
|
|
39
42
|
if (data.prop !== 'typename') {
|
|
40
43
|
return false;
|
|
41
44
|
}
|
|
42
45
|
|
|
43
|
-
const annotation = findAnnotation<boolean>((data.schema as
|
|
46
|
+
const annotation = findAnnotation<boolean>((data.schema as Schema.Schema.All).ast, TypenameAnnotationId);
|
|
44
47
|
return !!annotation;
|
|
45
48
|
},
|
|
46
49
|
component: ({ data: { target }, ...inputProps }) => {
|
|
@@ -74,8 +77,10 @@ export default () =>
|
|
|
74
77
|
createSurface({
|
|
75
78
|
id: `${KANBAN_PLUGIN}/create-initial-schema-form-[pivot-column]`,
|
|
76
79
|
role: 'form-input',
|
|
77
|
-
filter: (
|
|
78
|
-
|
|
80
|
+
filter: (
|
|
81
|
+
data,
|
|
82
|
+
): data is { prop: string; schema: Schema.Schema<any>; target: Space | CollectionType | undefined } => {
|
|
83
|
+
const annotation = findAnnotation<boolean>((data.schema as Schema.Schema.All).ast, PivotColumnAnnotationId);
|
|
79
84
|
return !!annotation;
|
|
80
85
|
},
|
|
81
86
|
component: ({ data: { target }, ...inputProps }) => {
|
|
@@ -8,6 +8,9 @@ import React, { useCallback, useEffect, useState } from 'react';
|
|
|
8
8
|
|
|
9
9
|
import { IntentPlugin, SettingsPlugin } from '@dxos/app-framework';
|
|
10
10
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
11
|
+
import { Type } from '@dxos/echo';
|
|
12
|
+
import { assertEchoSchema } from '@dxos/echo-schema';
|
|
13
|
+
import { invariant } from '@dxos/invariant';
|
|
11
14
|
import { ClientPlugin } from '@dxos/plugin-client';
|
|
12
15
|
import { PreviewPlugin } from '@dxos/plugin-preview';
|
|
13
16
|
import { useGlobalFilteredObjects } from '@dxos/plugin-search';
|
|
@@ -21,7 +24,7 @@ import { ViewEditor } from '@dxos/react-ui-form';
|
|
|
21
24
|
import { Kanban, KanbanType, useKanbanModel } from '@dxos/react-ui-kanban';
|
|
22
25
|
import { SyntaxHighlighter } from '@dxos/react-ui-syntax-highlighter';
|
|
23
26
|
import { defaultTx } from '@dxos/react-ui-theme';
|
|
24
|
-
import {
|
|
27
|
+
import { DataType, ViewProjection } from '@dxos/schema';
|
|
25
28
|
import { withLayout } from '@dxos/storybook-utils';
|
|
26
29
|
|
|
27
30
|
import { initializeKanban } from '../testing';
|
|
@@ -38,14 +41,14 @@ const rollOrg = () => ({
|
|
|
38
41
|
description: faker.lorem.paragraph(),
|
|
39
42
|
image: faker.image.url(),
|
|
40
43
|
website: faker.internet.url(),
|
|
41
|
-
status: faker.helpers.arrayElement(
|
|
44
|
+
status: faker.helpers.arrayElement(DataType.OrganizationStatusOptions).id,
|
|
42
45
|
});
|
|
43
46
|
|
|
44
47
|
const StorybookKanban = () => {
|
|
45
48
|
const client = useClient();
|
|
46
49
|
const spaces = useSpaces();
|
|
47
50
|
const space = spaces[spaces.length - 1];
|
|
48
|
-
const kanbans = useQuery(space, Filter.
|
|
51
|
+
const kanbans = useQuery(space, Filter.type(KanbanType));
|
|
49
52
|
const [kanban, setKanban] = useState<KanbanType>();
|
|
50
53
|
const [projection, setProjection] = useState<ViewProjection>();
|
|
51
54
|
const schema = useSchema(client, space, kanban?.cardView?.target?.query.typename);
|
|
@@ -59,12 +62,14 @@ const StorybookKanban = () => {
|
|
|
59
62
|
|
|
60
63
|
useEffect(() => {
|
|
61
64
|
if (kanban?.cardView?.target && schema) {
|
|
62
|
-
|
|
65
|
+
const jsonSchema = Type.toJsonSchema(schema);
|
|
66
|
+
setProjection(new ViewProjection(jsonSchema, kanban.cardView.target));
|
|
63
67
|
}
|
|
64
68
|
// TODO(ZaymonFC): Is there a better way to get notified about deep changes in the json schema?
|
|
65
|
-
|
|
69
|
+
// @dmaretskyi? Once resolved, update in multiple places (e.g., storybooks).
|
|
70
|
+
}, [kanban?.cardView?.target, schema, JSON.stringify(schema ? Type.toJsonSchema(schema) : {})]);
|
|
66
71
|
|
|
67
|
-
const objects = useQuery(space, schema ? Filter.
|
|
72
|
+
const objects = useQuery(space, schema ? Filter.type(schema) : Filter.nothing());
|
|
68
73
|
const filteredObjects = useGlobalFilteredObjects(objects);
|
|
69
74
|
|
|
70
75
|
const model = useKanbanModel({
|
|
@@ -94,10 +99,10 @@ const StorybookKanban = () => {
|
|
|
94
99
|
|
|
95
100
|
const handleTypenameChanged = useCallback(
|
|
96
101
|
(typename: string) => {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
102
|
+
invariant(schema);
|
|
103
|
+
invariant(kanban?.cardView?.target);
|
|
104
|
+
assertEchoSchema(schema).updateTypename(typename);
|
|
105
|
+
kanban.cardView.target.query.typename = typename;
|
|
101
106
|
},
|
|
102
107
|
[kanban?.cardView?.target, schema],
|
|
103
108
|
);
|
|
@@ -138,7 +143,7 @@ type StoryProps = {
|
|
|
138
143
|
//
|
|
139
144
|
|
|
140
145
|
const meta: Meta<StoryProps> = {
|
|
141
|
-
title: '
|
|
146
|
+
title: 'plugins/plugin-kanban/Kanban',
|
|
142
147
|
component: StorybookKanban,
|
|
143
148
|
render: () => <StorybookKanban />,
|
|
144
149
|
parameters: { translations },
|
|
@@ -148,7 +153,7 @@ const meta: Meta<StoryProps> = {
|
|
|
148
153
|
plugins: [
|
|
149
154
|
ThemePlugin({ tx: defaultTx }),
|
|
150
155
|
ClientPlugin({
|
|
151
|
-
types: [Organization,
|
|
156
|
+
types: [DataType.Organization, DataType.Person, KanbanType],
|
|
152
157
|
onClientInitialized: async (_, client) => {
|
|
153
158
|
await client.halo.createIdentity();
|
|
154
159
|
const space = await client.spaces.create();
|
|
@@ -156,7 +161,7 @@ const meta: Meta<StoryProps> = {
|
|
|
156
161
|
const { schema, kanban } = await initializeKanban({
|
|
157
162
|
space,
|
|
158
163
|
client,
|
|
159
|
-
typename: Organization.typename,
|
|
164
|
+
typename: DataType.Organization.typename,
|
|
160
165
|
initialPivotColumn: 'status',
|
|
161
166
|
});
|
|
162
167
|
space.db.add(kanban);
|
|
@@ -56,7 +56,7 @@ export const KanbanContainer = ({ kanban }: { kanban: KanbanType; role: string }
|
|
|
56
56
|
// TODO(ZaymonFC): Is there a better way to get notified about deep changes in the json schema?
|
|
57
57
|
}, [kanban.cardView?.target, JSON.stringify(jsonSchema)]);
|
|
58
58
|
|
|
59
|
-
const objects = useQuery(space, cardSchema ? Filter.
|
|
59
|
+
const objects = useQuery(space, cardSchema ? Filter.type(cardSchema) : Filter.nothing());
|
|
60
60
|
const filteredObjects = useGlobalFilteredObjects(objects);
|
|
61
61
|
|
|
62
62
|
const model = useKanbanModel({
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
import React, { useCallback, useMemo } from 'react';
|
|
6
6
|
|
|
7
7
|
import { createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
8
|
-
import {
|
|
8
|
+
import { Type } from '@dxos/echo';
|
|
9
|
+
import { assertEchoSchema, FormatEnum, isMutable } from '@dxos/echo-schema';
|
|
9
10
|
import { invariant } from '@dxos/invariant';
|
|
10
11
|
import { useClient } from '@dxos/react-client';
|
|
11
12
|
import { Filter, getSpace, useQuery, useSchema } from '@dxos/react-client/echo';
|
|
@@ -26,7 +27,7 @@ export const KanbanViewEditor = ({ kanban }: KanbanViewEditorProps) => {
|
|
|
26
27
|
[kanban?.cardView?.target?.query?.typename],
|
|
27
28
|
);
|
|
28
29
|
const schema = useSchema(client, space, currentTypename);
|
|
29
|
-
const views = useQuery(space, Filter.
|
|
30
|
+
const views = useQuery(space, Filter.type(ViewType));
|
|
30
31
|
|
|
31
32
|
const handleUpdateTypename = useCallback(
|
|
32
33
|
(newTypename: string) => {
|
|
@@ -36,7 +37,7 @@ export const KanbanViewEditor = ({ kanban }: KanbanViewEditorProps) => {
|
|
|
36
37
|
view.query.typename = newTypename;
|
|
37
38
|
}
|
|
38
39
|
|
|
39
|
-
schema.
|
|
40
|
+
assertEchoSchema(schema).updateTypename(newTypename);
|
|
40
41
|
},
|
|
41
42
|
[views, schema],
|
|
42
43
|
);
|
|
@@ -50,9 +51,10 @@ export const KanbanViewEditor = ({ kanban }: KanbanViewEditorProps) => {
|
|
|
50
51
|
|
|
51
52
|
const projection = useMemo(() => {
|
|
52
53
|
if (kanban?.cardView?.target && schema) {
|
|
53
|
-
|
|
54
|
+
const jsonSchema = Type.toJsonSchema(schema);
|
|
55
|
+
return new ViewProjection(jsonSchema, kanban.cardView.target);
|
|
54
56
|
}
|
|
55
|
-
}, [kanban?.cardView?.target, schema, JSON.stringify(schema)]);
|
|
57
|
+
}, [kanban?.cardView?.target, schema, JSON.stringify(schema ? Type.toJsonSchema(schema) : {})]);
|
|
56
58
|
|
|
57
59
|
const fieldProjections = projection?.getFieldProjections() || [];
|
|
58
60
|
const selectFields = fieldProjections
|
|
@@ -78,13 +80,15 @@ export const KanbanViewEditor = ({ kanban }: KanbanViewEditorProps) => {
|
|
|
78
80
|
|
|
79
81
|
return (
|
|
80
82
|
<>
|
|
81
|
-
<
|
|
83
|
+
<div role='none' className='p-2'>
|
|
84
|
+
<Form schema={KanbanSettingsSchema} values={initialValues} onSave={onSave} autoSave Custom={custom} />
|
|
85
|
+
</div>
|
|
82
86
|
<ViewEditor
|
|
83
87
|
registry={space.db.schemaRegistry}
|
|
84
88
|
schema={schema}
|
|
85
89
|
view={kanban.cardView.target}
|
|
86
|
-
onTypenameChanged={schema
|
|
87
|
-
onDelete={schema
|
|
90
|
+
onTypenameChanged={isMutable(schema) ? handleUpdateTypename : undefined}
|
|
91
|
+
onDelete={isMutable(schema) ? handleDelete : undefined}
|
|
88
92
|
/>
|
|
89
93
|
</>
|
|
90
94
|
);
|
package/src/meta.ts
CHANGED
|
@@ -12,7 +12,6 @@ export const meta: PluginMeta = {
|
|
|
12
12
|
description:
|
|
13
13
|
'Kanban allows you to explore Table data in sorted columns defined by your custom schema. You can use Kanbans to track progress or trigger custom automations when cards are moved from one state to another.',
|
|
14
14
|
icon: 'ph--kanban--regular',
|
|
15
|
-
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/
|
|
16
|
-
tags: ['experimental'],
|
|
15
|
+
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-kanban',
|
|
17
16
|
screenshots: ['https://dxos.network/plugin-details-kanban-dark.png'],
|
|
18
17
|
};
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { Schema } from 'effect';
|
|
6
|
+
|
|
5
7
|
import {
|
|
6
|
-
AST,
|
|
7
|
-
S,
|
|
8
8
|
TypedObject,
|
|
9
9
|
FormatEnum,
|
|
10
10
|
TypeEnum,
|
|
@@ -41,13 +41,13 @@ const createDefaultTaskSchema = () => {
|
|
|
41
41
|
typename: `example.com/type/${PublicKey.random().truncate()}`,
|
|
42
42
|
version: '0.1.0',
|
|
43
43
|
})({
|
|
44
|
-
title:
|
|
45
|
-
|
|
44
|
+
title: Schema.optional(Schema.String).annotations({
|
|
45
|
+
title: 'Title',
|
|
46
46
|
}),
|
|
47
|
-
description:
|
|
48
|
-
|
|
47
|
+
description: Schema.optional(Schema.String).annotations({
|
|
48
|
+
title: 'Description',
|
|
49
49
|
}),
|
|
50
|
-
state:
|
|
50
|
+
state: Schema.optional(Schema.String),
|
|
51
51
|
});
|
|
52
52
|
|
|
53
53
|
return { schema, stateOptions };
|