@nocobase/plugin-kanban 0.21.0-alpha.8 → 1.0.0-alpha.1

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.
@@ -257,7 +257,7 @@ Error generating stack: `+o.message+`
257
257
  height: 100%;
258
258
  }
259
259
  }
260
- `})),ZE=()=>{const e=ee.useForm(),{column:r,groupField:n}=D.useContext(Ks),{onClick:t}=I.useCreateActionProps();return{onClick(){return Br(this,null,function*(){e.setValuesIn(n.name,r.id),yield t()})}}},eI=(e,r=[],n)=>{const t={__unknown__:{id:"__unknown__",title:"Unknown",color:"default",cards:[]}};return e.uiSchema.enum.forEach(i=>{t[i.value]={id:i.value,title:i.label,color:i.color,cards:[]}}),r.forEach(i=>{const o=i[e.name];o&&t[o]?t[o].cards.push(G(L({},i),{id:i[n]})):t.__unknown__.cards.push(i)}),t.__unknown__.cards.length===0&&delete t.__unknown__,Object.values(t)},qs=D.memo(ee.RecursionField);qs.displayName="MemorizedRecursionField";const En=I.withDynamicSchemaProps(ee.observer(e=>{const{styles:r}=JE(),v=I.useProps(e),{groupField:n,onCardDragEnd:t,dataSource:i,setDataSource:o}=v,a=Ba(v,["groupField","onCardDragEnd","dataSource","setDataSource"]),u=I.useCollection().getPrimaryKey(),s=I.useCollectionParentRecordData(),f=ee.useField(),c=ee.useFieldSchema(),[d,p]=D.useState(!1),h=D.useMemo(()=>c.reduceProperties((m,y)=>(y["x-component"].endsWith(".Card")?m.card=y:y["x-component"].endsWith(".CardAdder")?m.cardAdder=y:y["x-component"].endsWith(".CardViewer")&&(m.cardViewer=y),m),{card:null,cardAdder:null,cardViewer:null}),[]),S=D.useCallback((m,y)=>{const C=Oa.removeCard({columns:f.value},y,m);f.value=C.columns,o(C.columns)},[f]),w=D.useRef(null),g=D.useCallback((m,y,C)=>{w.current=m[u],t==null||t({columns:f.value,groupField:n},y,C);const b=Oa.moveCard({columns:f.value},y,C);f.value=b.columns,o(b.columns)},[f]);return x.jsx(qe.Spin,{wrapperClassName:r.nbKanban,spinning:f.loading||!1,children:x.jsx(Oa,G(L({},a),{allowAddCard:!!h.cardAdder,disableColumnDrag:!0,cardAdderPosition:"bottom",disableCardDrag:a.disableCardDrag||d,onCardRemove:S,onCardDragEnd:g,renderColumnHeader:({title:m,color:y})=>x.jsx("div",{className:"react-kanban-column-header",children:x.jsx(qe.Tag,{color:y,children:m})}),renderCard:(m,{column:y,dragging:C})=>{var T;const b=i==null?void 0:i.indexOf(y),E=(T=y==null?void 0:y.cards)==null?void 0:T.indexOf(m),{ref:N,inView:A}=fm({threshold:0,triggerOnce:!0,initialInView:w.current&&w.current===m[u]});return h.card&&x.jsx(I.RecordProvider,{record:m,parent:s,children:x.jsx(Vs.Provider,{value:{setDisableCardDrag:p,cardViewerSchema:h.cardViewer,cardField:f,card:m,column:y,dragging:C,columnIndex:b,cardIndex:E},children:x.jsx("div",{ref:N,children:A?x.jsx(qs,{name:h.card.name,schema:h.card}):x.jsx(qe.Card,{bordered:!1,children:x.jsx(qe.Skeleton,{active:!0,paragraph:{rows:4}})})})})})},renderCardAdder:({column:m})=>h.cardAdder?x.jsx(Ks.Provider,{value:{column:m,groupField:n},children:x.jsx(I.SchemaComponentOptions,{scope:{useCreateActionProps:ZE},children:x.jsx(qs,{name:h.cardAdder.name,schema:h.cardAdder})})}):null,children:{columns:i||[]}}))})}),{displayName:"Kanban"}),ft="kanban";function rI(){return In.useTranslation(ft,{nsMode:"fallback"})}const nI=br.css`
260
+ `})),ZE=()=>{const e=ee.useForm(),{column:r,groupField:n}=D.useContext(Ks),{onClick:t}=I.useCreateActionProps();return{onClick(){return Br(this,null,function*(){e.setValuesIn(n.name,r.id),yield t()})}}},eI=(e,r=[],n)=>{const t={__unknown__:{id:"__unknown__",title:"Unknown",color:"default",cards:[]}};return e.uiSchema.enum.forEach(i=>{t[i.value]={id:i.value,title:i.label,color:i.color,cards:[]}}),r.forEach(i=>{const o=i[e.name];o&&t[o]?t[o].cards.push(G(L({},i),{id:i[n]})):t.__unknown__.cards.push(i)}),t.__unknown__.cards.length===0&&delete t.__unknown__,Object.values(t)},qs=D.memo(ee.RecursionField);qs.displayName="MemorizedRecursionField";const En=I.withDynamicSchemaProps(ee.observer(e=>{const{styles:r}=JE(),v=I.useProps(e),{groupField:n,onCardDragEnd:t,dataSource:i,setDataSource:o}=v,a=Ba(v,["groupField","onCardDragEnd","dataSource","setDataSource"]),u=I.useCollection().getPrimaryKey(),s=I.useCollectionParentRecordData(),f=ee.useField(),c=ee.useFieldSchema(),[d,p]=D.useState(!1),h=D.useMemo(()=>c.reduceProperties((m,y)=>(y["x-component"].endsWith(".Card")?m.card=y:y["x-component"].endsWith(".CardAdder")?m.cardAdder=y:y["x-component"].endsWith(".CardViewer")&&(m.cardViewer=y),m),{card:null,cardAdder:null,cardViewer:null}),[]),S=D.useCallback((m,y)=>{const C=Oa.removeCard({columns:f.value},y,m);f.value=C.columns,o(C.columns)},[f]),w=D.useRef(null),g=D.useCallback((m,y,C)=>{w.current=m[u],t==null||t({columns:f.value,groupField:n},y,C);const b=Oa.moveCard({columns:f.value},y,C);f.value=b.columns,o(b.columns)},[f]);return x.jsx(qe.Spin,{wrapperClassName:r.nbKanban,spinning:f.loading||!1,children:x.jsx(Oa,G(L({},a),{allowAddCard:!!h.cardAdder,disableColumnDrag:!0,cardAdderPosition:"bottom",disableCardDrag:a.disableCardDrag||d,onCardRemove:S,onCardDragEnd:g,renderColumnHeader:({title:m,color:y})=>x.jsx("div",{className:"react-kanban-column-header",children:x.jsx(qe.Tag,{color:y,children:m})}),renderCard:(m,{column:y,dragging:C})=>{var T;const b=i==null?void 0:i.indexOf(y),E=(T=y==null?void 0:y.cards)==null?void 0:T.indexOf(m),{ref:N,inView:A}=fm({threshold:0,triggerOnce:!0,initialInView:w.current&&w.current===m[u]});return h.card&&x.jsx(I.RecordProvider,{record:m,parent:s,children:x.jsx(Vs.Provider,{value:{setDisableCardDrag:p,cardViewerSchema:h.cardViewer,cardField:f,card:m,column:y,dragging:C,columnIndex:b,cardIndex:E},children:x.jsx("div",{ref:N,children:A?x.jsx(qs,{name:h.card.name,schema:h.card}):x.jsx(qe.Card,{bordered:!1,children:x.jsx(qe.Skeleton,{paragraph:{rows:4}})})})})})},renderCardAdder:({column:m})=>h.cardAdder?x.jsx(Ks.Provider,{value:{column:m,groupField:n},children:x.jsx(I.SchemaComponentOptions,{scope:{useCreateActionProps:ZE},children:x.jsx(qs,{name:h.cardAdder.name,schema:h.cardAdder})})}):null,children:{columns:i||[]}}))})}),{displayName:"Kanban"}),ft="kanban";function rI(){return In.useTranslation([ft,"client"],{nsMode:"fallback"})}const nI=br.css`
261
261
  .ant-card-body {
262
262
  padding: 16px;
263
263
  }
