@dxos/plugin-kanban 0.7.4 → 0.7.5-labs.071a3e2
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/chunk-7PFZLUDZ.mjs +72 -0
- package/dist/lib/browser/chunk-7PFZLUDZ.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +66 -145
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/intent-resolver-4SJJSDOD.mjs +76 -0
- package/dist/lib/browser/intent-resolver-4SJJSDOD.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-surface-5WOH5E2K.mjs +240 -0
- package/dist/lib/browser/react-surface-5WOH5E2K.mjs.map +7 -0
- package/dist/lib/browser/types.mjs +11 -0
- package/dist/lib/node/chunk-IR3NCB4Y.cjs +94 -0
- package/dist/lib/node/chunk-IR3NCB4Y.cjs.map +7 -0
- package/dist/lib/node/index.cjs +62 -133
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/intent-resolver-X3NB4IA6.cjs +90 -0
- package/dist/lib/node/intent-resolver-X3NB4IA6.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/react-surface-A5TP26JG.cjs +258 -0
- package/dist/lib/node/react-surface-A5TP26JG.cjs.map +7 -0
- package/dist/lib/node/{types/index.cjs → types.cjs} +7 -10
- package/dist/lib/node/types.cjs.map +7 -0
- package/dist/lib/node-esm/chunk-LUAZTJHF.mjs +74 -0
- package/dist/lib/node-esm/chunk-LUAZTJHF.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +66 -145
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/intent-resolver-KFSXWDSV.mjs +77 -0
- package/dist/lib/node-esm/intent-resolver-KFSXWDSV.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/react-surface-W4HLVD2O.mjs +241 -0
- package/dist/lib/node-esm/react-surface-W4HLVD2O.mjs.map +7 -0
- package/dist/lib/node-esm/types.mjs +12 -0
- package/dist/types/src/KanbanPlugin.d.ts +1 -3
- package/dist/types/src/KanbanPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +3 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/intent-resolver.d.ts +4 -0
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +4 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/components/KanbanContainer.d.ts +7 -0
- package/dist/types/src/components/KanbanContainer.d.ts.map +1 -0
- package/dist/types/src/components/KanbanViewEditor.d.ts +8 -0
- package/dist/types/src/components/KanbanViewEditor.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +2 -3
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +32 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +67 -0
- package/dist/types/src/types.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/package.json +21 -31
- package/src/KanbanPlugin.tsx +41 -101
- package/src/capabilities/index.ts +8 -0
- package/src/capabilities/intent-resolver.ts +45 -0
- package/src/capabilities/react-surface.tsx +28 -0
- package/src/components/KanbanContainer.tsx +80 -0
- package/src/components/KanbanViewEditor.tsx +106 -0
- package/src/components/index.ts +3 -4
- package/src/index.ts +1 -4
- package/src/meta.ts +4 -2
- package/src/translations.ts +8 -2
- package/src/types.ts +75 -0
- package/dist/lib/browser/KanbanMain-I5TMXNIY.mjs +0 -444
- package/dist/lib/browser/KanbanMain-I5TMXNIY.mjs.map +0 -7
- package/dist/lib/browser/chunk-4Y4TZ47E.mjs +0 -47
- package/dist/lib/browser/chunk-4Y4TZ47E.mjs.map +0 -7
- package/dist/lib/browser/chunk-LG4OMN5S.mjs +0 -18
- package/dist/lib/browser/chunk-LG4OMN5S.mjs.map +0 -7
- package/dist/lib/browser/meta.mjs +0 -9
- package/dist/lib/browser/types/index.mjs +0 -14
- package/dist/lib/node/KanbanMain-4OWAWTS4.cjs +0 -453
- package/dist/lib/node/KanbanMain-4OWAWTS4.cjs.map +0 -7
- package/dist/lib/node/chunk-LTR4WYI2.cjs +0 -67
- package/dist/lib/node/chunk-LTR4WYI2.cjs.map +0 -7
- package/dist/lib/node/chunk-MBAGHRFM.cjs +0 -41
- package/dist/lib/node/chunk-MBAGHRFM.cjs.map +0 -7
- package/dist/lib/node/meta.cjs +0 -30
- package/dist/lib/node/meta.cjs.map +0 -7
- package/dist/lib/node/types/index.cjs.map +0 -7
- package/dist/lib/node-esm/KanbanMain-PJC2JMJH.mjs +0 -445
- package/dist/lib/node-esm/KanbanMain-PJC2JMJH.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2ZBX5F7L.mjs +0 -48
- package/dist/lib/node-esm/chunk-2ZBX5F7L.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OTZHYV3S.mjs +0 -20
- package/dist/lib/node-esm/chunk-OTZHYV3S.mjs.map +0 -7
- package/dist/lib/node-esm/meta.mjs +0 -10
- package/dist/lib/node-esm/meta.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -15
- package/dist/lib/node-esm/types/index.mjs.map +0 -7
- package/dist/types/src/components/KanbanBoard.d.ts +0 -6
- package/dist/types/src/components/KanbanBoard.d.ts.map +0 -1
- package/dist/types/src/components/KanbanCard.d.ts +0 -9
- package/dist/types/src/components/KanbanCard.d.ts.map +0 -1
- package/dist/types/src/components/KanbanColumn.d.ts +0 -14
- package/dist/types/src/components/KanbanColumn.d.ts.map +0 -1
- package/dist/types/src/components/KanbanMain.d.ts +0 -7
- package/dist/types/src/components/KanbanMain.d.ts.map +0 -1
- package/dist/types/src/components/util.d.ts +0 -7
- package/dist/types/src/components/util.d.ts.map +0 -1
- package/dist/types/src/stories/testing.d.ts +0 -19
- package/dist/types/src/stories/testing.d.ts.map +0 -1
- package/dist/types/src/types/index.d.ts +0 -3
- package/dist/types/src/types/index.d.ts.map +0 -1
- package/dist/types/src/types/kanban.d.ts +0 -76
- package/dist/types/src/types/kanban.d.ts.map +0 -1
- package/dist/types/src/types/types.d.ts +0 -18
- package/dist/types/src/types/types.d.ts.map +0 -1
- package/src/components/KanbanBoard.tsx +0 -195
- package/src/components/KanbanCard.tsx +0 -82
- package/src/components/KanbanColumn.tsx +0 -143
- package/src/components/KanbanMain.tsx +0 -37
- package/src/components/util.ts +0 -38
- package/src/stories/testing.ts +0 -29
- package/src/types/index.ts +0 -6
- package/src/types/kanban.ts +0 -22
- package/src/types/types.ts +0 -57
- /package/dist/lib/browser/{meta.mjs.map → types.mjs.map} +0 -0
- /package/dist/lib/{browser/types/index.mjs.map → node-esm/types.mjs.map} +0 -0
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
|
|
3
|
-
// packages/plugins/experimental/plugin-kanban/src/meta.ts
|
|
4
|
-
var KANBAN_PLUGIN = "dxos.org/plugin/kanban";
|
|
5
|
-
var meta_default = {
|
|
6
|
-
id: KANBAN_PLUGIN,
|
|
7
|
-
name: "Kanban",
|
|
8
|
-
description: "Kanban board for managing tasks.",
|
|
9
|
-
icon: "ph--kanban--regular",
|
|
10
|
-
source: "https://github.com/dxos/dxos/tree/main/packages/plugins/experimental/plugin-kanban",
|
|
11
|
-
tags: [
|
|
12
|
-
"experimental"
|
|
13
|
-
]
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export {
|
|
17
|
-
KANBAN_PLUGIN,
|
|
18
|
-
meta_default
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=chunk-OTZHYV3S.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const KANBAN_PLUGIN = 'dxos.org/plugin/kanban';\n\nexport default {\n id: KANBAN_PLUGIN,\n name: 'Kanban',\n description: 'Kanban board for managing tasks.',\n icon: 'ph--kanban--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/experimental/plugin-kanban',\n tags: ['experimental'],\n} satisfies PluginMeta;\n"],
|
|
5
|
-
"mappings": ";;;AAMO,IAAMA,gBAAgB;AAE7B,IAAA,eAAe;EACbC,IAAID;EACJE,MAAM;EACNC,aAAa;EACbC,MAAM;EACNC,QAAQ;EACRC,MAAM;IAAC;;AACT;",
|
|
6
|
-
"names": ["KANBAN_PLUGIN", "id", "name", "description", "icon", "source", "tags"]
|
|
7
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
KANBAN_PLUGIN,
|
|
4
|
-
meta_default
|
|
5
|
-
} from "./chunk-OTZHYV3S.mjs";
|
|
6
|
-
export {
|
|
7
|
-
KANBAN_PLUGIN,
|
|
8
|
-
meta_default as default
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=meta.mjs.map
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
KanbanAction,
|
|
4
|
-
KanbanColumnType,
|
|
5
|
-
KanbanItemType,
|
|
6
|
-
KanbanType
|
|
7
|
-
} from "../chunk-2ZBX5F7L.mjs";
|
|
8
|
-
import "../chunk-OTZHYV3S.mjs";
|
|
9
|
-
export {
|
|
10
|
-
KanbanAction,
|
|
11
|
-
KanbanColumnType,
|
|
12
|
-
KanbanItemType,
|
|
13
|
-
KanbanType
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"KanbanBoard.d.ts","sourceRoot":"","sources":["../../../../src/components/KanbanBoard.tsx"],"names":[],"mappings":"AAgBA,OAAc,EAAE,KAAK,EAAE,EAAuB,MAAM,OAAO,CAAC;AAQ5D,OAAO,KAAK,EAA8C,WAAW,EAAE,MAAM,UAAU,CAAC;AAKxF,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC;IAAE,KAAK,EAAE,WAAW,CAAA;CAAE,CAqKlD,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { type FC } from 'react';
|
|
2
|
-
import { type KanbanColumnType, type KanbanItemType } from '../types';
|
|
3
|
-
export declare const KanbanCardComponent: FC<{
|
|
4
|
-
column?: KanbanColumnType;
|
|
5
|
-
item: KanbanItemType;
|
|
6
|
-
debug?: boolean;
|
|
7
|
-
onDelete?: () => void;
|
|
8
|
-
}>;
|
|
9
|
-
//# sourceMappingURL=KanbanCard.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"KanbanCard.d.ts","sourceRoot":"","sources":["../../../../src/components/KanbanCard.tsx"],"names":[],"mappings":"AAOA,OAAc,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAavC,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAYtE,eAAO,MAAM,mBAAmB,EAAE,EAAE,CAAC;IACnC,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,IAAI,EAAE,cAAc,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB,CA4CA,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type FC } from 'react';
|
|
2
|
-
import { type KanbanColumnType, type KanbanItemType } from '../types';
|
|
3
|
-
export type ItemsMapper = (column: string, items: KanbanItemType[]) => KanbanItemType[];
|
|
4
|
-
export declare const KanbanColumnComponentPlaceholder: FC<{
|
|
5
|
-
onAdd: () => void;
|
|
6
|
-
}>;
|
|
7
|
-
export declare const KanbanColumnComponent: FC<{
|
|
8
|
-
column: KanbanColumnType;
|
|
9
|
-
itemMapper?: ItemsMapper;
|
|
10
|
-
debug?: boolean;
|
|
11
|
-
onCreate?: (column: KanbanColumnType) => KanbanItemType;
|
|
12
|
-
onDelete?: () => void;
|
|
13
|
-
}>;
|
|
14
|
-
//# sourceMappingURL=KanbanColumn.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"KanbanColumn.d.ts","sourceRoot":"","sources":["../../../../src/components/KanbanColumn.tsx"],"names":[],"mappings":"AAQA,OAAc,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AASvC,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAEtE,MAAM,MAAM,WAAW,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,cAAc,EAAE,CAAC;AAuBxF,eAAO,MAAM,gCAAgC,EAAE,EAAE,CAAC;IAAE,KAAK,EAAE,MAAM,IAAI,CAAA;CAAE,CAUtE,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC;IACrC,MAAM,EAAE,gBAAgB,CAAC;IACzB,UAAU,CAAC,EAAE,WAAW,CAAC;IACzB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,cAAc,CAAC;IACxD,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB,CAkFA,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"KanbanMain.d.ts","sourceRoot":"","sources":["../../../../src/components/KanbanMain.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAQvC,OAAO,EAAE,KAAK,UAAU,EAAsD,MAAM,UAAU,CAAC;AAE/F,QAAA,MAAM,UAAU,EAAE,EAAE,CAAC;IAAE,MAAM,EAAE,UAAU,CAAA;CAAE,CAoB1C,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type KanbanColumnType, type Location } from '../types';
|
|
2
|
-
export declare const useSubscription: (data: any) => void;
|
|
3
|
-
/**
|
|
4
|
-
* Find the column or item within the model.
|
|
5
|
-
*/
|
|
6
|
-
export declare const findLocation: (columns: KanbanColumnType[], id: string) => Location | undefined;
|
|
7
|
-
//# sourceMappingURL=util.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../src/components/util.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGhE,eAAO,MAAM,eAAe,SAAU,GAAG,SAOxC,CAAC;AAEF;;GAEG;AAEH,eAAO,MAAM,YAAY,YAAa,gBAAgB,EAAE,MAAM,MAAM,KAAG,QAAQ,GAAG,SAYjF,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export declare const createKanban: () => import("@dxos/live-object").ReactiveObject<{
|
|
2
|
-
name?: string | undefined;
|
|
3
|
-
columns: import("packages/core/echo/echo-schema/dist/types/src").Ref<{
|
|
4
|
-
name?: string | undefined;
|
|
5
|
-
index?: string | undefined;
|
|
6
|
-
items: import("packages/core/echo/echo-schema/dist/types/src").Ref<{
|
|
7
|
-
object?: import("packages/core/echo/echo-schema/dist/types/src").Ref<import("packages/core/echo/echo-schema/dist/types/src").Expando>;
|
|
8
|
-
name?: string | undefined;
|
|
9
|
-
index?: string | undefined;
|
|
10
|
-
} & {
|
|
11
|
-
id: string;
|
|
12
|
-
}>[];
|
|
13
|
-
} & {
|
|
14
|
-
id: string;
|
|
15
|
-
}>[];
|
|
16
|
-
} & {
|
|
17
|
-
id: string;
|
|
18
|
-
}>;
|
|
19
|
-
//# sourceMappingURL=testing.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../../src/stories/testing.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;EAkBxB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"AAIA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { Expando, ref, S } from '@dxos/echo-schema';
|
|
2
|
-
declare const KanbanItemType_base: import("@dxos/echo-schema").AbstractTypedObject<{
|
|
3
|
-
object?: import("@dxos/echo-schema").Ref<Expando>;
|
|
4
|
-
name?: string | undefined;
|
|
5
|
-
index?: string | undefined;
|
|
6
|
-
} & {
|
|
7
|
-
id: string;
|
|
8
|
-
}, S.Struct.Encoded<{
|
|
9
|
-
object: S.optional<ref<Expando>>;
|
|
10
|
-
name: S.optional<typeof S.String>;
|
|
11
|
-
index: S.optional<typeof S.String>;
|
|
12
|
-
}>>;
|
|
13
|
-
export declare class KanbanItemType extends KanbanItemType_base {
|
|
14
|
-
}
|
|
15
|
-
declare const KanbanColumnType_base: import("@dxos/echo-schema").AbstractTypedObject<{
|
|
16
|
-
name?: string | undefined;
|
|
17
|
-
index?: string | undefined;
|
|
18
|
-
items: import("@dxos/echo-schema").Ref<{
|
|
19
|
-
object?: import("@dxos/echo-schema").Ref<Expando>;
|
|
20
|
-
name?: string | undefined;
|
|
21
|
-
index?: string | undefined;
|
|
22
|
-
} & {
|
|
23
|
-
id: string;
|
|
24
|
-
}>[];
|
|
25
|
-
} & {
|
|
26
|
-
id: string;
|
|
27
|
-
}, S.Struct.Encoded<{
|
|
28
|
-
name: S.optional<typeof S.String>;
|
|
29
|
-
index: S.optional<typeof S.String>;
|
|
30
|
-
items: S.mutable<S.Array$<ref<{
|
|
31
|
-
object?: import("@dxos/echo-schema").Ref<Expando>;
|
|
32
|
-
name?: string | undefined;
|
|
33
|
-
index?: string | undefined;
|
|
34
|
-
} & {
|
|
35
|
-
id: string;
|
|
36
|
-
}>>>;
|
|
37
|
-
}>>;
|
|
38
|
-
export declare class KanbanColumnType extends KanbanColumnType_base {
|
|
39
|
-
}
|
|
40
|
-
declare const KanbanType_base: import("@dxos/echo-schema").AbstractTypedObject<{
|
|
41
|
-
name?: string | undefined;
|
|
42
|
-
columns: import("@dxos/echo-schema").Ref<{
|
|
43
|
-
name?: string | undefined;
|
|
44
|
-
index?: string | undefined;
|
|
45
|
-
items: import("@dxos/echo-schema").Ref<{
|
|
46
|
-
object?: import("@dxos/echo-schema").Ref<Expando>;
|
|
47
|
-
name?: string | undefined;
|
|
48
|
-
index?: string | undefined;
|
|
49
|
-
} & {
|
|
50
|
-
id: string;
|
|
51
|
-
}>[];
|
|
52
|
-
} & {
|
|
53
|
-
id: string;
|
|
54
|
-
}>[];
|
|
55
|
-
} & {
|
|
56
|
-
id: string;
|
|
57
|
-
}, S.Struct.Encoded<{
|
|
58
|
-
name: S.optional<typeof S.String>;
|
|
59
|
-
columns: S.mutable<S.Array$<ref<{
|
|
60
|
-
name?: string | undefined;
|
|
61
|
-
index?: string | undefined;
|
|
62
|
-
items: import("@dxos/echo-schema").Ref<{
|
|
63
|
-
object?: import("@dxos/echo-schema").Ref<Expando>;
|
|
64
|
-
name?: string | undefined;
|
|
65
|
-
index?: string | undefined;
|
|
66
|
-
} & {
|
|
67
|
-
id: string;
|
|
68
|
-
}>[];
|
|
69
|
-
} & {
|
|
70
|
-
id: string;
|
|
71
|
-
}>>>;
|
|
72
|
-
}>>;
|
|
73
|
-
export declare class KanbanType extends KanbanType_base {
|
|
74
|
-
}
|
|
75
|
-
export {};
|
|
76
|
-
//# sourceMappingURL=kanban.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"kanban.d.ts","sourceRoot":"","sources":["../../../../src/types/kanban.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,EAAe,MAAM,mBAAmB,CAAC;;;;;;;;;;;;AAEjE,qBAAa,cAAe,SAAQ,mBAIlC;CAAG;;;;;;;;;;;;;;;;;;;;;;;;AAEL,qBAAa,gBAAiB,SAAQ,qBAIpC;CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEL,qBAAa,UAAW,SAAQ,eAG9B;CAAG"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { GraphBuilderProvides, IntentResolverProvides, MetadataRecordsProvides, SurfaceProvides, TranslationsProvides } from '@dxos/app-framework';
|
|
2
|
-
import { type SchemaProvides } from '@dxos/plugin-space';
|
|
3
|
-
import { type KanbanColumnType, type KanbanItemType, type KanbanType } from './kanban';
|
|
4
|
-
export declare enum KanbanAction {
|
|
5
|
-
CREATE = "dxos.org/plugin/kanban/action/create"
|
|
6
|
-
}
|
|
7
|
-
export type KanbanPluginProvides = SurfaceProvides & IntentResolverProvides & GraphBuilderProvides & MetadataRecordsProvides & TranslationsProvides & SchemaProvides;
|
|
8
|
-
export interface KanbanModel {
|
|
9
|
-
root: KanbanType;
|
|
10
|
-
createColumn(): KanbanColumnType;
|
|
11
|
-
createItem(column: KanbanColumnType): KanbanItemType;
|
|
12
|
-
}
|
|
13
|
-
export type Location = {
|
|
14
|
-
column: KanbanColumnType;
|
|
15
|
-
item?: KanbanItemType;
|
|
16
|
-
idx?: number;
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types/types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EACtB,uBAAuB,EACvB,eAAe,EACf,oBAAoB,EACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,cAAc,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAcvF,oBAAY,YAAY;IACtB,MAAM,yCAA4B;CACnC;AAED,MAAM,MAAM,oBAAoB,GAAG,eAAe,GAChD,sBAAsB,GACtB,oBAAoB,GACpB,uBAAuB,GACvB,oBAAoB,GACpB,cAAc,CAAC;AAUjB,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,UAAU,CAAC;IACjB,YAAY,IAAI,gBAAgB,CAAC;IACjC,UAAU,CAAC,MAAM,EAAE,gBAAgB,GAAG,cAAc,CAAC;CACtD;AAED,MAAM,MAAM,QAAQ,GAAG;IACrB,MAAM,EAAE,gBAAgB,CAAC;IACzB,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC"}
|
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
DndContext,
|
|
7
|
-
type DragEndEvent,
|
|
8
|
-
type DragMoveEvent,
|
|
9
|
-
type DragOverEvent,
|
|
10
|
-
DragOverlay,
|
|
11
|
-
type DragStartEvent,
|
|
12
|
-
type Modifier,
|
|
13
|
-
MouseSensor,
|
|
14
|
-
useSensor,
|
|
15
|
-
} from '@dnd-kit/core';
|
|
16
|
-
import { horizontalListSortingStrategy, SortableContext } from '@dnd-kit/sortable';
|
|
17
|
-
import React, { type FC, useEffect, useState } from 'react';
|
|
18
|
-
|
|
19
|
-
import { createSubscription } from '@dxos/react-client/echo';
|
|
20
|
-
import { arrayMove, nonNullable } from '@dxos/util';
|
|
21
|
-
|
|
22
|
-
import { KanbanCardComponent } from './KanbanCard';
|
|
23
|
-
import { type ItemsMapper, KanbanColumnComponent, KanbanColumnComponentPlaceholder } from './KanbanColumn';
|
|
24
|
-
import { findLocation, useSubscription } from './util';
|
|
25
|
-
import type { KanbanColumnType, KanbanItemType, Location, KanbanModel } from '../types';
|
|
26
|
-
|
|
27
|
-
// TODO(burdon): Touch sensors.
|
|
28
|
-
// TODO(burdon): Prevent browser nav back when swiping left/right.
|
|
29
|
-
// TODO(burdon): Consistently use FC?
|
|
30
|
-
export const KanbanBoard: FC<{ model: KanbanModel }> = ({ model }) => {
|
|
31
|
-
const kanban = model.root;
|
|
32
|
-
// TODO(wittjosiah): Remove?
|
|
33
|
-
useSubscription(kanban.columns);
|
|
34
|
-
|
|
35
|
-
// TODO(burdon): Remove since now uses ECHO.
|
|
36
|
-
const [_, setIter] = useState([]);
|
|
37
|
-
|
|
38
|
-
useEffect(() => {
|
|
39
|
-
const handle = createSubscription(() => setIter([]));
|
|
40
|
-
handle.update([kanban.columns]);
|
|
41
|
-
return () => handle.unsubscribe();
|
|
42
|
-
}, []);
|
|
43
|
-
|
|
44
|
-
const mouseSensor = useSensor(MouseSensor, {
|
|
45
|
-
activationConstraint: {
|
|
46
|
-
distance: 8,
|
|
47
|
-
},
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
// Dragging column.
|
|
51
|
-
// TODO(burdon): Dragging column causes flickering when dragging left to first column.
|
|
52
|
-
const [draggingColumn, setDraggingColumn] = useState<KanbanColumnType | undefined>();
|
|
53
|
-
|
|
54
|
-
// Dragging item.
|
|
55
|
-
const [draggingItem, setDraggingItem] = useState<{ source: Location; target?: Location }>();
|
|
56
|
-
// While dragging, temporarily remap which items should be visible inside each column.
|
|
57
|
-
const itemMapper: ItemsMapper = (column: string, items: KanbanItemType[]) => {
|
|
58
|
-
const { source, target } = draggingItem ?? {};
|
|
59
|
-
if (source && target) {
|
|
60
|
-
if (source?.column.id !== target?.column.id && (column === source?.column.id || column === target?.column.id)) {
|
|
61
|
-
const modified = [...items];
|
|
62
|
-
if (column === source.column.id) {
|
|
63
|
-
// Temporarily remove from old column.
|
|
64
|
-
modified.splice(source.idx!, 1);
|
|
65
|
-
} else if (column === target.column.id) {
|
|
66
|
-
// Temporarily insert into new column.
|
|
67
|
-
// TODO(burdon): Use ref to track item being temporarily moved.
|
|
68
|
-
modified.splice(target.idx ?? modified.length, 0, source.item!);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return modified;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
return items;
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
const handleDragStart = ({ active }: DragStartEvent) => {
|
|
79
|
-
kanban.columns.filter(nonNullable).forEach((column) => {
|
|
80
|
-
if (column.id === active.id) {
|
|
81
|
-
setDraggingColumn(column);
|
|
82
|
-
} else {
|
|
83
|
-
const idx = column.items.filter(nonNullable).findIndex((item) => item.id === active.id);
|
|
84
|
-
if (idx !== -1) {
|
|
85
|
-
setDraggingItem({ source: { column, item: column.items![idx], idx } });
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
const handleDragMove = (event: DragMoveEvent) => {};
|
|
92
|
-
|
|
93
|
-
const handleDragOver = ({ active, over }: DragOverEvent) => {
|
|
94
|
-
if (draggingItem) {
|
|
95
|
-
const { source } = draggingItem;
|
|
96
|
-
const target = findLocation(kanban.columns.filter(nonNullable), over?.id as string);
|
|
97
|
-
if (active.id !== over?.id) {
|
|
98
|
-
setDraggingItem({ source, target });
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
// TODO(burdon): Call model to update.
|
|
104
|
-
const handleDragEnd = (event: DragEndEvent) => {
|
|
105
|
-
if (draggingColumn) {
|
|
106
|
-
const { active, over } = event;
|
|
107
|
-
const oldIndex = kanban.columns.filter(nonNullable).findIndex((column) => column.id === active.id);
|
|
108
|
-
const newIndex = kanban.columns.filter(nonNullable).findIndex((column) => column.id === over?.id);
|
|
109
|
-
arrayMove(kanban.columns, oldIndex, newIndex);
|
|
110
|
-
} else if (draggingItem) {
|
|
111
|
-
const { source, target } = draggingItem;
|
|
112
|
-
if (source.column.id === target!.column.id) {
|
|
113
|
-
if (target!.idx !== undefined) {
|
|
114
|
-
arrayMove(source.column.items!, source.idx!, target!.idx);
|
|
115
|
-
}
|
|
116
|
-
} else {
|
|
117
|
-
source.column.items!.splice(source.idx!, 1);
|
|
118
|
-
// TODO(burdon): Incorrect position when moving to new column.
|
|
119
|
-
target!.column.items!.splice(target!.idx ?? target!.column.items!.length, 0, source.item!);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
setDraggingColumn(undefined);
|
|
124
|
-
setDraggingItem(undefined);
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
const handleDragCancel = () => {
|
|
128
|
-
setDraggingColumn(undefined);
|
|
129
|
-
setDraggingItem(undefined);
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
const handleCreateColumn = () => {
|
|
133
|
-
const column = model.createColumn();
|
|
134
|
-
kanban.columns.splice(kanban.columns.length, 0, column);
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
// TODO(burdon): Move to model.
|
|
138
|
-
const handleDeleteColumn = (id: string) => {
|
|
139
|
-
const index = kanban.columns.filter(nonNullable).findIndex((column) => column.id === id);
|
|
140
|
-
if (index >= 0) {
|
|
141
|
-
kanban.columns.splice(index, 1);
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
const customModifier: Modifier = ({ transform }) => {
|
|
146
|
-
if (draggingColumn) {
|
|
147
|
-
return {
|
|
148
|
-
...transform,
|
|
149
|
-
y: 0,
|
|
150
|
-
};
|
|
151
|
-
} else {
|
|
152
|
-
return transform;
|
|
153
|
-
}
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
return (
|
|
157
|
-
<div className='flex overflow-x-scroll'>
|
|
158
|
-
<div className='flex m-4 space-x-4 snap-x'>
|
|
159
|
-
<DndContext
|
|
160
|
-
sensors={[mouseSensor]}
|
|
161
|
-
modifiers={[customModifier]}
|
|
162
|
-
onDragStart={handleDragStart}
|
|
163
|
-
onDragMove={handleDragMove}
|
|
164
|
-
onDragOver={handleDragOver}
|
|
165
|
-
onDragEnd={handleDragEnd}
|
|
166
|
-
onDragCancel={handleDragCancel}
|
|
167
|
-
>
|
|
168
|
-
<SortableContext
|
|
169
|
-
strategy={horizontalListSortingStrategy}
|
|
170
|
-
items={kanban.columns.filter(nonNullable).map(({ id }) => id!)}
|
|
171
|
-
>
|
|
172
|
-
{kanban.columns.filter(nonNullable).map((column) => (
|
|
173
|
-
<KanbanColumnComponent
|
|
174
|
-
key={column.id}
|
|
175
|
-
column={column}
|
|
176
|
-
itemMapper={itemMapper}
|
|
177
|
-
onCreate={(column: KanbanColumnType) => model.createItem(column)}
|
|
178
|
-
onDelete={() => handleDeleteColumn(column.id!)}
|
|
179
|
-
/>
|
|
180
|
-
))}
|
|
181
|
-
</SortableContext>
|
|
182
|
-
|
|
183
|
-
{/* Overlay required to drag across columns. */}
|
|
184
|
-
{draggingItem && (
|
|
185
|
-
<DragOverlay style={{ margin: 0 }}>
|
|
186
|
-
<KanbanCardComponent item={draggingItem.source.item!} onDelete={() => {}} />
|
|
187
|
-
</DragOverlay>
|
|
188
|
-
)}
|
|
189
|
-
|
|
190
|
-
{handleCreateColumn && <KanbanColumnComponentPlaceholder onAdd={handleCreateColumn} />}
|
|
191
|
-
</DndContext>
|
|
192
|
-
</div>
|
|
193
|
-
</div>
|
|
194
|
-
);
|
|
195
|
-
};
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { useSortable } from '@dnd-kit/sortable';
|
|
6
|
-
import { CSS } from '@dnd-kit/utilities';
|
|
7
|
-
import { DotsSixVertical, X } from '@phosphor-icons/react';
|
|
8
|
-
import React, { type FC } from 'react';
|
|
9
|
-
|
|
10
|
-
import { createDocAccessor } from '@dxos/react-client/echo';
|
|
11
|
-
import { Button, useThemeContext, useTranslation } from '@dxos/react-ui';
|
|
12
|
-
import {
|
|
13
|
-
createBasicExtensions,
|
|
14
|
-
createDataExtensions,
|
|
15
|
-
createThemeExtensions,
|
|
16
|
-
useTextEditor,
|
|
17
|
-
} from '@dxos/react-ui-editor';
|
|
18
|
-
import { getSize, mx, attentionSurface, focusRing } from '@dxos/react-ui-theme';
|
|
19
|
-
|
|
20
|
-
import { KANBAN_PLUGIN } from '../meta';
|
|
21
|
-
import { type KanbanColumnType, type KanbanItemType } from '../types';
|
|
22
|
-
|
|
23
|
-
const DeleteItem = ({ onClick }: { onClick: () => void }) => {
|
|
24
|
-
const { t } = useTranslation(KANBAN_PLUGIN);
|
|
25
|
-
return (
|
|
26
|
-
<Button variant='ghost' onClick={onClick} classNames='plb-0 pli-0.5 -mlb-1'>
|
|
27
|
-
<span className='sr-only'>{t('delete item label')}</span>
|
|
28
|
-
<X className={getSize(4)} />
|
|
29
|
-
</Button>
|
|
30
|
-
);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export const KanbanCardComponent: FC<{
|
|
34
|
-
column?: KanbanColumnType;
|
|
35
|
-
item: KanbanItemType;
|
|
36
|
-
debug?: boolean;
|
|
37
|
-
onDelete?: () => void;
|
|
38
|
-
}> = ({ column, item, debug = false, onDelete }) => {
|
|
39
|
-
const { themeMode } = useThemeContext();
|
|
40
|
-
const { t } = useTranslation(KANBAN_PLUGIN);
|
|
41
|
-
const { isDragging, attributes, listeners, transform, transition, setNodeRef } = useSortable({
|
|
42
|
-
id: item.id,
|
|
43
|
-
data: { type: 'item', column },
|
|
44
|
-
});
|
|
45
|
-
const tx = transform ? Object.assign(transform, { scaleY: 1 }) : null;
|
|
46
|
-
|
|
47
|
-
const { parentRef, focusAttributes } = useTextEditor(
|
|
48
|
-
() => ({
|
|
49
|
-
initialValue: item.name,
|
|
50
|
-
extensions: [
|
|
51
|
-
createDataExtensions({ id: item.id, text: createDocAccessor(item, ['name']) }),
|
|
52
|
-
createBasicExtensions({ placeholder: t('item title placeholder') }),
|
|
53
|
-
createThemeExtensions({ themeMode }),
|
|
54
|
-
],
|
|
55
|
-
}),
|
|
56
|
-
[item, themeMode],
|
|
57
|
-
);
|
|
58
|
-
|
|
59
|
-
return (
|
|
60
|
-
<div
|
|
61
|
-
ref={setNodeRef}
|
|
62
|
-
style={{ transform: CSS.Transform.toString(tx), transition }}
|
|
63
|
-
className={mx('flex grow', isDragging && 'border border-neutral-400 dark:border-neutral-800')}
|
|
64
|
-
>
|
|
65
|
-
<div className={mx('flex items-start grow p-1', attentionSurface, isDragging && 'opacity-10')}>
|
|
66
|
-
{/* TODO(burdon): Standardize height (and below); e.g., via toolbar. */}
|
|
67
|
-
<button className='flex h-[40px] items-center' {...attributes} {...listeners}>
|
|
68
|
-
<DotsSixVertical className={getSize(5)} />
|
|
69
|
-
</button>
|
|
70
|
-
<div className='flex flex-col grow pt-1'>
|
|
71
|
-
<div {...focusAttributes} className={mx(focusRing, 'rounded-sm p-1')} ref={parentRef} />
|
|
72
|
-
{debug && <div className='text-xs text-red-800'>{item.id.slice(0, 9)}</div>}
|
|
73
|
-
</div>
|
|
74
|
-
{onDelete && (
|
|
75
|
-
<div className='flex h-[40px] items-center'>
|
|
76
|
-
<DeleteItem onClick={onDelete} />
|
|
77
|
-
</div>
|
|
78
|
-
)}
|
|
79
|
-
</div>
|
|
80
|
-
</div>
|
|
81
|
-
);
|
|
82
|
-
};
|