@dxos/plugin-kanban 0.9.1-main.c7dcc2e112 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/PLUGIN.mdl +3 -3
- package/dist/lib/neutral/{KanbanArticle-T4CPKAZH.mjs → KanbanArticle-JQMQQHRB.mjs} +1 -1
- package/dist/lib/neutral/{KanbanArticle-T4CPKAZH.mjs.map → KanbanArticle-JQMQQHRB.mjs.map} +2 -2
- package/dist/lib/neutral/KanbanPlugin.mjs +4 -4
- package/dist/lib/neutral/KanbanPlugin.mjs.map +3 -3
- package/dist/lib/neutral/KanbanPlugin.node.mjs +3 -3
- package/dist/lib/neutral/KanbanPlugin.node.mjs.map +3 -3
- package/dist/lib/neutral/{KanbanSettings-FTIIR6PR.mjs → KanbanProperties-W7MZNZVJ.mjs} +4 -4
- package/dist/lib/neutral/KanbanProperties-W7MZNZVJ.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +4 -4
- package/dist/lib/neutral/capabilities/index.mjs.map +3 -3
- package/dist/lib/neutral/{chunk-Y2G24ZGD.mjs → chunk-7TVVF45P.mjs} +6 -5
- package/dist/lib/neutral/chunk-7TVVF45P.mjs.map +7 -0
- package/dist/lib/neutral/chunk-7YLGUKDJ.mjs +8 -0
- package/dist/lib/neutral/chunk-CFPH5R6P.mjs +26 -0
- package/dist/lib/neutral/chunk-CFPH5R6P.mjs.map +7 -0
- package/dist/lib/neutral/{chunk-2IGEE5J5.mjs → chunk-V4AVOJVU.mjs} +2 -2
- package/dist/lib/neutral/{chunk-2IGEE5J5.mjs.map → chunk-V4AVOJVU.mjs.map} +1 -1
- package/dist/lib/neutral/containers/index.mjs +3 -3
- package/dist/lib/neutral/containers/index.mjs.map +3 -3
- package/dist/lib/neutral/{create-object-DKBSI46K.mjs → create-object-DIIFRS57.mjs} +14 -9
- package/dist/lib/neutral/create-object-DIIFRS57.mjs.map +7 -0
- package/dist/lib/neutral/{delete-card-NMULYEXS.mjs → delete-card-TK2G6YHX.mjs} +2 -2
- package/dist/lib/neutral/{delete-card-field-NGYNI6GL.mjs → delete-card-field-LGWPBOUW.mjs} +2 -2
- package/dist/lib/neutral/index.mjs +6 -6
- package/dist/lib/neutral/meta.json +1 -1
- package/dist/lib/neutral/meta.mjs +1 -1
- package/dist/lib/neutral/operations/index.mjs +1 -1
- package/dist/lib/neutral/plugin.mjs +2 -2
- package/dist/lib/neutral/{react-surface-5Y6IHGKR.mjs → react-surface-FQGXRR3X.mjs} +5 -4
- package/dist/lib/neutral/react-surface-FQGXRR3X.mjs.map +7 -0
- package/dist/lib/neutral/{restore-card-JQ5N7G6G.mjs → restore-card-3O6PVN7J.mjs} +2 -2
- package/dist/lib/neutral/{restore-card-field-4SU6IR4V.mjs → restore-card-field-5G4DVYYY.mjs} +2 -2
- package/dist/lib/neutral/skill-definition-YGTCKXGP.mjs +15 -0
- package/dist/lib/neutral/skill-definition-YGTCKXGP.mjs.map +7 -0
- package/dist/lib/neutral/skills/index.mjs +8 -0
- package/dist/lib/neutral/types/index.mjs +1 -1
- package/dist/types/src/capabilities/artifact-definition.d.ts +1 -1
- package/dist/types/src/capabilities/create-object.d.ts +1 -7
- package/dist/types/src/capabilities/create-object.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/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/skill-definition.d.ts +5 -0
- package/dist/types/src/capabilities/skill-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/undo-mappings.d.ts +2 -2
- package/dist/types/src/capabilities/undo-mappings.d.ts.map +1 -1
- package/dist/types/src/containers/KanbanArticle/KanbanArticle.d.ts.map +1 -1
- package/dist/types/src/containers/{KanbanSettings/KanbanSettings.d.ts → KanbanProperties/KanbanProperties.d.ts} +4 -4
- package/dist/types/src/containers/KanbanProperties/KanbanProperties.d.ts.map +1 -0
- package/dist/types/src/containers/KanbanProperties/index.d.ts +2 -0
- package/dist/types/src/containers/KanbanProperties/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +1 -1
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +4 -0
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/skills/index.d.ts +2 -0
- package/dist/types/src/skills/index.d.ts.map +1 -0
- package/dist/types/src/skills/kanban-skill.d.ts +4 -0
- package/dist/types/src/skills/kanban-skill.d.ts.map +1 -0
- package/dist/types/src/types/Kanban.d.ts +3 -6
- package/dist/types/src/types/Kanban.d.ts.map +1 -1
- package/dist/types/src/types/KanbanOperation.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dx.config.ts +1 -1
- package/package.json +47 -47
- package/src/KanbanPlugin.node.ts +2 -2
- package/src/KanbanPlugin.test.ts +2 -2
- package/src/KanbanPlugin.tsx +2 -2
- package/src/capabilities/create-object.ts +9 -7
- package/src/capabilities/index.ts +1 -1
- package/src/capabilities/react-surface.tsx +4 -3
- package/src/capabilities/skill-definition.ts +14 -0
- package/src/containers/KanbanArticle/KanbanArticle.stories.tsx +1 -1
- package/src/containers/KanbanArticle/KanbanArticle.tsx +1 -1
- package/src/containers/{KanbanSettings/KanbanSettings.tsx → KanbanProperties/KanbanProperties.tsx} +3 -3
- package/src/containers/KanbanProperties/index.ts +5 -0
- package/src/containers/index.ts +1 -1
- package/src/hooks/useKanbanBoardModel.browser.test.ts +20 -18
- package/src/index.ts +1 -1
- package/src/skills/index.ts +5 -0
- package/src/{blueprints/kanban-blueprint.ts → skills/kanban-skill.ts} +8 -8
- package/src/types/Kanban.ts +13 -17
- package/src/types/KanbanOperation.ts +1 -1
- package/src/types/schema.ts +1 -1
- package/dist/lib/neutral/KanbanSettings-FTIIR6PR.mjs.map +0 -7
- package/dist/lib/neutral/blueprint-definition-6DV3Q5MC.mjs +0 -15
- package/dist/lib/neutral/blueprint-definition-6DV3Q5MC.mjs.map +0 -7
- package/dist/lib/neutral/blueprints/index.mjs +0 -8
- package/dist/lib/neutral/chunk-NDJNHR4K.mjs +0 -8
- package/dist/lib/neutral/chunk-Y2G24ZGD.mjs.map +0 -7
- package/dist/lib/neutral/chunk-ZTQW5KQS.mjs +0 -26
- package/dist/lib/neutral/chunk-ZTQW5KQS.mjs.map +0 -7
- package/dist/lib/neutral/create-object-DKBSI46K.mjs.map +0 -7
- package/dist/lib/neutral/react-surface-5Y6IHGKR.mjs.map +0 -7
- package/dist/types/src/blueprints/index.d.ts +0 -2
- package/dist/types/src/blueprints/index.d.ts.map +0 -1
- package/dist/types/src/blueprints/kanban-blueprint.d.ts +0 -4
- package/dist/types/src/blueprints/kanban-blueprint.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +0 -6
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +0 -1
- package/dist/types/src/containers/KanbanSettings/KanbanSettings.d.ts.map +0 -1
- package/dist/types/src/containers/KanbanSettings/index.d.ts +0 -2
- package/dist/types/src/containers/KanbanSettings/index.d.ts.map +0 -1
- package/src/blueprints/index.ts +0 -5
- package/src/capabilities/blueprint-definition.ts +0 -19
- package/src/containers/KanbanSettings/index.ts +0 -5
- /package/dist/lib/neutral/{chunk-NDJNHR4K.mjs.map → chunk-7YLGUKDJ.mjs.map} +0 -0
- /package/dist/lib/neutral/{delete-card-NMULYEXS.mjs.map → delete-card-TK2G6YHX.mjs.map} +0 -0
- /package/dist/lib/neutral/{delete-card-field-NGYNI6GL.mjs.map → delete-card-field-LGWPBOUW.mjs.map} +0 -0
- /package/dist/lib/neutral/{restore-card-JQ5N7G6G.mjs.map → restore-card-3O6PVN7J.mjs.map} +0 -0
- /package/dist/lib/neutral/{restore-card-field-4SU6IR4V.mjs.map → restore-card-field-5G4DVYYY.mjs.map} +0 -0
- /package/dist/lib/neutral/{blueprints → skills}/index.mjs.map +0 -0
package/PLUGIN.mdl
CHANGED
|
@@ -256,11 +256,11 @@ feat F-6: ECHO Persistence and Collaboration
|
|
|
256
256
|
```
|
|
257
257
|
|
|
258
258
|
```mdl
|
|
259
|
-
feat F-7: AI
|
|
259
|
+
feat F-7: AI Skill
|
|
260
260
|
|
|
261
|
-
req F-7.1: Plugin contributes a Kanban
|
|
261
|
+
req F-7.1: Plugin contributes a Kanban skill that lets an AI agent create and update kanban boards.
|
|
262
262
|
req F-7.2:
|
|
263
|
-
when: an AI agent calls the
|
|
263
|
+
when: an AI agent calls the skill
|
|
264
264
|
then: agent can create boards, place cards in columns, and update card fields
|
|
265
265
|
```
|
|
266
266
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/containers/KanbanArticle/KanbanArticle.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Atom, RegistryContext } from '@effect-atom/atom-react';\nimport React, { useCallback, useContext, useMemo } from 'react';\n\nimport { useCapabilities, useOperationInvoker } from '@dxos/app-framework/ui';\nimport { AppCapabilities } from '@dxos/app-toolkit';\nimport {
|
|
5
|
-
"mappings": ";;;AAIA,SAASA,MAAMC,uBAAuB;AACtC,OAAOC,SAASC,aAAaC,YAAYC,eAAe;AAExD,SAASC,iBAAiBC,2BAA2B;AACrD,SAASC,uBAAuB;AAChC,
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Atom, RegistryContext } from '@effect-atom/atom-react';\nimport React, { useCallback, useContext, useMemo } from 'react';\n\nimport { useCapabilities, useOperationInvoker } from '@dxos/app-framework/ui';\nimport { AppCapabilities } from '@dxos/app-toolkit';\nimport { type AppSurface, useSchemaFilter } from '@dxos/app-toolkit/ui';\nimport { Filter, Obj, Query, type Ref, Type } from '@dxos/echo';\nimport { useObject, useType } from '@dxos/react-client/echo';\nimport { Panel, Toolbar } from '@dxos/react-ui';\nimport { getTagFromQuery, getTypeURIFromQuery } from '@dxos/schema';\n\nimport { KanbanBoard } from '#components';\nimport { useEchoChangeCallback, useItemsProjection, useProjectionModel } from '#hooks';\nimport { KanbanOperation } from '#types';\nimport { Kanban } from '#types';\n\nexport type KanbanArticleProps = AppSurface.ObjectArticleProps<Kanban.Kanban>;\n\nexport const KanbanArticle = (props: KanbanArticleProps) => {\n // Branch on `kanban.spec.kind`: view-variant runs a typename query through\n // `useProjectionModel`; items-variant dereferences `kanban.spec.items` and\n // uses a stub projection from `useItemsProjection`.\n return Kanban.isKanbanItems(props.subject) ? (\n <ItemsKanbanArticle {...props} subject={props.subject} />\n ) : (\n <ViewKanbanArticle {...props} />\n );\n};\n\nconst ViewKanbanArticle = ({ role, subject: object }: KanbanArticleProps) => {\n const registry = useContext(RegistryContext);\n const schemas = useCapabilities(AppCapabilities.Schema);\n const db = Obj.getDatabase(object);\n const { invokePromise } = useOperationInvoker();\n const [view] = useObject(object.spec.kind === 'view' ? object.spec.view : undefined);\n const typeUri = view?.query ? getTypeURIFromQuery(view.query.ast) : undefined;\n const tag = view?.query ? getTagFromQuery(view.query.ast) : undefined;\n\n const schemaFromDb = useType(db, typeUri);\n const cardSchema = useMemo(\n () => schemaFromDb ?? schemas.flat().find((schema) => Type.getURI(schema) === typeUri),\n [schemaFromDb, schemas, typeUri],\n );\n\n const baseFilter = useSchemaFilter(cardSchema);\n const items = useMemo(() => {\n if (!db) {\n return null;\n }\n const query = tag ? Query.select(baseFilter).select(Filter.tag(tag)) : Query.select(baseFilter);\n return db.query(query).atom;\n }, [db, baseFilter, tag]);\n\n const projection = useProjectionModel(cardSchema, object, registry);\n const change = useEchoChangeCallback(object);\n\n const pivotFieldId = view?.projection?.pivotFieldId;\n const columnFieldPath =\n projection && pivotFieldId ? projection.tryGetFieldProjection(pivotFieldId)?.props.property : undefined;\n\n const handleCardAdd = useCallback(\n (columnValue: string | undefined) => {\n if (db && cardSchema && columnFieldPath) {\n const card = Obj.make(Type.assertObject(cardSchema), {\n [columnFieldPath]: columnValue,\n });\n db.add(card);\n return card.id;\n }\n },\n [db, cardSchema, columnFieldPath],\n );\n\n const handleCardRemove = useCallback(\n (card: { id: string }) => {\n void invokePromise(KanbanOperation.DeleteCard, { card });\n },\n [invokePromise],\n );\n\n if (!object || !db || !items || !projection || !change) {\n return null;\n }\n\n return (\n <Panel.Root role={role}>\n <Panel.Toolbar asChild>\n <Toolbar.Root />\n </Panel.Toolbar>\n <KanbanBoard.Root\n kanban={object}\n projection={projection}\n items={items}\n change={change}\n onCardAdd={handleCardAdd}\n onCardRemove={handleCardRemove}\n >\n <Panel.Content asChild>\n <KanbanBoard.Content />\n </Panel.Content>\n </KanbanBoard.Root>\n </Panel.Root>\n );\n};\n\ntype ItemsKanbanArticleProps = Omit<KanbanArticleProps, 'subject'> & { subject: Kanban.KanbanItems };\n\nconst ItemsKanbanArticle = ({ role, subject: object }: ItemsKanbanArticleProps) => {\n const db = Obj.getDatabase(object);\n const projection = useItemsProjection(object);\n const change = useEchoChangeCallback(object);\n\n // TODO(wittjosiah): pass refs (not loaded objects) through to the kanban\n // board and let `KanbanCard` subscribe to its own ref via `useObject`.\n // Today this atom subscribes to *every* item — any one changing causes the\n // container (and the model's per-column atoms) to recompute. With cards\n // subscribing themselves, the container only needs the refs and the\n // per-card render is independent. Requires:\n // - `KanbanCard` to accept `Ref<Obj.Unknown>` as `data` and call\n // `useObject(ref)` internally.\n // - The model to handle a ref-bearing item shape (id from\n // `ref.dxn.asEchoDXN()?.echoUri`) and use arrangement-only ordering\n // for items-variant (no pivot-value fallback, since refs don't expose\n // the pivot field without loading).\n // - `Mosaic.isItem` to accept the ref wrapper alongside `Obj.isObject`.\n const itemsAtom = useMemo(\n () =>\n Atom.make((get) => {\n const out: Obj.Unknown[] = [];\n for (const ref of object.spec.items as ReadonlyArray<Ref.Ref<Obj.Unknown>>) {\n const target = get(Obj.atom(ref));\n if (target == null) {\n continue;\n }\n // Drop soft-deleted cards (e.g. Trello-closed cards). The ref\n // stays in `spec.items` so arrangement is preserved, but the card\n // shouldn't render.\n if (Obj.isDeleted(target)) {\n continue;\n }\n out.push(target as unknown as Obj.Unknown);\n }\n return out;\n }),\n [object.spec.items],\n );\n\n const handleCardRemove = useCallback(() => undefined, []);\n\n if (!object || !db || !change) {\n return null;\n }\n\n // TODO(wittjosiah): wire `onCardAdd` to the create-object flow so\n // users can add items directly from the kanban (currently the column's\n // \"+\" button is hidden because `onCardAdd` is undefined).\n return (\n <Panel.Root role={role}>\n <Panel.Toolbar asChild>\n <Toolbar.Root />\n </Panel.Toolbar>\n <KanbanBoard.Root\n kanban={object}\n projection={projection}\n items={itemsAtom}\n change={change}\n onCardRemove={handleCardRemove}\n >\n <Panel.Content asChild>\n <KanbanBoard.Content />\n </Panel.Content>\n </KanbanBoard.Root>\n </Panel.Root>\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;AAIA,SAASA,MAAMC,uBAAuB;AACtC,OAAOC,SAASC,aAAaC,YAAYC,eAAe;AAExD,SAASC,iBAAiBC,2BAA2B;AACrD,SAASC,uBAAuB;AAChC,SAA0BC,uBAAuB;AACjD,SAASC,QAAQC,KAAKC,OAAiBC,YAAY;AACnD,SAASC,WAAWC,eAAe;AACnC,SAASC,OAAOC,eAAe;AAC/B,SAASC,iBAAiBC,2BAA2B;AAErD,SAASC,mBAAmB;AAC5B,SAASC,uBAAuBC,oBAAoBC,0BAA0B;AAC9E,SAASC,uBAAuB;AAChC,SAASC,cAAc;AAIhB,IAAMC,gBAAgB,CAACC,UAAAA;AAI5B,SAAOF,OAAOG,cAAcD,MAAME,OAAO,IACvC,sBAAA,cAACC,oBAAAA;IAAoB,GAAGH;IAAOE,SAASF,MAAME;OAE9C,sBAAA,cAACE,mBAAsBJ,KAAAA;AAE3B;AAEA,IAAMI,oBAAoB,CAAC,EAAEC,MAAMH,SAASI,OAAM,MAAsB;AACtE,QAAMC,WAAW9B,WAA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AAAA,GAAS;AACzB;MACF;AACAF,UAAII,KAAKF,MAAAA;IACX;AACA,WAAOF;EACT,CAAA,GACF;IAAChD,OAAOQ,KAAKc;GAAM;AAGrB,QAAMgB,mBAAmBpE,YAAY,MAAMwC,QAAW,CAAA,CAAE;AAExD,MAAI,CAACV,UAAU,CAACI,MAAM,CAACsB,QAAQ;AAC7B,WAAO;EACT;AAKA,SACE,sBAAA,cAAC3C,MAAMyD,MAAI;IAACzC;KACV,sBAAA,cAAChB,MAAMC,SAAO;IAACyD,SAAAA;KACb,sBAAA,cAACzD,QAAQwD,MAAI,IAAA,CAAA,GAEf,sBAAA,cAACrD,YAAYqD,MAAI;IACfE,QAAQ1C;IACRyB;IACAH,OAAOwB;IACPpB;IACAkB,cAAcN;KAEd,sBAAA,cAACvD,MAAM8D,SAAO;IAACJ,SAAAA;KACb,sBAAA,cAACtD,YAAY0D,SAAO,IAAA,CAAA,CAAA,CAAA;AAK9B;",
|
|
6
6
|
"names": ["Atom", "RegistryContext", "React", "useCallback", "useContext", "useMemo", "useCapabilities", "useOperationInvoker", "AppCapabilities", "useSchemaFilter", "Filter", "Obj", "Query", "Type", "useObject", "useType", "Panel", "Toolbar", "getTagFromQuery", "getTypeURIFromQuery", "KanbanBoard", "useEchoChangeCallback", "useItemsProjection", "useProjectionModel", "KanbanOperation", "Kanban", "KanbanArticle", "props", "isKanbanItems", "subject", "ItemsKanbanArticle", "ViewKanbanArticle", "role", "object", "registry", "schemas", "Schema", "db", "getDatabase", "invokePromise", "view", "spec", "kind", "undefined", "typeUri", "query", "ast", "tag", "schemaFromDb", "cardSchema", "flat", "find", "schema", "getURI", "baseFilter", "items", "select", "atom", "projection", "change", "pivotFieldId", "columnFieldPath", "tryGetFieldProjection", "property", "handleCardAdd", "columnValue", "card", "make", "assertObject", "add", "id", "handleCardRemove", "DeleteCard", "Root", "asChild", "kanban", "onCardAdd", "onCardRemove", "Content", "itemsAtom", "get", "out", "ref", "target", "isDeleted", "push"]
|
|
7
7
|
}
|
|
@@ -3,17 +3,17 @@ import "./chunk-J5LGTIGS.mjs";
|
|
|
3
3
|
// src/KanbanPlugin.tsx
|
|
4
4
|
import { Plugin } from "@dxos/app-framework";
|
|
5
5
|
import { AppPlugin } from "@dxos/app-toolkit";
|
|
6
|
-
import {
|
|
6
|
+
import { CreateObject, OperationHandler, ReactSurface, SkillDefinition, UndoMappings } from "#capabilities";
|
|
7
7
|
import { meta } from "#meta";
|
|
8
8
|
import { translations } from "#translations";
|
|
9
9
|
import { Kanban } from "#types";
|
|
10
10
|
|
|
11
11
|
// raw-loader:/__w/dxos/dxos/packages/plugins/plugin-kanban/PLUGIN.mdl
|
|
12
|
-
var PLUGIN_default = '---\nid: org.dxos.plugin.kanban\nname: KanbanPlugin\nversion: 0.1.0\n---\n\nVisual project management plugin for `DXOS` Composer \u2014 organise any ECHO type into drag-and-drop columns driven by a single-select field, with full local-first persistence and real-time peer replication.\n\n## Extensions\n\nThe following extension dialects are used in this document.\nEach extension is defined in the Appendix or resolved via its URI.\n\n| Term | URI |\n|-------------|--------------------------------|\n| `type` | `org.dxos.mdl.type@1.0` |\n| `feat` | `org.dxos.mdl.feat@1.0` |\n| `test` | `org.dxos.mdl.test@1.0` |\n| `component` | `org.dxos.mdl.component@1.0` |\n| `op` | `org.dxos.mdl.op@1.0` |\n\n## Types\n\n```mdl\ntype ArrangementColumnEntry\n fields:\n ids: string[] # ordered card ids within the column\n hidden?: boolean # when true the column is hidden from the board\n```\n\n```mdl\ntype Arrangement\n fields:\n order: string[] # ordered column values\n columns: Map<string, ArrangementColumnEntry>\n```\n\n```mdl\ntype KanbanViewSpec\n fields:\n kind: "view" # discriminator \u2014 items sourced from a View query\n view: Ref<View> # the View whose query drives card membership\n```\n\n```mdl\ntype KanbanItemsSpec\n fields:\n kind: "items" # discriminator \u2014 kanban owns items explicitly\n pivotField: string # property path that drives column membership\n items: Ref<object>[] # items owned directly by the kanban\n```\n\n```mdl\ntype KanbanSpec\n desc: Discriminated union of item-source strategies.\n literals: KanbanViewSpec | KanbanItemsSpec\n```\n\n```mdl\ntype Kanban\n desc: Root ECHO object for a kanban board. Stored with typename org.dxos.type.kanban v0.2.0.\n fields:\n name?: string\n arrangement: Arrangement\n spec: KanbanSpec # discriminated by spec.kind\n```\n\n```mdl\ntype KanbanSettings\n fields:\n hideUncategorized?: boolean # hides items with no pivot value\n```\n\n```mdl\ntype KanbanViewSettings\n fields:\n columnFieldId: string # id of the View field used as pivot column\n hideUncategorized?: boolean\n```\n\n```mdl\ntype CreateKanbanInput\n fields:\n name?: string\n typename?: string # ECHO typename of card objects\n initialPivotColumn?: string # initial single-select field to pivot on\n```\n\n## Components\n\n```mdl\ncomponent KanbanArticle\n desc: Main article surface for a Kanban. Branches internally on spec.kind \u2014 view-variant runs a typename query via the linked View; items-variant dereferences spec.items directly.\n props:\n subject: Kanban\n role: "article" | "section"\n state:\n projection: ProjectionModel # column/field projection derived from View + schema\n items: AtomQuery # reactive card query (view-variant) or array (items-variant)\n actions:\n addCard(columnValue: string) \u2192 string # returns new card id\n removeCard(card: object)\n moveCard(card: object, toColumn: string, toIndex: number)\n deleteCardField(fieldId: string)\n layout: |\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 [toolbar slot] \u2502\n \u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n \u2502 Col A \u2502 Col B \u2502 Col C \u2502\n \u2502 \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u2502 \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u2502 \u2026 \u2502\n \u2502 \u2502 card \u2502 \u2502 \u2502 card \u2502 \u2502 \u2502\n \u2502 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2502 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2502 \u2502\n \u2502 [+ Add card]\u2502 \u2502 \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n```mdl\ncomponent KanbanSettings\n desc: Properties panel for a Kanban. View-variant shows a column-field picker plus common settings; items-variant shows only common settings.\n props:\n subject: Kanban\n state:\n selectFields: { value: string; label: string }[] # single-select fields available as pivot\n actions:\n changeColumnField(fieldId: string)\n toggleHideUncategorized(hidden: boolean)\n```\n\n## Operations\n\n```mdl\nop deleteCard\n desc: Removes a card object from the ECHO database.\n input:\n card: object # the card to remove\n output: DeleteCardOutput # { card } snapshot of the removed card\n effects: [echo:write]\n```\n\n```mdl\nop deleteCardField\n desc: Removes a field projection from the View\'s schema; returns enough data to undo.\n input:\n view: View\n fieldId: string\n output: DeleteCardFieldOutput # { field, props, index }\n effects: [echo:write]\n requires: [AtomRegistry, Database]\n```\n\n```mdl\nop restoreCard\n desc: Undo counterpart to deleteCard \u2014 re-adds a previously removed card to the database.\n input:\n card: object # the card snapshot to restore\n output: void\n effects: [echo:write]\n```\n\n```mdl\nop restoreCardField\n desc: Undo counterpart to deleteCardField \u2014 re-inserts a field projection at its original index.\n input:\n view: View\n field: FieldSchema\n props: object # field properties\n index: number # position to restore at\n output: void\n effects: [echo:write]\n requires: [AtomRegistry, Database]\n```\n\n## Features\n\n```mdl\nfeat F-1: Board Layout\n\n req F-1.1: Columns are ordered by Arrangement.order; each column contains its cards in Arrangement.columns[value].ids order.\n req F-1.2: Cards within a column are rendered in the stored id order.\n req F-1.3:\n when: settings.hideUncategorized is true\n then: the uncategorized column is not rendered\n```\n\n```mdl\nfeat F-2: Drag and Drop\n\n req F-2.1:\n when: user drags a card to a different column\n then: card\'s pivot field is updated to the target column value; Arrangement updated\n\n req F-2.2:\n when: user drags a card within the same column\n then: card ids are reordered in Arrangement.columns[value].ids\n\n req F-2.3:\n when: user drags a column header\n then: Arrangement.order is updated to reflect the new column order\n```\n\n```mdl\nfeat F-3: Card Management\n\n req F-3.1:\n when: user clicks Add Card in a column\n then: a new ECHO object of the board\'s card type is created with the pivot field set to that column\'s value\n\n req F-3.2:\n when: user removes a card\n then: op:deleteCard runs; card is removed from the ECHO database and from the board\n\n req F-3.3:\n when: user undoes a delete-card action\n then: op:restoreCard re-adds the card; board reflects restored state\n```\n\n```mdl\nfeat F-4: Column Configuration\n\n req F-4.1:\n when: user opens KanbanSettings for a view-variant board\n then: column-field picker shows all single-select fields from the card schema\n\n req F-4.2:\n when: user selects a different column field\n then: View.projection.pivotFieldId is updated; board re-renders with new columns\n\n req F-4.3:\n when: user removes a column field\n then: op:deleteCardField removes the projection; op:restoreCardField can reverse it\n```\n\n```mdl\nfeat F-5: Item Source Variants\n\n req F-5.1:\n when: spec.kind === "view"\n then: items come from running the View\'s typename query against the ECHO database\n\n req F-5.2:\n when: spec.kind === "items"\n then: items come from spec.items (explicit ref array); used by externally-synced boards (e.g. Linear, GitHub)\n\n req F-5.3: Both variants share the same Arrangement persistence and drag-and-drop logic.\n```\n\n```mdl\nfeat F-6: ECHO Persistence and Collaboration\n\n req F-6.1: All Kanban, Arrangement, and card mutations are written to ECHO and replicated to peers.\n req F-6.2:\n when: a peer updates a card or moves it\n then: KanbanArticle re-renders reactively via AtomQuery / AtomObj subscriptions\n\n req F-6.3: View-variant kanbans own an associated View object that is hidden from the space browser.\n```\n\n```mdl\nfeat F-7: AI Blueprint\n\n req F-7.1: Plugin contributes a Kanban blueprint that lets an AI agent create and update kanban boards.\n req F-7.2:\n when: an AI agent calls the blueprint\n then: agent can create boards, place cards in columns, and update card fields\n```\n\n## Acceptance\n\n```mdl\ntest T-1: Create kanban board\n given: a space with a custom ECHO type that has a single-select field "status"\n when: user creates a new Kanban selecting that type and "status" as the pivot column\n then:\n - Kanban object written to ECHO with spec.kind === "view"\n - columns correspond to the "status" field\'s enum values\n - existing objects appear as cards in their respective columns\n```\n\n```mdl\ntest T-2: Drag card between columns\n given: a Kanban with columns "todo", "in-progress", "done" and a card in "todo"\n when: user drags the card to "in-progress"\n then:\n - card\'s "status" field updated to "in-progress"\n - Arrangement reflects card in "in-progress" column\n - change replicated to peers via ECHO\n```\n\n```mdl\ntest T-3: Reorder cards within a column\n given: a column with cards [A, B, C] in order\n when: user drags card C above card A\n then:\n - Arrangement.columns["col"].ids === [C, A, B]\n - board renders in new order\n```\n\n```mdl\ntest T-4: Add card to column\n given: a board with a "todo" column\n when: user clicks Add Card in "todo"\n then:\n - new ECHO object created with pivot field set to "todo"\n - card appears at the bottom of the "todo" column\n```\n\n```mdl\ntest T-5: Delete and restore card\n given: a board with card X in column "todo"\n when: user deletes card X, then undoes\n then:\n - after delete: card X absent from board and ECHO database\n - after undo: card X restored to ECHO and reappears in "todo"\n```\n\n```mdl\ntest T-6: Hide uncategorized column\n given: a board with some cards that have no pivot value (uncategorized)\n when: user enables "Hide uncategorized column" in KanbanSettings\n then:\n - uncategorized column no longer rendered\n - Arrangement.columns[UNCATEGORIZED].hidden === true\n```\n\n```mdl\ntest T-7: Switch pivot column field\n given: a view-variant board currently pivoting on "status"\n when: user opens settings and selects "priority" as the column field\n then:\n - View.projection.pivotFieldId updated to "priority"\n - board re-renders with columns derived from "priority" enum values\n```\n\n---\n\n## Appendix: Extension Definitions\n\n```mdl\next type\n uri: org.dxos.mdl.type@1.0\n desc: A named data structure with typed fields and optional literals.\n fields:\n desc?: Prose\n fields?: FieldMap\n literals?: UnionList\n extends?: TypeRef[]\n```\n\n```mdl\next feat\n uri: org.dxos.mdl.feat@1.0\n desc: A named feature grouping one or more requirements.\n fields:\n desc?: Prose\n req: RequirementList\n nesting: self\n```\n\n```mdl\next test\n uri: org.dxos.mdl.test@1.0\n desc: An acceptance scenario expressed as given / when / then steps.\n fields:\n given?: Step | Step[]\n when?: Step | Step[]\n then: Step | Step[]\n tags?: TagList\n```\n\n```mdl\next component\n uri: org.dxos.mdl.component@1.0\n desc: A UI component with props, internal state, slots, actions, and events.\n fields:\n desc?: Prose\n props?: FieldMap\n state?: FieldMap\n slots?: FieldMap\n actions?: ActionMap\n emits?: EventMap\n layout?: CodeBlock\n```\n\n```mdl\next op\n uri: org.dxos.mdl.op@1.0\n desc: |\n A named operation with typed inputs, outputs, and declared errors.\n Pure ops have no effects or requires. Effectful ops declare both.\n fields:\n desc?: Prose\n input?: FieldMap\n output?: TypeExpr\n errors?: ErrorMap\n effects?: EffectList\n requires?: ServiceList\n note?: Prose\n```\n';
|
|
12
|
+
var PLUGIN_default = '---\nid: org.dxos.plugin.kanban\nname: KanbanPlugin\nversion: 0.1.0\n---\n\nVisual project management plugin for `DXOS` Composer \u2014 organise any ECHO type into drag-and-drop columns driven by a single-select field, with full local-first persistence and real-time peer replication.\n\n## Extensions\n\nThe following extension dialects are used in this document.\nEach extension is defined in the Appendix or resolved via its URI.\n\n| Term | URI |\n|-------------|--------------------------------|\n| `type` | `org.dxos.mdl.type@1.0` |\n| `feat` | `org.dxos.mdl.feat@1.0` |\n| `test` | `org.dxos.mdl.test@1.0` |\n| `component` | `org.dxos.mdl.component@1.0` |\n| `op` | `org.dxos.mdl.op@1.0` |\n\n## Types\n\n```mdl\ntype ArrangementColumnEntry\n fields:\n ids: string[] # ordered card ids within the column\n hidden?: boolean # when true the column is hidden from the board\n```\n\n```mdl\ntype Arrangement\n fields:\n order: string[] # ordered column values\n columns: Map<string, ArrangementColumnEntry>\n```\n\n```mdl\ntype KanbanViewSpec\n fields:\n kind: "view" # discriminator \u2014 items sourced from a View query\n view: Ref<View> # the View whose query drives card membership\n```\n\n```mdl\ntype KanbanItemsSpec\n fields:\n kind: "items" # discriminator \u2014 kanban owns items explicitly\n pivotField: string # property path that drives column membership\n items: Ref<object>[] # items owned directly by the kanban\n```\n\n```mdl\ntype KanbanSpec\n desc: Discriminated union of item-source strategies.\n literals: KanbanViewSpec | KanbanItemsSpec\n```\n\n```mdl\ntype Kanban\n desc: Root ECHO object for a kanban board. Stored with typename org.dxos.type.kanban v0.2.0.\n fields:\n name?: string\n arrangement: Arrangement\n spec: KanbanSpec # discriminated by spec.kind\n```\n\n```mdl\ntype KanbanSettings\n fields:\n hideUncategorized?: boolean # hides items with no pivot value\n```\n\n```mdl\ntype KanbanViewSettings\n fields:\n columnFieldId: string # id of the View field used as pivot column\n hideUncategorized?: boolean\n```\n\n```mdl\ntype CreateKanbanInput\n fields:\n name?: string\n typename?: string # ECHO typename of card objects\n initialPivotColumn?: string # initial single-select field to pivot on\n```\n\n## Components\n\n```mdl\ncomponent KanbanArticle\n desc: Main article surface for a Kanban. Branches internally on spec.kind \u2014 view-variant runs a typename query via the linked View; items-variant dereferences spec.items directly.\n props:\n subject: Kanban\n role: "article" | "section"\n state:\n projection: ProjectionModel # column/field projection derived from View + schema\n items: AtomQuery # reactive card query (view-variant) or array (items-variant)\n actions:\n addCard(columnValue: string) \u2192 string # returns new card id\n removeCard(card: object)\n moveCard(card: object, toColumn: string, toIndex: number)\n deleteCardField(fieldId: string)\n layout: |\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 [toolbar slot] \u2502\n \u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n \u2502 Col A \u2502 Col B \u2502 Col C \u2502\n \u2502 \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u2502 \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u2502 \u2026 \u2502\n \u2502 \u2502 card \u2502 \u2502 \u2502 card \u2502 \u2502 \u2502\n \u2502 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2502 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2502 \u2502\n \u2502 [+ Add card]\u2502 \u2502 \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n```mdl\ncomponent KanbanSettings\n desc: Properties panel for a Kanban. View-variant shows a column-field picker plus common settings; items-variant shows only common settings.\n props:\n subject: Kanban\n state:\n selectFields: { value: string; label: string }[] # single-select fields available as pivot\n actions:\n changeColumnField(fieldId: string)\n toggleHideUncategorized(hidden: boolean)\n```\n\n## Operations\n\n```mdl\nop deleteCard\n desc: Removes a card object from the ECHO database.\n input:\n card: object # the card to remove\n output: DeleteCardOutput # { card } snapshot of the removed card\n effects: [echo:write]\n```\n\n```mdl\nop deleteCardField\n desc: Removes a field projection from the View\'s schema; returns enough data to undo.\n input:\n view: View\n fieldId: string\n output: DeleteCardFieldOutput # { field, props, index }\n effects: [echo:write]\n requires: [AtomRegistry, Database]\n```\n\n```mdl\nop restoreCard\n desc: Undo counterpart to deleteCard \u2014 re-adds a previously removed card to the database.\n input:\n card: object # the card snapshot to restore\n output: void\n effects: [echo:write]\n```\n\n```mdl\nop restoreCardField\n desc: Undo counterpart to deleteCardField \u2014 re-inserts a field projection at its original index.\n input:\n view: View\n field: FieldSchema\n props: object # field properties\n index: number # position to restore at\n output: void\n effects: [echo:write]\n requires: [AtomRegistry, Database]\n```\n\n## Features\n\n```mdl\nfeat F-1: Board Layout\n\n req F-1.1: Columns are ordered by Arrangement.order; each column contains its cards in Arrangement.columns[value].ids order.\n req F-1.2: Cards within a column are rendered in the stored id order.\n req F-1.3:\n when: settings.hideUncategorized is true\n then: the uncategorized column is not rendered\n```\n\n```mdl\nfeat F-2: Drag and Drop\n\n req F-2.1:\n when: user drags a card to a different column\n then: card\'s pivot field is updated to the target column value; Arrangement updated\n\n req F-2.2:\n when: user drags a card within the same column\n then: card ids are reordered in Arrangement.columns[value].ids\n\n req F-2.3:\n when: user drags a column header\n then: Arrangement.order is updated to reflect the new column order\n```\n\n```mdl\nfeat F-3: Card Management\n\n req F-3.1:\n when: user clicks Add Card in a column\n then: a new ECHO object of the board\'s card type is created with the pivot field set to that column\'s value\n\n req F-3.2:\n when: user removes a card\n then: op:deleteCard runs; card is removed from the ECHO database and from the board\n\n req F-3.3:\n when: user undoes a delete-card action\n then: op:restoreCard re-adds the card; board reflects restored state\n```\n\n```mdl\nfeat F-4: Column Configuration\n\n req F-4.1:\n when: user opens KanbanSettings for a view-variant board\n then: column-field picker shows all single-select fields from the card schema\n\n req F-4.2:\n when: user selects a different column field\n then: View.projection.pivotFieldId is updated; board re-renders with new columns\n\n req F-4.3:\n when: user removes a column field\n then: op:deleteCardField removes the projection; op:restoreCardField can reverse it\n```\n\n```mdl\nfeat F-5: Item Source Variants\n\n req F-5.1:\n when: spec.kind === "view"\n then: items come from running the View\'s typename query against the ECHO database\n\n req F-5.2:\n when: spec.kind === "items"\n then: items come from spec.items (explicit ref array); used by externally-synced boards (e.g. Linear, GitHub)\n\n req F-5.3: Both variants share the same Arrangement persistence and drag-and-drop logic.\n```\n\n```mdl\nfeat F-6: ECHO Persistence and Collaboration\n\n req F-6.1: All Kanban, Arrangement, and card mutations are written to ECHO and replicated to peers.\n req F-6.2:\n when: a peer updates a card or moves it\n then: KanbanArticle re-renders reactively via AtomQuery / AtomObj subscriptions\n\n req F-6.3: View-variant kanbans own an associated View object that is hidden from the space browser.\n```\n\n```mdl\nfeat F-7: AI Skill\n\n req F-7.1: Plugin contributes a Kanban skill that lets an AI agent create and update kanban boards.\n req F-7.2:\n when: an AI agent calls the skill\n then: agent can create boards, place cards in columns, and update card fields\n```\n\n## Acceptance\n\n```mdl\ntest T-1: Create kanban board\n given: a space with a custom ECHO type that has a single-select field "status"\n when: user creates a new Kanban selecting that type and "status" as the pivot column\n then:\n - Kanban object written to ECHO with spec.kind === "view"\n - columns correspond to the "status" field\'s enum values\n - existing objects appear as cards in their respective columns\n```\n\n```mdl\ntest T-2: Drag card between columns\n given: a Kanban with columns "todo", "in-progress", "done" and a card in "todo"\n when: user drags the card to "in-progress"\n then:\n - card\'s "status" field updated to "in-progress"\n - Arrangement reflects card in "in-progress" column\n - change replicated to peers via ECHO\n```\n\n```mdl\ntest T-3: Reorder cards within a column\n given: a column with cards [A, B, C] in order\n when: user drags card C above card A\n then:\n - Arrangement.columns["col"].ids === [C, A, B]\n - board renders in new order\n```\n\n```mdl\ntest T-4: Add card to column\n given: a board with a "todo" column\n when: user clicks Add Card in "todo"\n then:\n - new ECHO object created with pivot field set to "todo"\n - card appears at the bottom of the "todo" column\n```\n\n```mdl\ntest T-5: Delete and restore card\n given: a board with card X in column "todo"\n when: user deletes card X, then undoes\n then:\n - after delete: card X absent from board and ECHO database\n - after undo: card X restored to ECHO and reappears in "todo"\n```\n\n```mdl\ntest T-6: Hide uncategorized column\n given: a board with some cards that have no pivot value (uncategorized)\n when: user enables "Hide uncategorized column" in KanbanSettings\n then:\n - uncategorized column no longer rendered\n - Arrangement.columns[UNCATEGORIZED].hidden === true\n```\n\n```mdl\ntest T-7: Switch pivot column field\n given: a view-variant board currently pivoting on "status"\n when: user opens settings and selects "priority" as the column field\n then:\n - View.projection.pivotFieldId updated to "priority"\n - board re-renders with columns derived from "priority" enum values\n```\n\n---\n\n## Appendix: Extension Definitions\n\n```mdl\next type\n uri: org.dxos.mdl.type@1.0\n desc: A named data structure with typed fields and optional literals.\n fields:\n desc?: Prose\n fields?: FieldMap\n literals?: UnionList\n extends?: TypeRef[]\n```\n\n```mdl\next feat\n uri: org.dxos.mdl.feat@1.0\n desc: A named feature grouping one or more requirements.\n fields:\n desc?: Prose\n req: RequirementList\n nesting: self\n```\n\n```mdl\next test\n uri: org.dxos.mdl.test@1.0\n desc: An acceptance scenario expressed as given / when / then steps.\n fields:\n given?: Step | Step[]\n when?: Step | Step[]\n then: Step | Step[]\n tags?: TagList\n```\n\n```mdl\next component\n uri: org.dxos.mdl.component@1.0\n desc: A UI component with props, internal state, slots, actions, and events.\n fields:\n desc?: Prose\n props?: FieldMap\n state?: FieldMap\n slots?: FieldMap\n actions?: ActionMap\n emits?: EventMap\n layout?: CodeBlock\n```\n\n```mdl\next op\n uri: org.dxos.mdl.op@1.0\n desc: |\n A named operation with typed inputs, outputs, and declared errors.\n Pure ops have no effects or requires. Effectful ops declare both.\n fields:\n desc?: Prose\n input?: FieldMap\n output?: TypeExpr\n errors?: ErrorMap\n effects?: EffectList\n requires?: ServiceList\n note?: Prose\n```\n';
|
|
13
13
|
|
|
14
14
|
// src/KanbanPlugin.tsx
|
|
15
|
-
var KanbanPlugin = Plugin.define(meta).pipe(AppPlugin.
|
|
16
|
-
activate:
|
|
15
|
+
var KanbanPlugin = Plugin.define(meta).pipe(AppPlugin.addSkillDefinitionModule({
|
|
16
|
+
activate: SkillDefinition
|
|
17
17
|
}), AppPlugin.addCreateObjectModule({
|
|
18
18
|
activate: CreateObject
|
|
19
19
|
}), AppPlugin.addOperationHandlerModule({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/KanbanPlugin.tsx", "raw-loader:/__w/dxos/dxos/packages/plugins/plugin-kanban/PLUGIN.mdl"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\n\nimport { BlueprintDefinition, CreateObject, OperationHandler, UndoMappings, ReactSurface } from '#capabilities';\nimport { meta } from '#meta';\nimport { translations } from '#translations';\nimport { Kanban } from '#types';\n\n// eslint-disable-next-line import/no-relative-packages\nimport pluginSpec from '../PLUGIN.mdl?raw';\n\nexport const KanbanPlugin = Plugin.define(meta).pipe(\n AppPlugin.addBlueprintDefinitionModule({ activate: BlueprintDefinition }),\n AppPlugin.addCreateObjectModule({ activate: CreateObject }),\n AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),\n AppPlugin.addUndoMappingsModule({ activate: UndoMappings }),\n AppPlugin.addSchemaModule({ schema: [Kanban.Kanban] }),\n AppPlugin.addSurfaceModule({ activate: ReactSurface }),\n AppPlugin.addTranslationsModule({ translations }),\n AppPlugin.addPluginAssetModule({\n asset: { pluginId: meta.profile.key, path: 'PLUGIN.mdl', content: pluginSpec, mimeType: 'application/x-mdl' },\n }),\n Plugin.make,\n);\n\nexport default KanbanPlugin;\n", "---\nid: org.dxos.plugin.kanban\nname: KanbanPlugin\nversion: 0.1.0\n---\n\nVisual project management plugin for `DXOS` Composer \u2014 organise any ECHO type into drag-and-drop columns driven by a single-select field, with full local-first persistence and real-time peer replication.\n\n## Extensions\n\nThe following extension dialects are used in this document.\nEach extension is defined in the Appendix or resolved via its URI.\n\n| Term | URI |\n|-------------|--------------------------------|\n| `type` | `org.dxos.mdl.type@1.0` |\n| `feat` | `org.dxos.mdl.feat@1.0` |\n| `test` | `org.dxos.mdl.test@1.0` |\n| `component` | `org.dxos.mdl.component@1.0` |\n| `op` | `org.dxos.mdl.op@1.0` |\n\n## Types\n\n```mdl\ntype ArrangementColumnEntry\n fields:\n ids: string[] # ordered card ids within the column\n hidden?: boolean # when true the column is hidden from the board\n```\n\n```mdl\ntype Arrangement\n fields:\n order: string[] # ordered column values\n columns: Map<string, ArrangementColumnEntry>\n```\n\n```mdl\ntype KanbanViewSpec\n fields:\n kind: \"view\" # discriminator \u2014 items sourced from a View query\n view: Ref<View> # the View whose query drives card membership\n```\n\n```mdl\ntype KanbanItemsSpec\n fields:\n kind: \"items\" # discriminator \u2014 kanban owns items explicitly\n pivotField: string # property path that drives column membership\n items: Ref<object>[] # items owned directly by the kanban\n```\n\n```mdl\ntype KanbanSpec\n desc: Discriminated union of item-source strategies.\n literals: KanbanViewSpec | KanbanItemsSpec\n```\n\n```mdl\ntype Kanban\n desc: Root ECHO object for a kanban board. Stored with typename org.dxos.type.kanban v0.2.0.\n fields:\n name?: string\n arrangement: Arrangement\n spec: KanbanSpec # discriminated by spec.kind\n```\n\n```mdl\ntype KanbanSettings\n fields:\n hideUncategorized?: boolean # hides items with no pivot value\n```\n\n```mdl\ntype KanbanViewSettings\n fields:\n columnFieldId: string # id of the View field used as pivot column\n hideUncategorized?: boolean\n```\n\n```mdl\ntype CreateKanbanInput\n fields:\n name?: string\n typename?: string # ECHO typename of card objects\n initialPivotColumn?: string # initial single-select field to pivot on\n```\n\n## Components\n\n```mdl\ncomponent KanbanArticle\n desc: Main article surface for a Kanban. Branches internally on spec.kind \u2014 view-variant runs a typename query via the linked View; items-variant dereferences spec.items directly.\n props:\n subject: Kanban\n role: \"article\" | \"section\"\n state:\n projection: ProjectionModel # column/field projection derived from View + schema\n items: AtomQuery # reactive card query (view-variant) or array (items-variant)\n actions:\n addCard(columnValue: string) \u2192 string # returns new card id\n removeCard(card: object)\n moveCard(card: object, toColumn: string, toIndex: number)\n deleteCardField(fieldId: string)\n layout: |\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 [toolbar slot] \u2502\n \u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n \u2502 Col A \u2502 Col B \u2502 Col C \u2502\n \u2502 \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u2502 \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u2502 \u2026 \u2502\n \u2502 \u2502 card \u2502 \u2502 \u2502 card \u2502 \u2502 \u2502\n \u2502 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2502 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2502 \u2502\n \u2502 [+ Add card]\u2502 \u2502 \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n```mdl\ncomponent KanbanSettings\n desc: Properties panel for a Kanban. View-variant shows a column-field picker plus common settings; items-variant shows only common settings.\n props:\n subject: Kanban\n state:\n selectFields: { value: string; label: string }[] # single-select fields available as pivot\n actions:\n changeColumnField(fieldId: string)\n toggleHideUncategorized(hidden: boolean)\n```\n\n## Operations\n\n```mdl\nop deleteCard\n desc: Removes a card object from the ECHO database.\n input:\n card: object # the card to remove\n output: DeleteCardOutput # { card } snapshot of the removed card\n effects: [echo:write]\n```\n\n```mdl\nop deleteCardField\n desc: Removes a field projection from the View's schema; returns enough data to undo.\n input:\n view: View\n fieldId: string\n output: DeleteCardFieldOutput # { field, props, index }\n effects: [echo:write]\n requires: [AtomRegistry, Database]\n```\n\n```mdl\nop restoreCard\n desc: Undo counterpart to deleteCard \u2014 re-adds a previously removed card to the database.\n input:\n card: object # the card snapshot to restore\n output: void\n effects: [echo:write]\n```\n\n```mdl\nop restoreCardField\n desc: Undo counterpart to deleteCardField \u2014 re-inserts a field projection at its original index.\n input:\n view: View\n field: FieldSchema\n props: object # field properties\n index: number # position to restore at\n output: void\n effects: [echo:write]\n requires: [AtomRegistry, Database]\n```\n\n## Features\n\n```mdl\nfeat F-1: Board Layout\n\n req F-1.1: Columns are ordered by Arrangement.order; each column contains its cards in Arrangement.columns[value].ids order.\n req F-1.2: Cards within a column are rendered in the stored id order.\n req F-1.3:\n when: settings.hideUncategorized is true\n then: the uncategorized column is not rendered\n```\n\n```mdl\nfeat F-2: Drag and Drop\n\n req F-2.1:\n when: user drags a card to a different column\n then: card's pivot field is updated to the target column value; Arrangement updated\n\n req F-2.2:\n when: user drags a card within the same column\n then: card ids are reordered in Arrangement.columns[value].ids\n\n req F-2.3:\n when: user drags a column header\n then: Arrangement.order is updated to reflect the new column order\n```\n\n```mdl\nfeat F-3: Card Management\n\n req F-3.1:\n when: user clicks Add Card in a column\n then: a new ECHO object of the board's card type is created with the pivot field set to that column's value\n\n req F-3.2:\n when: user removes a card\n then: op:deleteCard runs; card is removed from the ECHO database and from the board\n\n req F-3.3:\n when: user undoes a delete-card action\n then: op:restoreCard re-adds the card; board reflects restored state\n```\n\n```mdl\nfeat F-4: Column Configuration\n\n req F-4.1:\n when: user opens KanbanSettings for a view-variant board\n then: column-field picker shows all single-select fields from the card schema\n\n req F-4.2:\n when: user selects a different column field\n then: View.projection.pivotFieldId is updated; board re-renders with new columns\n\n req F-4.3:\n when: user removes a column field\n then: op:deleteCardField removes the projection; op:restoreCardField can reverse it\n```\n\n```mdl\nfeat F-5: Item Source Variants\n\n req F-5.1:\n when: spec.kind === \"view\"\n then: items come from running the View's typename query against the ECHO database\n\n req F-5.2:\n when: spec.kind === \"items\"\n then: items come from spec.items (explicit ref array); used by externally-synced boards (e.g. Linear, GitHub)\n\n req F-5.3: Both variants share the same Arrangement persistence and drag-and-drop logic.\n```\n\n```mdl\nfeat F-6: ECHO Persistence and Collaboration\n\n req F-6.1: All Kanban, Arrangement, and card mutations are written to ECHO and replicated to peers.\n req F-6.2:\n when: a peer updates a card or moves it\n then: KanbanArticle re-renders reactively via AtomQuery / AtomObj subscriptions\n\n req F-6.3: View-variant kanbans own an associated View object that is hidden from the space browser.\n```\n\n```mdl\nfeat F-7: AI Blueprint\n\n req F-7.1: Plugin contributes a Kanban blueprint that lets an AI agent create and update kanban boards.\n req F-7.2:\n when: an AI agent calls the blueprint\n then: agent can create boards, place cards in columns, and update card fields\n```\n\n## Acceptance\n\n```mdl\ntest T-1: Create kanban board\n given: a space with a custom ECHO type that has a single-select field \"status\"\n when: user creates a new Kanban selecting that type and \"status\" as the pivot column\n then:\n - Kanban object written to ECHO with spec.kind === \"view\"\n - columns correspond to the \"status\" field's enum values\n - existing objects appear as cards in their respective columns\n```\n\n```mdl\ntest T-2: Drag card between columns\n given: a Kanban with columns \"todo\", \"in-progress\", \"done\" and a card in \"todo\"\n when: user drags the card to \"in-progress\"\n then:\n - card's \"status\" field updated to \"in-progress\"\n - Arrangement reflects card in \"in-progress\" column\n - change replicated to peers via ECHO\n```\n\n```mdl\ntest T-3: Reorder cards within a column\n given: a column with cards [A, B, C] in order\n when: user drags card C above card A\n then:\n - Arrangement.columns[\"col\"].ids === [C, A, B]\n - board renders in new order\n```\n\n```mdl\ntest T-4: Add card to column\n given: a board with a \"todo\" column\n when: user clicks Add Card in \"todo\"\n then:\n - new ECHO object created with pivot field set to \"todo\"\n - card appears at the bottom of the \"todo\" column\n```\n\n```mdl\ntest T-5: Delete and restore card\n given: a board with card X in column \"todo\"\n when: user deletes card X, then undoes\n then:\n - after delete: card X absent from board and ECHO database\n - after undo: card X restored to ECHO and reappears in \"todo\"\n```\n\n```mdl\ntest T-6: Hide uncategorized column\n given: a board with some cards that have no pivot value (uncategorized)\n when: user enables \"Hide uncategorized column\" in KanbanSettings\n then:\n - uncategorized column no longer rendered\n - Arrangement.columns[UNCATEGORIZED].hidden === true\n```\n\n```mdl\ntest T-7: Switch pivot column field\n given: a view-variant board currently pivoting on \"status\"\n when: user opens settings and selects \"priority\" as the column field\n then:\n - View.projection.pivotFieldId updated to \"priority\"\n - board re-renders with columns derived from \"priority\" enum values\n```\n\n---\n\n## Appendix: Extension Definitions\n\n```mdl\next type\n uri: org.dxos.mdl.type@1.0\n desc: A named data structure with typed fields and optional literals.\n fields:\n desc?: Prose\n fields?: FieldMap\n literals?: UnionList\n extends?: TypeRef[]\n```\n\n```mdl\next feat\n uri: org.dxos.mdl.feat@1.0\n desc: A named feature grouping one or more requirements.\n fields:\n desc?: Prose\n req: RequirementList\n nesting: self\n```\n\n```mdl\next test\n uri: org.dxos.mdl.test@1.0\n desc: An acceptance scenario expressed as given / when / then steps.\n fields:\n given?: Step | Step[]\n when?: Step | Step[]\n then: Step | Step[]\n tags?: TagList\n```\n\n```mdl\next component\n uri: org.dxos.mdl.component@1.0\n desc: A UI component with props, internal state, slots, actions, and events.\n fields:\n desc?: Prose\n props?: FieldMap\n state?: FieldMap\n slots?: FieldMap\n actions?: ActionMap\n emits?: EventMap\n layout?: CodeBlock\n```\n\n```mdl\next op\n uri: org.dxos.mdl.op@1.0\n desc: |\n A named operation with typed inputs, outputs, and declared errors.\n Pure ops have no effects or requires. Effectful ops declare both.\n fields:\n desc?: Prose\n input?: FieldMap\n output?: TypeExpr\n errors?: ErrorMap\n effects?: EffectList\n requires?: ServiceList\n note?: Prose\n```\n"],
|
|
5
|
-
"mappings": ";;;AAIA,SAASA,cAAc;AACvB,SAASC,iBAAiB;AAE1B,SAASC,
|
|
6
|
-
"names": ["Plugin", "AppPlugin", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\n\nimport { CreateObject, OperationHandler, ReactSurface, SkillDefinition, UndoMappings } from '#capabilities';\nimport { meta } from '#meta';\nimport { translations } from '#translations';\nimport { Kanban } from '#types';\n\n// eslint-disable-next-line import/no-relative-packages\nimport pluginSpec from '../PLUGIN.mdl?raw';\n\nexport const KanbanPlugin = Plugin.define(meta).pipe(\n AppPlugin.addSkillDefinitionModule({ activate: SkillDefinition }),\n AppPlugin.addCreateObjectModule({ activate: CreateObject }),\n AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),\n AppPlugin.addUndoMappingsModule({ activate: UndoMappings }),\n AppPlugin.addSchemaModule({ schema: [Kanban.Kanban] }),\n AppPlugin.addSurfaceModule({ activate: ReactSurface }),\n AppPlugin.addTranslationsModule({ translations }),\n AppPlugin.addPluginAssetModule({\n asset: { pluginId: meta.profile.key, path: 'PLUGIN.mdl', content: pluginSpec, mimeType: 'application/x-mdl' },\n }),\n Plugin.make,\n);\n\nexport default KanbanPlugin;\n", "---\nid: org.dxos.plugin.kanban\nname: KanbanPlugin\nversion: 0.1.0\n---\n\nVisual project management plugin for `DXOS` Composer \u2014 organise any ECHO type into drag-and-drop columns driven by a single-select field, with full local-first persistence and real-time peer replication.\n\n## Extensions\n\nThe following extension dialects are used in this document.\nEach extension is defined in the Appendix or resolved via its URI.\n\n| Term | URI |\n|-------------|--------------------------------|\n| `type` | `org.dxos.mdl.type@1.0` |\n| `feat` | `org.dxos.mdl.feat@1.0` |\n| `test` | `org.dxos.mdl.test@1.0` |\n| `component` | `org.dxos.mdl.component@1.0` |\n| `op` | `org.dxos.mdl.op@1.0` |\n\n## Types\n\n```mdl\ntype ArrangementColumnEntry\n fields:\n ids: string[] # ordered card ids within the column\n hidden?: boolean # when true the column is hidden from the board\n```\n\n```mdl\ntype Arrangement\n fields:\n order: string[] # ordered column values\n columns: Map<string, ArrangementColumnEntry>\n```\n\n```mdl\ntype KanbanViewSpec\n fields:\n kind: \"view\" # discriminator \u2014 items sourced from a View query\n view: Ref<View> # the View whose query drives card membership\n```\n\n```mdl\ntype KanbanItemsSpec\n fields:\n kind: \"items\" # discriminator \u2014 kanban owns items explicitly\n pivotField: string # property path that drives column membership\n items: Ref<object>[] # items owned directly by the kanban\n```\n\n```mdl\ntype KanbanSpec\n desc: Discriminated union of item-source strategies.\n literals: KanbanViewSpec | KanbanItemsSpec\n```\n\n```mdl\ntype Kanban\n desc: Root ECHO object for a kanban board. Stored with typename org.dxos.type.kanban v0.2.0.\n fields:\n name?: string\n arrangement: Arrangement\n spec: KanbanSpec # discriminated by spec.kind\n```\n\n```mdl\ntype KanbanSettings\n fields:\n hideUncategorized?: boolean # hides items with no pivot value\n```\n\n```mdl\ntype KanbanViewSettings\n fields:\n columnFieldId: string # id of the View field used as pivot column\n hideUncategorized?: boolean\n```\n\n```mdl\ntype CreateKanbanInput\n fields:\n name?: string\n typename?: string # ECHO typename of card objects\n initialPivotColumn?: string # initial single-select field to pivot on\n```\n\n## Components\n\n```mdl\ncomponent KanbanArticle\n desc: Main article surface for a Kanban. Branches internally on spec.kind \u2014 view-variant runs a typename query via the linked View; items-variant dereferences spec.items directly.\n props:\n subject: Kanban\n role: \"article\" | \"section\"\n state:\n projection: ProjectionModel # column/field projection derived from View + schema\n items: AtomQuery # reactive card query (view-variant) or array (items-variant)\n actions:\n addCard(columnValue: string) \u2192 string # returns new card id\n removeCard(card: object)\n moveCard(card: object, toColumn: string, toIndex: number)\n deleteCardField(fieldId: string)\n layout: |\n \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n \u2502 [toolbar slot] \u2502\n \u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n \u2502 Col A \u2502 Col B \u2502 Col C \u2502\n \u2502 \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u2502 \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u2502 \u2026 \u2502\n \u2502 \u2502 card \u2502 \u2502 \u2502 card \u2502 \u2502 \u2502\n \u2502 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2502 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2502 \u2502\n \u2502 [+ Add card]\u2502 \u2502 \u2502\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n```\n\n```mdl\ncomponent KanbanSettings\n desc: Properties panel for a Kanban. View-variant shows a column-field picker plus common settings; items-variant shows only common settings.\n props:\n subject: Kanban\n state:\n selectFields: { value: string; label: string }[] # single-select fields available as pivot\n actions:\n changeColumnField(fieldId: string)\n toggleHideUncategorized(hidden: boolean)\n```\n\n## Operations\n\n```mdl\nop deleteCard\n desc: Removes a card object from the ECHO database.\n input:\n card: object # the card to remove\n output: DeleteCardOutput # { card } snapshot of the removed card\n effects: [echo:write]\n```\n\n```mdl\nop deleteCardField\n desc: Removes a field projection from the View's schema; returns enough data to undo.\n input:\n view: View\n fieldId: string\n output: DeleteCardFieldOutput # { field, props, index }\n effects: [echo:write]\n requires: [AtomRegistry, Database]\n```\n\n```mdl\nop restoreCard\n desc: Undo counterpart to deleteCard \u2014 re-adds a previously removed card to the database.\n input:\n card: object # the card snapshot to restore\n output: void\n effects: [echo:write]\n```\n\n```mdl\nop restoreCardField\n desc: Undo counterpart to deleteCardField \u2014 re-inserts a field projection at its original index.\n input:\n view: View\n field: FieldSchema\n props: object # field properties\n index: number # position to restore at\n output: void\n effects: [echo:write]\n requires: [AtomRegistry, Database]\n```\n\n## Features\n\n```mdl\nfeat F-1: Board Layout\n\n req F-1.1: Columns are ordered by Arrangement.order; each column contains its cards in Arrangement.columns[value].ids order.\n req F-1.2: Cards within a column are rendered in the stored id order.\n req F-1.3:\n when: settings.hideUncategorized is true\n then: the uncategorized column is not rendered\n```\n\n```mdl\nfeat F-2: Drag and Drop\n\n req F-2.1:\n when: user drags a card to a different column\n then: card's pivot field is updated to the target column value; Arrangement updated\n\n req F-2.2:\n when: user drags a card within the same column\n then: card ids are reordered in Arrangement.columns[value].ids\n\n req F-2.3:\n when: user drags a column header\n then: Arrangement.order is updated to reflect the new column order\n```\n\n```mdl\nfeat F-3: Card Management\n\n req F-3.1:\n when: user clicks Add Card in a column\n then: a new ECHO object of the board's card type is created with the pivot field set to that column's value\n\n req F-3.2:\n when: user removes a card\n then: op:deleteCard runs; card is removed from the ECHO database and from the board\n\n req F-3.3:\n when: user undoes a delete-card action\n then: op:restoreCard re-adds the card; board reflects restored state\n```\n\n```mdl\nfeat F-4: Column Configuration\n\n req F-4.1:\n when: user opens KanbanSettings for a view-variant board\n then: column-field picker shows all single-select fields from the card schema\n\n req F-4.2:\n when: user selects a different column field\n then: View.projection.pivotFieldId is updated; board re-renders with new columns\n\n req F-4.3:\n when: user removes a column field\n then: op:deleteCardField removes the projection; op:restoreCardField can reverse it\n```\n\n```mdl\nfeat F-5: Item Source Variants\n\n req F-5.1:\n when: spec.kind === \"view\"\n then: items come from running the View's typename query against the ECHO database\n\n req F-5.2:\n when: spec.kind === \"items\"\n then: items come from spec.items (explicit ref array); used by externally-synced boards (e.g. Linear, GitHub)\n\n req F-5.3: Both variants share the same Arrangement persistence and drag-and-drop logic.\n```\n\n```mdl\nfeat F-6: ECHO Persistence and Collaboration\n\n req F-6.1: All Kanban, Arrangement, and card mutations are written to ECHO and replicated to peers.\n req F-6.2:\n when: a peer updates a card or moves it\n then: KanbanArticle re-renders reactively via AtomQuery / AtomObj subscriptions\n\n req F-6.3: View-variant kanbans own an associated View object that is hidden from the space browser.\n```\n\n```mdl\nfeat F-7: AI Skill\n\n req F-7.1: Plugin contributes a Kanban skill that lets an AI agent create and update kanban boards.\n req F-7.2:\n when: an AI agent calls the skill\n then: agent can create boards, place cards in columns, and update card fields\n```\n\n## Acceptance\n\n```mdl\ntest T-1: Create kanban board\n given: a space with a custom ECHO type that has a single-select field \"status\"\n when: user creates a new Kanban selecting that type and \"status\" as the pivot column\n then:\n - Kanban object written to ECHO with spec.kind === \"view\"\n - columns correspond to the \"status\" field's enum values\n - existing objects appear as cards in their respective columns\n```\n\n```mdl\ntest T-2: Drag card between columns\n given: a Kanban with columns \"todo\", \"in-progress\", \"done\" and a card in \"todo\"\n when: user drags the card to \"in-progress\"\n then:\n - card's \"status\" field updated to \"in-progress\"\n - Arrangement reflects card in \"in-progress\" column\n - change replicated to peers via ECHO\n```\n\n```mdl\ntest T-3: Reorder cards within a column\n given: a column with cards [A, B, C] in order\n when: user drags card C above card A\n then:\n - Arrangement.columns[\"col\"].ids === [C, A, B]\n - board renders in new order\n```\n\n```mdl\ntest T-4: Add card to column\n given: a board with a \"todo\" column\n when: user clicks Add Card in \"todo\"\n then:\n - new ECHO object created with pivot field set to \"todo\"\n - card appears at the bottom of the \"todo\" column\n```\n\n```mdl\ntest T-5: Delete and restore card\n given: a board with card X in column \"todo\"\n when: user deletes card X, then undoes\n then:\n - after delete: card X absent from board and ECHO database\n - after undo: card X restored to ECHO and reappears in \"todo\"\n```\n\n```mdl\ntest T-6: Hide uncategorized column\n given: a board with some cards that have no pivot value (uncategorized)\n when: user enables \"Hide uncategorized column\" in KanbanSettings\n then:\n - uncategorized column no longer rendered\n - Arrangement.columns[UNCATEGORIZED].hidden === true\n```\n\n```mdl\ntest T-7: Switch pivot column field\n given: a view-variant board currently pivoting on \"status\"\n when: user opens settings and selects \"priority\" as the column field\n then:\n - View.projection.pivotFieldId updated to \"priority\"\n - board re-renders with columns derived from \"priority\" enum values\n```\n\n---\n\n## Appendix: Extension Definitions\n\n```mdl\next type\n uri: org.dxos.mdl.type@1.0\n desc: A named data structure with typed fields and optional literals.\n fields:\n desc?: Prose\n fields?: FieldMap\n literals?: UnionList\n extends?: TypeRef[]\n```\n\n```mdl\next feat\n uri: org.dxos.mdl.feat@1.0\n desc: A named feature grouping one or more requirements.\n fields:\n desc?: Prose\n req: RequirementList\n nesting: self\n```\n\n```mdl\next test\n uri: org.dxos.mdl.test@1.0\n desc: An acceptance scenario expressed as given / when / then steps.\n fields:\n given?: Step | Step[]\n when?: Step | Step[]\n then: Step | Step[]\n tags?: TagList\n```\n\n```mdl\next component\n uri: org.dxos.mdl.component@1.0\n desc: A UI component with props, internal state, slots, actions, and events.\n fields:\n desc?: Prose\n props?: FieldMap\n state?: FieldMap\n slots?: FieldMap\n actions?: ActionMap\n emits?: EventMap\n layout?: CodeBlock\n```\n\n```mdl\next op\n uri: org.dxos.mdl.op@1.0\n desc: |\n A named operation with typed inputs, outputs, and declared errors.\n Pure ops have no effects or requires. Effectful ops declare both.\n fields:\n desc?: Prose\n input?: FieldMap\n output?: TypeExpr\n errors?: ErrorMap\n effects?: EffectList\n requires?: ServiceList\n note?: Prose\n```\n"],
|
|
5
|
+
"mappings": ";;;AAIA,SAASA,cAAc;AACvB,SAASC,iBAAiB;AAE1B,SAASC,cAAcC,kBAAkBC,cAAcC,iBAAiBC,oBAAoB;AAC5F,SAASC,YAAY;AACrB,SAASC,oBAAoB;AAC7B,SAASC,cAAc;;;ACVvB;;;ADeO,IAAMC,eAAeC,OAAOC,OAAOC,IAAAA,EAAMC,KAC9CC,UAAUC,yBAAyB;EAAEC,UAAUC;AAAgB,CAAA,GAC/DH,UAAUI,sBAAsB;EAAEF,UAAUG;AAAa,CAAA,GACzDL,UAAUM,0BAA0B;EAAEJ,UAAUK;AAAiB,CAAA,GACjEP,UAAUQ,sBAAsB;EAAEN,UAAUO;AAAa,CAAA,GACzDT,UAAUU,gBAAgB;EAAEC,QAAQ;IAACC,OAAOA;;AAAQ,CAAA,GACpDZ,UAAUa,iBAAiB;EAAEX,UAAUY;AAAa,CAAA,GACpDd,UAAUe,sBAAsB;EAAEC;AAAa,CAAA,GAC/ChB,UAAUiB,qBAAqB;EAC7BC,OAAO;IAAEC,UAAUrB,KAAKsB,QAAQC;IAAKC,MAAM;IAAcC,SAASC;IAAYC,UAAU;EAAoB;AAC9G,CAAA,GACA7B,OAAO8B,IAAI;AAGb,IAAA,uBAAe/B;",
|
|
6
|
+
"names": ["Plugin", "AppPlugin", "CreateObject", "OperationHandler", "ReactSurface", "SkillDefinition", "UndoMappings", "meta", "translations", "Kanban", "KanbanPlugin", "Plugin", "define", "meta", "pipe", "AppPlugin", "addSkillDefinitionModule", "activate", "SkillDefinition", "addCreateObjectModule", "CreateObject", "addOperationHandlerModule", "OperationHandler", "addUndoMappingsModule", "UndoMappings", "addSchemaModule", "schema", "Kanban", "addSurfaceModule", "ReactSurface", "addTranslationsModule", "translations", "addPluginAssetModule", "asset", "pluginId", "profile", "key", "path", "content", "pluginSpec", "mimeType", "make"]
|
|
7
7
|
}
|
|
@@ -3,11 +3,11 @@ import "./chunk-J5LGTIGS.mjs";
|
|
|
3
3
|
// src/KanbanPlugin.node.ts
|
|
4
4
|
import { Plugin } from "@dxos/app-framework";
|
|
5
5
|
import { AppPlugin } from "@dxos/app-toolkit";
|
|
6
|
-
import {
|
|
6
|
+
import { CreateObject, OperationHandler, SkillDefinition, UndoMappings } from "#capabilities";
|
|
7
7
|
import { meta } from "#meta";
|
|
8
8
|
import { Kanban } from "#types";
|
|
9
|
-
var KanbanPlugin = Plugin.define(meta).pipe(AppPlugin.
|
|
10
|
-
activate:
|
|
9
|
+
var KanbanPlugin = Plugin.define(meta).pipe(AppPlugin.addSkillDefinitionModule({
|
|
10
|
+
activate: SkillDefinition
|
|
11
11
|
}), AppPlugin.addCreateObjectModule({
|
|
12
12
|
activate: CreateObject
|
|
13
13
|
}), AppPlugin.addOperationHandlerModule({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/KanbanPlugin.node.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\n\nimport {
|
|
5
|
-
"mappings": ";;;AAIA,SAASA,cAAc;AACvB,SAASC,iBAAiB;AAE1B,SAASC,
|
|
6
|
-
"names": ["Plugin", "AppPlugin", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\n\nimport { CreateObject, OperationHandler, SkillDefinition, UndoMappings } from '#capabilities';\nimport { meta } from '#meta';\nimport { Kanban } from '#types';\n\nexport const KanbanPlugin = Plugin.define(meta).pipe(\n AppPlugin.addSkillDefinitionModule({ activate: SkillDefinition }),\n AppPlugin.addCreateObjectModule({ activate: CreateObject }),\n AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),\n AppPlugin.addUndoMappingsModule({ activate: UndoMappings }),\n AppPlugin.addSchemaModule({ schema: [Kanban.Kanban] }),\n Plugin.make,\n);\n\nexport default KanbanPlugin;\n"],
|
|
5
|
+
"mappings": ";;;AAIA,SAASA,cAAc;AACvB,SAASC,iBAAiB;AAE1B,SAASC,cAAcC,kBAAkBC,iBAAiBC,oBAAoB;AAC9E,SAASC,YAAY;AACrB,SAASC,cAAc;AAEhB,IAAMC,eAAeR,OAAOS,OAAOH,IAAAA,EAAMI,KAC9CT,UAAUU,yBAAyB;EAAEC,UAAUR;AAAgB,CAAA,GAC/DH,UAAUY,sBAAsB;EAAED,UAAUV;AAAa,CAAA,GACzDD,UAAUa,0BAA0B;EAAEF,UAAUT;AAAiB,CAAA,GACjEF,UAAUc,sBAAsB;EAAEH,UAAUP;AAAa,CAAA,GACzDJ,UAAUe,gBAAgB;EAAEC,QAAQ;IAACV,OAAOA;;AAAQ,CAAA,GACpDP,OAAOkB,IAAI;AAGb,IAAA,4BAAeV;",
|
|
6
|
+
"names": ["Plugin", "AppPlugin", "CreateObject", "OperationHandler", "SkillDefinition", "UndoMappings", "meta", "Kanban", "KanbanPlugin", "define", "pipe", "addSkillDefinitionModule", "activate", "addCreateObjectModule", "addOperationHandlerModule", "addUndoMappingsModule", "addSchemaModule", "schema", "make"]
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./chunk-J5LGTIGS.mjs";
|
|
2
2
|
|
|
3
|
-
// src/containers/
|
|
3
|
+
// src/containers/KanbanProperties/KanbanProperties.tsx
|
|
4
4
|
import { RegistryContext } from "@effect-atom/atom-react";
|
|
5
5
|
import React, { useCallback, useContext, useMemo } from "react";
|
|
6
6
|
import { Obj } from "@dxos/echo";
|
|
@@ -10,7 +10,7 @@ import { Form, SelectField } from "@dxos/react-ui-form";
|
|
|
10
10
|
import { getTypeURIFromQuery } from "@dxos/schema";
|
|
11
11
|
import { useProjectionModel } from "#hooks";
|
|
12
12
|
import { KanbanSettingsSchema, KanbanViewSettingsSchema, UNCATEGORIZED_VALUE } from "#types";
|
|
13
|
-
var
|
|
13
|
+
var KanbanProperties = ({ subject: object }) => {
|
|
14
14
|
const registry = useContext(RegistryContext);
|
|
15
15
|
const db = Obj.getDatabase(object);
|
|
16
16
|
const isView = object.spec.kind === "view";
|
|
@@ -78,6 +78,6 @@ var KanbanSettings = ({ subject: object }) => {
|
|
|
78
78
|
}, /* @__PURE__ */ React.createElement(Form.FieldSet, null)));
|
|
79
79
|
};
|
|
80
80
|
export {
|
|
81
|
-
|
|
81
|
+
KanbanProperties as default
|
|
82
82
|
};
|
|
83
|
-
//# sourceMappingURL=
|
|
83
|
+
//# sourceMappingURL=KanbanProperties-W7MZNZVJ.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/containers/KanbanProperties/KanbanProperties.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { RegistryContext } from '@effect-atom/atom-react';\nimport React, { useCallback, useContext, useMemo } from 'react';\n\nimport { type AppSurface } from '@dxos/app-toolkit/ui';\nimport { Obj } from '@dxos/echo';\nimport { Format } from '@dxos/echo/Format';\nimport { useObject, useType } from '@dxos/react-client/echo';\nimport { Form, type FormFieldMap, SelectField } from '@dxos/react-ui-form';\nimport { getTypeURIFromQuery } from '@dxos/schema';\n\nimport { useProjectionModel } from '#hooks';\nimport { type Kanban, KanbanSettingsSchema, KanbanViewSettingsSchema, UNCATEGORIZED_VALUE } from '#types';\n\nexport type KanbanPropertiesProps = AppSurface.ObjectPropertiesProps<Kanban.Kanban>;\n\n/**\n * Object-properties panel for a Kanban. Renders fields common to every kanban\n * (currently the \"Hide uncategorized column\" toggle); for view-variant\n * kanbans an additional \"Column field\" picker drives the View's pivot\n * field. Items-variant kanbans use a hardcoded `spec.pivotField`, so that\n * field is omitted there.\n */\nexport const KanbanProperties = ({ subject: object }: KanbanPropertiesProps) => {\n const registry = useContext(RegistryContext);\n const db = Obj.getDatabase(object);\n const isView = object.spec.kind === 'view';\n const [view, updateView] = useObject(object.spec.kind === 'view' ? object.spec.view : undefined);\n const [, updateKanban] = useObject(object);\n const currentTypeUri = view?.query ? getTypeURIFromQuery(view.query.ast) : undefined;\n const schema = useType(db, currentTypeUri);\n const projection = useProjectionModel(schema, object, registry);\n\n const fieldProjections = projection?.getFieldProjections() ?? [];\n const selectFields = useMemo(\n () =>\n fieldProjections\n .filter((field) => field.props.format === Format.TypeFormat.SingleSelect)\n .map(({ field }) => ({ value: field.id, label: field.path })),\n [fieldProjections],\n );\n\n const hideUncategorized = object.arrangement.columns[UNCATEGORIZED_VALUE]?.hidden ?? false;\n\n const handleValuesChanged = useCallback(\n (values: Partial<{ columnFieldId: string; hideUncategorized: boolean }>) => {\n if (isView && values.columnFieldId != null) {\n updateView((view) => {\n view.projection.pivotFieldId = values.columnFieldId!;\n });\n }\n if (values.hideUncategorized !== undefined) {\n updateKanban((kanban) => {\n const existing = kanban.arrangement.columns[UNCATEGORIZED_VALUE];\n if (existing) {\n existing.hidden = values.hideUncategorized;\n } else {\n kanban.arrangement.columns[UNCATEGORIZED_VALUE] = {\n ids: [],\n hidden: values.hideUncategorized,\n };\n }\n });\n }\n },\n [isView, updateView, updateKanban],\n );\n\n const initialValues = useMemo(\n () => ({\n ...(isView ? { columnFieldId: view?.projection.pivotFieldId } : {}),\n hideUncategorized,\n }),\n [isView, view?.projection.pivotFieldId, hideUncategorized],\n );\n\n const fieldMap: FormFieldMap = useMemo(\n () => ({ columnFieldId: (props) => <SelectField {...props} options={selectFields} /> }),\n [selectFields],\n );\n\n // Schema is picked by `kanban.spec.kind` — they have different shapes,\n // so cast for `Form.Root`'s single-schema prop.\n const settingsSchema = (isView ? KanbanViewSettingsSchema : KanbanSettingsSchema) as any;\n\n return (\n <Form.Section>\n <Form.Root\n schema={settingsSchema}\n values={initialValues}\n fieldMap={fieldMap}\n onValuesChanged={handleValuesChanged}\n >\n <Form.FieldSet />\n </Form.Root>\n </Form.Section>\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;AAIA,SAASA,uBAAuB;AAChC,OAAOC,SAASC,aAAaC,YAAYC,eAAe;AAGxD,SAASC,WAAW;AACpB,SAASC,cAAc;AACvB,SAASC,WAAWC,eAAe;AACnC,SAASC,MAAyBC,mBAAmB;AACrD,SAASC,2BAA2B;AAEpC,SAASC,0BAA0B;AACnC,SAAsBC,sBAAsBC,0BAA0BC,2BAA2B;AAW1F,IAAMC,mBAAmB,CAAC,EAAEC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;YAChD2C,KAAK,CAAA;YACLP,QAAQE,OAAOL;UACjB;QACF;MACF,CAAA;IACF;EACF,GACA;IAAC1B;IAAQI;IAAYE;GAAa;AAGpC,QAAM+B,gBAAgBvD,QACpB,OAAO;IACL,GAAIkB,SAAS;MAAEgC,eAAe7B,MAAMQ,WAAWsB;IAAa,IAAI,CAAC;IACjEP;EACF,IACA;IAAC1B;IAAQG,MAAMQ,WAAWsB;IAAcP;GAAkB;AAG5D,QAAMY,WAAyBxD,QAC7B,OAAO;IAAEkD,eAAe,CAACf,UAAU,sBAAA,cAAC7B,aAAAA;MAAa,GAAG6B;MAAOsB,SAASzB;;EAAiB,IACrF;IAACA;GAAa;AAKhB,QAAM0B,iBAAkBxC,SAASR,2BAA2BD;AAE5D,SACE,sBAAA,cAACJ,KAAKsD,SAAO,MACX,sBAAA,cAACtD,KAAKuD,MAAI;IACRhC,QAAQ8B;IACRT,QAAQM;IACRC;IACAK,iBAAiBb;KAEjB,sBAAA,cAAC3C,KAAKyD,UAAQ,IAAA,CAAA,CAAA;AAItB;",
|
|
6
|
+
"names": ["RegistryContext", "React", "useCallback", "useContext", "useMemo", "Obj", "Format", "useObject", "useType", "Form", "SelectField", "getTypeURIFromQuery", "useProjectionModel", "KanbanSettingsSchema", "KanbanViewSettingsSchema", "UNCATEGORIZED_VALUE", "KanbanProperties", "subject", "object", "registry", "db", "getDatabase", "isView", "spec", "kind", "view", "updateView", "undefined", "updateKanban", "currentTypeUri", "query", "ast", "schema", "projection", "fieldProjections", "getFieldProjections", "selectFields", "filter", "field", "props", "format", "TypeFormat", "SingleSelect", "map", "value", "id", "label", "path", "hideUncategorized", "arrangement", "columns", "hidden", "handleValuesChanged", "values", "columnFieldId", "pivotFieldId", "kanban", "existing", "ids", "initialValues", "fieldMap", "options", "settingsSchema", "Section", "Root", "onValuesChanged", "FieldSet"]
|
|
7
|
+
}
|
|
@@ -2,16 +2,16 @@ import "../chunk-J5LGTIGS.mjs";
|
|
|
2
2
|
|
|
3
3
|
// src/capabilities/index.ts
|
|
4
4
|
import { Capability } from "@dxos/app-framework";
|
|
5
|
-
var
|
|
6
|
-
var CreateObject = Capability.lazy("CreateObject", () => import("../create-object-
|
|
5
|
+
var SkillDefinition = Capability.lazy("SkillDefinition", () => import("../skill-definition-YGTCKXGP.mjs"));
|
|
6
|
+
var CreateObject = Capability.lazy("CreateObject", () => import("../create-object-DIIFRS57.mjs"));
|
|
7
7
|
var OperationHandler = Capability.lazy("OperationHandler", () => import("../operation-handler-B7IW6MXU.mjs"));
|
|
8
|
-
var ReactSurface = Capability.lazy("ReactSurface", () => import("../react-surface-
|
|
8
|
+
var ReactSurface = Capability.lazy("ReactSurface", () => import("../react-surface-FQGXRR3X.mjs"));
|
|
9
9
|
var UndoMappings = Capability.lazy("UndoMappings", () => import("../undo-mappings-EZTHO4UL.mjs"));
|
|
10
10
|
export {
|
|
11
|
-
BlueprintDefinition,
|
|
12
11
|
CreateObject,
|
|
13
12
|
OperationHandler,
|
|
14
13
|
ReactSurface,
|
|
14
|
+
SkillDefinition,
|
|
15
15
|
UndoMappings
|
|
16
16
|
};
|
|
17
17
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/capabilities/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\nimport type { OperationHandlerSet } from '@dxos/compute';\n\nexport const
|
|
5
|
-
"mappings": ";;;AAIA,SAASA,kBAAkB;AAGpB,IAAMC,
|
|
6
|
-
"names": ["Capability", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\nimport type { OperationHandlerSet } from '@dxos/compute';\n\nexport const SkillDefinition = Capability.lazy('SkillDefinition', () => import('./skill-definition'));\nexport const CreateObject = Capability.lazy('CreateObject', () => import('./create-object'));\nexport const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(\n 'OperationHandler',\n () => import('./operation-handler'),\n);\nexport const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));\nexport const UndoMappings = Capability.lazy('UndoMappings', () => import('./undo-mappings'));\n"],
|
|
5
|
+
"mappings": ";;;AAIA,SAASA,kBAAkB;AAGpB,IAAMC,kBAAkBD,WAAWE,KAAK,mBAAmB,MAAM,OAAO,kCAAA,CAAA;AACxE,IAAMC,eAAeH,WAAWE,KAAK,gBAAgB,MAAM,OAAO,+BAAA,CAAA;AAClE,IAAME,mBAAmBJ,WAAWE,KACzC,oBACA,MAAM,OAAO,mCAAA,CAAA;AAER,IAAMG,eAAeL,WAAWE,KAAK,gBAAgB,MAAM,OAAO,+BAAA,CAAA;AAClE,IAAMI,eAAeN,WAAWE,KAAK,gBAAgB,MAAM,OAAO,+BAAA,CAAA;",
|
|
6
|
+
"names": ["Capability", "SkillDefinition", "lazy", "CreateObject", "OperationHandler", "ReactSurface", "UndoMappings"]
|
|
7
7
|
}
|
|
@@ -59,7 +59,7 @@ __export(Kanban_exports, {
|
|
|
59
59
|
makeItems: () => makeItems
|
|
60
60
|
});
|
|
61
61
|
import * as Schema2 from "effect/Schema";
|
|
62
|
-
import {
|
|
62
|
+
import { Annotation, DXN, Obj, Ref, Type, View } from "@dxos/echo";
|
|
63
63
|
import { FormInputAnnotation, LabelAnnotation } from "@dxos/echo/Annotation";
|
|
64
64
|
import { ViewAnnotation } from "@dxos/schema";
|
|
65
65
|
var ArrangementColumnEntry = Schema2.Struct({
|
|
@@ -86,7 +86,7 @@ var KanbanItemsSpec = Schema2.Struct({
|
|
|
86
86
|
items: Schema2.Array(Ref.Ref(Obj.Unknown)).pipe(FormInputAnnotation.set(false))
|
|
87
87
|
});
|
|
88
88
|
var KanbanSpec = Schema2.Union(KanbanViewSpec, KanbanItemsSpec);
|
|
89
|
-
var Kanban = Schema2.Struct({
|
|
89
|
+
var Kanban = class extends Type.makeObject(DXN.make("org.dxos.type.kanban", "0.2.0"))(Schema2.Struct({
|
|
90
90
|
name: Schema2.String.pipe(Schema2.optional),
|
|
91
91
|
arrangement: Arrangement,
|
|
92
92
|
/** How this kanban sources its items. Discriminated by `spec.kind`. */
|
|
@@ -99,7 +99,8 @@ var Kanban = Schema2.Struct({
|
|
|
99
99
|
]), Annotation.IconAnnotation.set({
|
|
100
100
|
icon: "ph--kanban--regular",
|
|
101
101
|
hue: "green"
|
|
102
|
-
})
|
|
102
|
+
}))) {
|
|
103
|
+
};
|
|
103
104
|
var isKanbanView = (kanban) => kanban.spec.kind === "view";
|
|
104
105
|
var isKanbanItems = (kanban) => kanban.spec.kind === "items";
|
|
105
106
|
var make = (props) => {
|
|
@@ -149,7 +150,7 @@ __export(KanbanOperation_exports, {
|
|
|
149
150
|
import * as Schema3 from "effect/Schema";
|
|
150
151
|
import { Capability } from "@dxos/app-framework";
|
|
151
152
|
import { Operation } from "@dxos/compute";
|
|
152
|
-
import {
|
|
153
|
+
import { DXN as DXN2, Type as Type2, View as View2 } from "@dxos/echo";
|
|
153
154
|
import { meta } from "#meta";
|
|
154
155
|
var makeKey = (name) => DXN2.make(`${meta.profile.key}.operation.${name}`);
|
|
155
156
|
var DeleteCardFieldOutput = Schema3.Struct({
|
|
@@ -243,4 +244,4 @@ export {
|
|
|
243
244
|
Kanban_exports,
|
|
244
245
|
KanbanOperation_exports
|
|
245
246
|
};
|
|
246
|
-
//# sourceMappingURL=chunk-
|
|
247
|
+
//# sourceMappingURL=chunk-7TVVF45P.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/types/constants.ts", "../../../src/types/schema.ts", "../../../src/types/Kanban.ts", "../../../src/types/KanbanOperation.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nexport const UNCATEGORIZED_VALUE = '__uncategorized__' as const;\nexport const UNCATEGORIZED_ATTRIBUTES = {\n title: 'Uncategorized',\n color: 'neutral',\n} as const;\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { TypeInputOptionsAnnotation } from '@dxos/plugin-space';\n\n/**\n * Kanban data model.\n * A Kanban board is a collection of columns, each of which contains a collection of items.\n * The layout of columns and items is controlled by models.\n * The underlying data model may be represented by direct object relationships\n * (e.g., a column object containing an array of ordered items) or projections constructed\n * by the model (e.g., a query of items based on metadata within a column object).\n */\n\n// TODO(wittjosiah): Factor out?\nexport const PivotColumnAnnotationId = Symbol.for('@dxos/plugin-kanban/annotation/PivotColumn');\n\n/**\n * Settings common to every Kanban (view or items). Rendered as form fields\n * by `KanbanProperties`.\n */\nexport const KanbanSettingsSchema = Schema.Struct({\n hideUncategorized: Schema.Boolean.annotations({\n title: 'Hide uncategorized column',\n description: 'When enabled, items without a pivot value won’t be shown as a column.',\n }).pipe(Schema.optional),\n});\n\n/**\n * Settings for view-variant Kanbans only. Spreads {@link KanbanSettingsSchema}'s\n * fields and adds a column-field picker that binds the View’s pivot field.\n * Items-variant kanbans use a hardcoded `spec.pivotField` and don’t expose\n * this control.\n */\nexport const KanbanViewSettingsSchema = Schema.Struct({\n columnFieldId: Schema.String.annotations({\n title: 'Column field',\n }),\n ...KanbanSettingsSchema.fields,\n});\n\nexport const CreateKanbanSchema = Schema.Struct({\n name: Schema.optional(Schema.String),\n // TODO(wittjosiah): This should be a query input instead.\n typename: Schema.String.pipe(\n Schema.annotations({ title: 'Select card type' }),\n TypeInputOptionsAnnotation.set({\n location: ['database', 'runtime'],\n kind: ['user'],\n }),\n Schema.optional,\n ),\n initialPivotColumn: Schema.optional(\n Schema.String.annotations({\n [PivotColumnAnnotationId]: true,\n title: 'Pivot column',\n }),\n ),\n});\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\n// QueryAST is referenced indirectly through `Type.InstanceType<typeof ...Schema>`\n// (Ref.Ref(View.View) → View.View → QueryAST.Query) in the emitted .d.ts; the\n// namespace import keeps the inferred types portable.\n// eslint-disable-next-line unused-imports/no-unused-imports\nimport { Annotation, DXN, Obj, QueryAST, Ref, Type, View } from '@dxos/echo';\nimport { FormInputAnnotation, LabelAnnotation } from '@dxos/echo/Annotation';\nimport { ViewAnnotation } from '@dxos/schema';\n\n/**\n * Per-column entry: ordered card ids plus an optional `hidden` flag that\n * removes the column from the rendered board (and from the model's column\n * list). Today only the uncategorized column is exposed in settings, but\n * the data structure supports per-column hiding generally.\n */\nconst ArrangementColumnEntry = Schema.Struct({\n ids: Schema.Array(Obj.ID),\n hidden: Schema.Boolean.pipe(Schema.optional),\n});\n\n/** Keyed by columnValue. */\nconst ArrangementColumns = Schema.Record({\n key: Schema.String,\n value: ArrangementColumnEntry,\n}).pipe(FormInputAnnotation.set(false));\n\n/** Column order and per-column card ids. */\nexport const Arrangement = Schema.Struct({\n order: Schema.Array(Schema.String).pipe(FormInputAnnotation.set(false)),\n columns: ArrangementColumns,\n}).pipe(FormInputAnnotation.set(false));\n\nexport type Arrangement = Schema.Schema.Type<typeof Arrangement>;\n\n//\n// Mirrors the canonical DXOS pattern (see `Trigger.Spec` in\n// `@dxos/functions/src/types/Trigger.ts` and `Sequence.Source` in\n// `@dxos/plugin-zen`): the `Type.makeObject` schema is a flat `Schema.Struct`,\n// and the discriminated union lives one level down as a single field whose\n// variants are tagged with a `kind` literal.\n//\n\n/** View-variant: items come from running the View's query (the original behaviour). */\nexport const KanbanViewSpec = Schema.Struct({\n kind: Schema.Literal('view').pipe(FormInputAnnotation.set(false)),\n view: Ref.Ref(View.View).pipe(FormInputAnnotation.set(false)),\n});\nexport type KanbanViewSpec = Schema.Schema.Type<typeof KanbanViewSpec>;\n\n/** Items-variant: kanban owns its items as an explicit ref array (used by externally-synced kanbans). */\nexport const KanbanItemsSpec = Schema.Struct({\n kind: Schema.Literal('items').pipe(FormInputAnnotation.set(false)),\n /** Property path on each item that drives column membership (e.g. `'listName'`). */\n pivotField: Schema.String,\n /** Items owned directly by the kanban. */\n items: Schema.Array(Ref.Ref(Obj.Unknown)).pipe(FormInputAnnotation.set(false)),\n});\nexport type KanbanItemsSpec = Schema.Schema.Type<typeof KanbanItemsSpec>;\n\n/** Discriminated union of source specs. Distinguished by `kind`. */\nexport const KanbanSpec = Schema.Union(KanbanViewSpec, KanbanItemsSpec);\nexport type KanbanSpec = Schema.Schema.Type<typeof KanbanSpec>;\n\nexport class Kanban extends Type.makeObject<Kanban>(DXN.make('org.dxos.type.kanban', '0.2.0'))(\n Schema.Struct({\n name: Schema.String.pipe(Schema.optional),\n arrangement: Arrangement,\n /** How this kanban sources its items. Discriminated by `spec.kind`. */\n spec: KanbanSpec,\n }).pipe(\n LabelAnnotation.set(['name']),\n ViewAnnotation.set(['spec', 'view']),\n Annotation.IconAnnotation.set({ icon: 'ph--kanban--regular', hue: 'green' }),\n ),\n) {}\n\n/** Narrowed view-variant kanban. */\nexport type KanbanView = Kanban & { spec: KanbanViewSpec };\n\n/** Narrowed items-variant kanban. */\nexport type KanbanItems = Kanban & { spec: KanbanItemsSpec };\n\nexport const isKanbanView = (kanban: Kanban): kanban is KanbanView => kanban.spec.kind === 'view';\nexport const isKanbanItems = (kanban: Kanban): kanban is KanbanItems => kanban.spec.kind === 'items';\n\ntype MakeViewProps = {\n name?: string;\n view: View.View;\n arrangement?: Arrangement;\n};\n\n/**\n * Make a view-variant kanban (items sourced via the View's query).\n */\nexport const make = (props: MakeViewProps): Kanban => {\n const { name, view, arrangement } = props;\n const order = arrangement?.order ?? [];\n const columns = arrangement?.columns ?? {};\n return Obj.make(Kanban, {\n name,\n arrangement: { order, columns },\n spec: { kind: 'view' as const, view: Ref.make(view) },\n });\n};\n\ntype MakeItemsProps = {\n name?: string;\n arrangement?: Arrangement;\n pivotField: string;\n items?: ReadonlyArray<Ref.Ref<Obj.Unknown>>;\n};\n\n/**\n * Make an items-variant kanban (items list owned by the kanban itself, e.g. populated by a sync integration).\n */\nexport const makeItems = (props: MakeItemsProps): Kanban => {\n const { name, arrangement, pivotField, items = [] } = props;\n const order = arrangement?.order ?? [];\n const columns = arrangement?.columns ?? {};\n return Obj.make(Kanban, {\n name,\n arrangement: { order, columns },\n spec: { kind: 'items' as const, pivotField, items },\n });\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nimport { Capability } from '@dxos/app-framework';\nimport { Operation } from '@dxos/compute';\nimport { DXN, Type, View } from '@dxos/echo';\n\nimport { meta } from '#meta';\n\nconst makeKey = (name: string) => DXN.make(`${meta.profile.key}.operation.${name}`);\n\nexport const DeleteCardFieldOutput = Schema.Struct({\n field: View.FieldSchema.annotations({ description: 'The deleted field schema.' }),\n props: Schema.Any.annotations({ description: 'The deleted field properties.' }),\n index: Schema.Number.annotations({ description: 'The index the field was at.' }),\n});\n\nexport type DeleteCardFieldOutput = Schema.Schema.Type<typeof DeleteCardFieldOutput>;\n\nexport const DeleteCardField = Operation.make({\n meta: {\n key: makeKey('deleteCardField'),\n name: 'Delete Card Field',\n icon: 'ph--minus-circle--regular',\n },\n services: [Capability.Service],\n input: Schema.Struct({\n view: Type.getSchema(View.View),\n fieldId: Schema.String,\n }),\n output: DeleteCardFieldOutput,\n});\n\nexport const DeleteCardOutput = Schema.Struct({\n card: Schema.Any.annotations({ description: 'The deleted card.' }),\n});\n\nexport type DeleteCardOutput = Schema.Schema.Type<typeof DeleteCardOutput>;\n\nexport const DeleteCard = Operation.make({\n meta: { key: makeKey('deleteCard'), name: 'Delete Card', icon: 'ph--trash--regular' },\n input: Schema.Struct({\n card: Schema.Any,\n }),\n output: DeleteCardOutput,\n});\n\nexport const RestoreCardField = Operation.make({\n meta: {\n key: makeKey('restoreCardField'),\n name: 'Restore Card Field',\n icon: 'ph--clock-counter-clockwise--regular',\n },\n services: [Capability.Service],\n input: Schema.Struct({\n view: Type.getSchema(View.View).annotations({ description: 'The view to restore the field to.' }),\n field: View.FieldSchema.annotations({ description: 'The field schema to restore.' }),\n props: Schema.Any.annotations({ description: 'The field properties to restore.' }),\n index: Schema.Number.annotations({ description: 'The index to restore the field at.' }),\n }),\n output: Schema.Void,\n});\n\nexport const RestoreCard = Operation.make({\n meta: {\n key: makeKey('restoreCard'),\n name: 'Restore Card',\n icon: 'ph--clock-counter-clockwise--regular',\n },\n input: Schema.Struct({\n card: Schema.Any.annotations({ description: 'The card to restore.' }),\n }),\n output: Schema.Void,\n});\n"],
|
|
5
|
+
"mappings": ";;;;;AAIO,IAAMA,sBAAsB;AAC5B,IAAMC,2BAA2B;EACtCC,OAAO;EACPC,OAAO;AACT;;;ACJA,YAAYC,YAAY;AAExB,SAASC,kCAAkC;AAYpC,IAAMC,0BAA0BC,uBAAOC,IAAI,4CAAA;AAM3C,IAAMC,uBAA8BC,cAAO;EAChDC,mBAA0BC,eAAQC,YAAY;IAC5CC,OAAO;IACPC,aAAa;EACf,CAAA,EAAGC,KAAYC,eAAQ;AACzB,CAAA;AAQO,IAAMC,2BAAkCR,cAAO;EACpDS,eAAsBC,cAAOP,YAAY;IACvCC,OAAO;EACT,CAAA;EACA,GAAGL,qBAAqBY;AAC1B,CAAA;AAEO,IAAMC,qBAA4BZ,cAAO;EAC9Ca,MAAaN,gBAAgBG,aAAM;;EAEnCI,UAAiBJ,cAAOJ,KACfH,mBAAY;IAAEC,OAAO;EAAmB,CAAA,GAC/CT,2BAA2BoB,IAAI;IAC7BC,UAAU;MAAC;MAAY;;IACvBC,MAAM;MAAC;;EACT,CAAA,GACOV,eAAQ;EAEjBW,oBAA2BX,gBAClBG,cAAOP,YAAY;IACxB,CAACP,uBAAAA,GAA0B;IAC3BQ,OAAO;EACT,CAAA,CAAA;AAEJ,CAAA;;;AC7DA;;;;;;;;;;;;AAIA,YAAYe,aAAY;AAMxB,SAASC,YAAYC,KAAKC,KAAeC,KAAKC,MAAMC,YAAY;AAChE,SAASC,qBAAqBC,uBAAuB;AACrD,SAASC,sBAAsB;AAQ/B,IAAMC,yBA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NCATEGORIZED_VALUE", "UNCATEGORIZED_ATTRIBUTES", "title", "color", "Schema", "TypeInputOptionsAnnotation", "PivotColumnAnnotationId", "Symbol", "for", "KanbanSettingsSchema", "Struct", "hideUncategorized", "Boolean", "annotations", "title", "description", "pipe", "optional", "KanbanViewSettingsSchema", "columnFieldId", "String", "fields", "CreateKanbanSchema", "name", "typename", "set", "location", "kind", "initialPivotColumn", "Schema", "Annotation", "DXN", "Obj", "Ref", "Type", "View", "FormInputAnnotation", "LabelAnnotation", "ViewAnnotation", "ArrangementColumnEntry", "Struct", "ids", "Array", "ID", "hidden", "Boolean", "pipe", "optional", "ArrangementColumns", "Record", "key", "String", "value", "set", "Arrangement", "order", "columns", "KanbanViewSpec", "kind", "Literal", "view", "KanbanItemsSpec", "pivotField", "items", "Unknown", "KanbanSpec", "Union", "Kanban", "makeObject", "make", "name", "arrangement", "spec", "IconAnnotation", "icon", "hue", "isKanbanView", "kanban", "isKanbanItems", "props", "makeItems", "Schema", "Capability", "Operation", "DXN", "Type", "View", "meta", "makeKey", "name", "make", "profile", "key", "DeleteCardFieldOutput", "Struct", "field", "FieldSchema", "annotations", "description", "props", "Any", "index", "Number", "DeleteCardField", "icon", "services", "Service", "input", "view", "getSchema", "fieldId", "String", "output", "DeleteCardOutput", "card", "DeleteCard", "RestoreCardField", "Void", "RestoreCard"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// src/operations/index.ts
|
|
2
|
+
import { OperationHandlerSet } from "@dxos/compute";
|
|
3
|
+
var KanbanOperationHandlerSet = OperationHandlerSet.lazy(() => import("./delete-card-TK2G6YHX.mjs"), () => import("./delete-card-field-LGWPBOUW.mjs"), () => import("./restore-card-3O6PVN7J.mjs"), () => import("./restore-card-field-5G4DVYYY.mjs"));
|
|
4
|
+
|
|
5
|
+
export {
|
|
6
|
+
KanbanOperationHandlerSet
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=chunk-7YLGUKDJ.mjs.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// src/skills/kanban-skill.ts
|
|
2
|
+
import { Skill, Template } from "@dxos/compute";
|
|
3
|
+
import { trim } from "@dxos/util";
|
|
4
|
+
var SKILL_KEY = "org.dxos.skill.kanban";
|
|
5
|
+
var make = () => Skill.make({
|
|
6
|
+
key: SKILL_KEY,
|
|
7
|
+
name: "Kanban",
|
|
8
|
+
tools: Skill.toolDefinitions({
|
|
9
|
+
tools: []
|
|
10
|
+
}),
|
|
11
|
+
instructions: Template.make({
|
|
12
|
+
source: trim`
|
|
13
|
+
You can create and update kanban boards to show data in sorted columns defined by schema.
|
|
14
|
+
`
|
|
15
|
+
})
|
|
16
|
+
});
|
|
17
|
+
var skill = {
|
|
18
|
+
key: SKILL_KEY,
|
|
19
|
+
make
|
|
20
|
+
};
|
|
21
|
+
var kanban_skill_default = skill;
|
|
22
|
+
|
|
23
|
+
export {
|
|
24
|
+
kanban_skill_default
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=chunk-CFPH5R6P.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/skills/kanban-skill.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Skill, Template } from '@dxos/compute';\nimport { trim } from '@dxos/util';\n\nconst SKILL_KEY = 'org.dxos.skill.kanban';\n\nconst make = () =>\n Skill.make({\n key: SKILL_KEY,\n name: 'Kanban',\n tools: Skill.toolDefinitions({ tools: [] }),\n instructions: Template.make({\n source: trim`\n You can create and update kanban boards to show data in sorted columns defined by schema.\n `,\n }),\n });\n\nconst skill: Skill.Definition = {\n key: SKILL_KEY,\n make,\n};\n\nexport default skill;\n"],
|
|
5
|
+
"mappings": ";AAIA,SAASA,OAAOC,gBAAgB;AAChC,SAASC,YAAY;AAErB,IAAMC,YAAY;AAElB,IAAMC,OAAO,MACXJ,MAAMI,KAAK;EACTC,KAAKF;EACLG,MAAM;EACNC,OAAOP,MAAMQ,gBAAgB;IAAED,OAAO,CAAA;EAAG,CAAA;EACzCE,cAAcR,SAASG,KAAK;IAC1BM,QAAQR;;;EAGV,CAAA;AACF,CAAA;AAEF,IAAMS,QAA0B;EAC9BN,KAAKF;EACLC;AACF;AAEA,IAAA,uBAAeO;",
|
|
6
|
+
"names": ["Skill", "Template", "trim", "SKILL_KEY", "make", "key", "name", "tools", "toolDefinitions", "instructions", "source", "skill"]
|
|
7
|
+
}
|
|
@@ -24,7 +24,7 @@ var dx_config_default = Config2.make({
|
|
|
24
24
|
optionally hide the uncategorized column for items that have no pivot value.
|
|
25
25
|
Field-level undo support allows deleted card fields to be restored without data loss.
|
|
26
26
|
|
|
27
|
-
The plugin contributes a Kanban
|
|
27
|
+
The plugin contributes a Kanban skill that exposes board creation and card management
|
|
28
28
|
to AI agents, enabling automated project tracking workflows.
|
|
29
29
|
`,
|
|
30
30
|
source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-kanban",
|
|
@@ -47,4 +47,4 @@ var meta = Plugin.getMetaFromConfig(dx_config_default);
|
|
|
47
47
|
export {
|
|
48
48
|
meta
|
|
49
49
|
};
|
|
50
|
-
//# sourceMappingURL=chunk-
|
|
50
|
+
//# sourceMappingURL=chunk-V4AVOJVU.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/meta.ts", "../../../dx.config.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\n\nimport config from '../dx.config';\n\nexport const meta = Plugin.getMetaFromConfig(config);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Config2 } from '@dxos/app-framework/config';\nimport { trim } from '@dxos/util';\n\nexport default Config2.make({\n plugin: {\n key: 'org.dxos.plugin.kanban',\n name: 'Kanban',\n author: 'DXOS',\n description: trim`\n Visual project management using customizable kanban boards to track workflow progress.\n Organize any ECHO type into drag-and-drop columns defined by a single-select field, move cards\n between stages, and reorder both columns and cards — all changes are persisted to ECHO and\n replicated to collaborators in real time.\n\n Kanban boards come in two variants: view-variant boards source their cards through a linked\n View query (any ECHO type can be pivoted on a single-select field), while items-variant boards\n own their cards explicitly and are used by external sync integrations such as Linear or GitHub.\n Both variants share the same arrangement storage and drag-and-drop mechanics.\n\n Board settings let users choose which single-select field drives the column layout and\n optionally hide the uncategorized column for items that have no pivot value.\n Field-level undo support allows deleted card fields to be restored without data loss.\n\n The plugin contributes a Kanban
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\n\nimport config from '../dx.config';\n\nexport const meta = Plugin.getMetaFromConfig(config);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Config2 } from '@dxos/app-framework/config';\nimport { trim } from '@dxos/util';\n\nexport default Config2.make({\n plugin: {\n key: 'org.dxos.plugin.kanban',\n name: 'Kanban',\n author: 'DXOS',\n description: trim`\n Visual project management using customizable kanban boards to track workflow progress.\n Organize any ECHO type into drag-and-drop columns defined by a single-select field, move cards\n between stages, and reorder both columns and cards — all changes are persisted to ECHO and\n replicated to collaborators in real time.\n\n Kanban boards come in two variants: view-variant boards source their cards through a linked\n View query (any ECHO type can be pivoted on a single-select field), while items-variant boards\n own their cards explicitly and are used by external sync integrations such as Linear or GitHub.\n Both variants share the same arrangement storage and drag-and-drop mechanics.\n\n Board settings let users choose which single-select field drives the column layout and\n optionally hide the uncategorized column for items that have no pivot value.\n Field-level undo support allows deleted card fields to be restored without data loss.\n\n The plugin contributes a Kanban skill that exposes board creation and card management\n to AI agents, enabling automated project tracking workflows.\n `,\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-kanban',\n icon: { key: 'ph--kanban--regular', hue: 'green' },\n spec: 'PLUGIN.mdl',\n screenshots: [{ dark: 'https://dxos.network/plugin-details-kanban-dark.png' }],\n },\n});\n"],
|
|
5
5
|
"mappings": ";AAIA,SAASA,cAAc;;;ACAvB,SAASC,eAAe;AACxB,SAASC,YAAY;AAErB,IAAA,oBAAeD,QAAQE,KAAK;EAC1BC,QAAQ;IACNC,KAAK;IACLC,MAAM;IACNC,QAAQ;IACRC,aAAaN;;;;;;;;;;;;;;;;;;IAkBbO,QAAQ;IACRC,MAAM;MAAEL,KAAK;MAAuBM,KAAK;IAAQ;IACjDC,MAAM;IACNC,aAAa;MAAC;QAAEC,MAAM;MAAsD;;EAC9E;AACF,CAAA;;;AD3BO,IAAMC,OAAOC,OAAOC,kBAAkBC,iBAAAA;",
|
|
6
6
|
"names": ["Plugin", "Config2", "trim", "make", "plugin", "key", "name", "author", "description", "source", "icon", "hue", "spec", "screenshots", "dark", "meta", "Plugin", "getMetaFromConfig", "config"]
|
|
7
7
|
}
|
|
@@ -2,10 +2,10 @@ import "../chunk-J5LGTIGS.mjs";
|
|
|
2
2
|
|
|
3
3
|
// src/containers/index.ts
|
|
4
4
|
import { lazy } from "react";
|
|
5
|
-
var KanbanArticle = lazy(() => import("../KanbanArticle-
|
|
6
|
-
var
|
|
5
|
+
var KanbanArticle = lazy(() => import("../KanbanArticle-JQMQQHRB.mjs"));
|
|
6
|
+
var KanbanProperties = lazy(() => import("../KanbanProperties-W7MZNZVJ.mjs"));
|
|
7
7
|
export {
|
|
8
8
|
KanbanArticle,
|
|
9
|
-
|
|
9
|
+
KanbanProperties
|
|
10
10
|
};
|
|
11
11
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/containers/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { type ComponentType, lazy } from 'react';\n\nexport const KanbanArticle: ComponentType<any> = lazy(() => import('./KanbanArticle'));\nexport const
|
|
5
|
-
"mappings": ";;;AAIA,SAA6BA,YAAY;AAElC,IAAMC,gBAAoCD,KAAK,MAAM,OAAO,+BAAA,CAAA;AAC5D,IAAME,
|
|
6
|
-
"names": ["lazy", "KanbanArticle", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { type ComponentType, lazy } from 'react';\n\nexport const KanbanArticle: ComponentType<any> = lazy(() => import('./KanbanArticle'));\nexport const KanbanProperties: ComponentType<any> = lazy(() => import('./KanbanProperties'));\n"],
|
|
5
|
+
"mappings": ";;;AAIA,SAA6BA,YAAY;AAElC,IAAMC,gBAAoCD,KAAK,MAAM,OAAO,+BAAA,CAAA;AAC5D,IAAME,mBAAuCF,KAAK,MAAM,OAAO,kCAAA,CAAA;",
|
|
6
|
+
"names": ["lazy", "KanbanArticle", "KanbanProperties"]
|
|
7
7
|
}
|