chore: space folders (#8707)

* chore: change the space folders structure

* fix: format
This commit is contained in:
sriram veeraghanta 2026-03-05 14:03:54 +05:30 committed by GitHub
parent be8836642a
commit 7fb6696c67
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
154 changed files with 30 additions and 197 deletions

View file

@ -0,0 +1,8 @@
/**
* Copyright (c) 2023-present Plane Software, Inc. and contributors
* SPDX-License-Identifier: AGPL-3.0-only
* See the LICENSE file for details.
*/
export * from "./use-publish-list";
export * from "./use-publish";

View file

@ -0,0 +1,17 @@
/**
* Copyright (c) 2023-present Plane Software, Inc. and contributors
* SPDX-License-Identifier: AGPL-3.0-only
* See the LICENSE file for details.
*/
import { useContext } from "react";
// lib
import { StoreContext } from "@/lib/store-provider";
// store
import type { IPublishListStore } from "@/store/publish/publish_list.store";
export const usePublishList = (): IPublishListStore => {
const context = useContext(StoreContext);
if (context === undefined) throw new Error("usePublishList must be used within StoreProvider");
return context.publishList;
};

View file

@ -0,0 +1,17 @@
/**
* Copyright (c) 2023-present Plane Software, Inc. and contributors
* SPDX-License-Identifier: AGPL-3.0-only
* See the LICENSE file for details.
*/
import { useContext } from "react";
// lib
import { StoreContext } from "@/lib/store-provider";
// store
import type { PublishStore } from "@/store/publish/publish.store";
export const usePublish = (anchor: string): PublishStore => {
const context = useContext(StoreContext);
if (context === undefined) throw new Error("usePublish must be used within StoreProvider");
return context.publishList.publishMap?.[anchor] ?? {};
};

View file

@ -0,0 +1,17 @@
/**
* Copyright (c) 2023-present Plane Software, Inc. and contributors
* SPDX-License-Identifier: AGPL-3.0-only
* See the LICENSE file for details.
*/
import { useContext } from "react";
// lib
import { StoreContext } from "@/lib/store-provider";
// store
import type { ICycleStore } from "@/store/cycle.store";
export const useCycle = (): ICycleStore => {
const context = useContext(StoreContext);
if (context === undefined) throw new Error("useCycle must be used within StoreProvider");
return context.cycle;
};

View file

@ -0,0 +1,17 @@
/**
* Copyright (c) 2023-present Plane Software, Inc. and contributors
* SPDX-License-Identifier: AGPL-3.0-only
* See the LICENSE file for details.
*/
import { useContext } from "react";
// lib
import { StoreContext } from "@/lib/store-provider";
// store
import type { IInstanceStore } from "@/store/instance.store";
export const useInstance = (): IInstanceStore => {
const context = useContext(StoreContext);
if (context === undefined) throw new Error("useUserProfile must be used within StoreProvider");
return context.instance;
};

View file

@ -0,0 +1,17 @@
/**
* Copyright (c) 2023-present Plane Software, Inc. and contributors
* SPDX-License-Identifier: AGPL-3.0-only
* See the LICENSE file for details.
*/
import { useContext } from "react";
// lib
import { StoreContext } from "@/lib/store-provider";
// store
import type { IIssueDetailStore } from "@/store/issue-detail.store";
export const useIssueDetails = (): IIssueDetailStore => {
const context = useContext(StoreContext);
if (context === undefined) throw new Error("useUserProfile must be used within StoreProvider");
return context.issueDetail;
};

View file

@ -0,0 +1,17 @@
/**
* Copyright (c) 2023-present Plane Software, Inc. and contributors
* SPDX-License-Identifier: AGPL-3.0-only
* See the LICENSE file for details.
*/
import { useContext } from "react";
// lib
import { StoreContext } from "@/lib/store-provider";
// store
import type { IIssueFilterStore } from "@/store/issue-filters.store";
export const useIssueFilter = (): IIssueFilterStore => {
const context = useContext(StoreContext);
if (context === undefined) throw new Error("useUserProfile must be used within StoreProvider");
return context.issueFilter;
};

View file

@ -0,0 +1,17 @@
/**
* Copyright (c) 2023-present Plane Software, Inc. and contributors
* SPDX-License-Identifier: AGPL-3.0-only
* See the LICENSE file for details.
*/
import { useContext } from "react";
// lib
import { StoreContext } from "@/lib/store-provider";
// store
import type { IIssueStore } from "@/store/issue.store";
export const useIssue = (): IIssueStore => {
const context = useContext(StoreContext);
if (context === undefined) throw new Error("useIssue must be used within StoreProvider");
return context.issue;
};

View file

@ -0,0 +1,17 @@
/**
* Copyright (c) 2023-present Plane Software, Inc. and contributors
* SPDX-License-Identifier: AGPL-3.0-only
* See the LICENSE file for details.
*/
import { useContext } from "react";
// lib
import { StoreContext } from "@/lib/store-provider";
// store
import type { IIssueLabelStore } from "@/store/label.store";
export const useLabel = (): IIssueLabelStore => {
const context = useContext(StoreContext);
if (context === undefined) throw new Error("useLabel must be used within StoreProvider");
return context.label;
};

View file

@ -0,0 +1,17 @@
/**
* Copyright (c) 2023-present Plane Software, Inc. and contributors
* SPDX-License-Identifier: AGPL-3.0-only
* See the LICENSE file for details.
*/
import { useContext } from "react";
// lib
import { StoreContext } from "@/lib/store-provider";
// store
import type { IIssueMemberStore } from "@/store/members.store";
export const useMember = (): IIssueMemberStore => {
const context = useContext(StoreContext);
if (context === undefined) throw new Error("useMember must be used within StoreProvider");
return context.member;
};

View file

@ -0,0 +1,17 @@
/**
* Copyright (c) 2023-present Plane Software, Inc. and contributors
* SPDX-License-Identifier: AGPL-3.0-only
* See the LICENSE file for details.
*/
import { useContext } from "react";
// lib
import { StoreContext } from "@/lib/store-provider";
// store
import type { IIssueModuleStore } from "@/store/module.store";
export const useModule = (): IIssueModuleStore => {
const context = useContext(StoreContext);
if (context === undefined) throw new Error("useModule must be used within StoreProvider");
return context.module;
};

View file

@ -0,0 +1,17 @@
/**
* Copyright (c) 2023-present Plane Software, Inc. and contributors
* SPDX-License-Identifier: AGPL-3.0-only
* See the LICENSE file for details.
*/
import { useContext } from "react";
// lib
import { StoreContext } from "@/lib/store-provider";
// store
import type { IStateStore } from "@/store/state.store";
export const useStates = (): IStateStore => {
const context = useContext(StoreContext);
if (context === undefined) throw new Error("useState must be used within StoreProvider");
return context.state;
};

View file

@ -0,0 +1,17 @@
/**
* Copyright (c) 2023-present Plane Software, Inc. and contributors
* SPDX-License-Identifier: AGPL-3.0-only
* See the LICENSE file for details.
*/
import { useContext } from "react";
// lib
import { StoreContext } from "@/lib/store-provider";
// store
import type { IProfileStore } from "@/store/profile.store";
export const useUserProfile = (): IProfileStore => {
const context = useContext(StoreContext);
if (context === undefined) throw new Error("useUserProfile must be used within StoreProvider");
return context.user.profile;
};

View file

@ -0,0 +1,17 @@
/**
* Copyright (c) 2023-present Plane Software, Inc. and contributors
* SPDX-License-Identifier: AGPL-3.0-only
* See the LICENSE file for details.
*/
import { useContext } from "react";
// lib
import { StoreContext } from "@/lib/store-provider";
// store
import type { IUserStore } from "@/store/user.store";
export const useUser = (): IUserStore => {
const context = useContext(StoreContext);
if (context === undefined) throw new Error("useUser must be used within StoreProvider");
return context.user;
};