@@ -1,4 +1,4 @@
1
1
  export declare const NAMESPACE = "kanban";
2
2
  export declare function lang(key: string): string;
3
3
  export declare function generateNTemplate(key: string): string;
4
- export declare function useKanbanTranslation(): import("react-i18next").UseTranslationResponse<"kanban", undefined>;
4
+ export declare function useKanbanTranslation(): import("react-i18next").UseTranslationResponse<("kanban" | "client")[], undefined>;
@@ -2,7 +2,7 @@ module.exports = {
2
2
  "@ant-design/icons": "5.2.6",
3
3
  "@formily/react": "2.3.0",
4
4
  "@formily/shared": "2.3.0",
5
- "@nocobase/client": "0.21.0-alpha.8",
5
+ "@nocobase/client": "1.0.0-alpha.1",
6
6
  "antd": "5.12.8",
7
7
  "react": "18.2.0",
8
8
  "react-i18next": "11.18.6",
@@ -10,7 +10,7 @@ module.exports = {
10
10
  "@formily/antd-v5": "1.1.9",
11
11
  "@formily/core": "2.3.0",
12
12
  "lodash": "4.17.21",
13
- "@nocobase/server": "0.21.0-alpha.8",
14
- "@nocobase/test": "0.21.0-alpha.8",
13
+ "@nocobase/server": "1.0.0-alpha.1",
14
+ "@nocobase/test": "1.0.0-alpha.1",
15
15
  "antd-style": "3.4.5"
16
16
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-kanban",
3
- "version": "0.21.0-alpha.8",
3
+ "version": "1.0.0-alpha.1",
4
4
  "main": "dist/server/index.js",
5
5
  "homepage": "https://docs.nocobase.com/handbook/block-kanban",
6
6
  "homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/block-kanban",
@@ -10,14 +10,14 @@
10
10
  "description": "Provides kanban block.",
11
11
  "description.zh-CN": "提供看板区块。",
12
12
  "peerDependencies": {
13
- "@nocobase/client": "0.x",
14
- "@nocobase/server": "0.x",
15
- "@nocobase/test": "0.x"
13
+ "@nocobase/client": "1.x",
14
+ "@nocobase/server": "1.x",
15
+ "@nocobase/test": "1.x"
16
16
  },
17
17
  "dependencies": {
18
18
  "react-intersection-observer": "^9.8.1"
19
19
  },
20
- "gitHead": "bed69485709bc8e268285b50debfc1ebfd7a30c7",
20
+ "gitHead": "c73b6d2032a6151fdfeebeb0ec923d766578c53c",
21
21
  "keywords": [
22
22
  "Blocks"
23
23
  ]