@declarion/react 0.1.1 → 0.1.2

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.
Files changed (46) hide show
  1. package/dist-lib/api/auth.d.ts +1 -1
  2. package/dist-lib/api/data.d.ts +2 -2
  3. package/dist-lib/api/entities.d.ts +1 -1
  4. package/dist-lib/api/params.d.ts +1 -1
  5. package/dist-lib/api/properties.d.ts +1 -1
  6. package/dist-lib/api/schema.d.ts +1 -1
  7. package/dist-lib/api/status.d.ts +1 -1
  8. package/dist-lib/components/detail-layout/AssociatedBlock.d.ts +1 -1
  9. package/dist-lib/components/detail-layout/AssociatedToolbar.d.ts +1 -1
  10. package/dist-lib/components/detail-layout/ChildrenBlock.d.ts +2 -2
  11. package/dist-lib/components/detail-layout/DraggableChildrenTable.d.ts +3 -3
  12. package/dist-lib/components/detail-layout/EditableChildrenTable.d.ts +3 -3
  13. package/dist-lib/components/detail-layout/LayoutColumn.d.ts +1 -1
  14. package/dist-lib/components/detail-layout/LayoutRenderer.d.ts +3 -3
  15. package/dist-lib/components/detail-layout/LayoutRow.d.ts +1 -1
  16. package/dist-lib/components/detail-layout/LayoutTabs.d.ts +1 -1
  17. package/dist-lib/components/detail-layout/PropertiesBlock.d.ts +1 -1
  18. package/dist-lib/components/detail-layout/QuickAddForm.d.ts +2 -2
  19. package/dist-lib/components/detail-layout/SectionBlock.d.ts +1 -1
  20. package/dist-lib/components/detail-layout/StatusesBlock.d.ts +1 -1
  21. package/dist-lib/components/detail-layout/TimelineComposer.d.ts +2 -2
  22. package/dist-lib/components/detail-layout/useQuickAdd.d.ts +2 -2
  23. package/dist-lib/components/fields/index.d.ts +1 -1
  24. package/dist-lib/components/filters/FilterChips.d.ts +1 -1
  25. package/dist-lib/components/filters/FilterDrawer.d.ts +1 -1
  26. package/dist-lib/components/shared/ActionButton.d.ts +1 -1
  27. package/dist-lib/components/shared/ActionDialog.d.ts +1 -1
  28. package/dist-lib/components/shared/AssociationTabs.d.ts +1 -1
  29. package/dist-lib/components/shared/RowActionItem.d.ts +1 -1
  30. package/dist-lib/components/shared/StatusGroupsDisplay.d.ts +2 -2
  31. package/dist-lib/hooks/useAssociatedData.d.ts +1 -1
  32. package/dist-lib/hooks/useChildrenData.d.ts +1 -1
  33. package/dist-lib/hooks/useEntity.d.ts +1 -1
  34. package/dist-lib/hooks/useEntityData.d.ts +2 -2
  35. package/dist-lib/hooks/useEntityItem.d.ts +1 -1
  36. package/dist-lib/hooks/useFilters.d.ts +1 -1
  37. package/dist-lib/hooks/useMutations.d.ts +3 -3
  38. package/dist-lib/hooks/useScreen.d.ts +1 -1
  39. package/dist-lib/hooks/useViews.d.ts +1 -1
  40. package/dist-lib/lib/actions.d.ts +1 -1
  41. package/dist-lib/lib/child-config.d.ts +1 -1
  42. package/dist-lib/lib/children-validation.d.ts +2 -2
  43. package/dist-lib/lib/size-value.d.ts +1 -1
  44. package/dist-lib/lib/theme-utils.d.ts +1 -1
  45. package/dist-lib/stores/auth.d.ts +1 -1
  46. package/package.json +3 -2
@@ -1,4 +1,4 @@
1
- import type { CheckSetupResponse, LoginResponse, AuthUser, Tenant, SSOProvider } from "@/types/api";
1
+ import type { CheckSetupResponse, LoginResponse, AuthUser, Tenant, SSOProvider } from "../types/api";
2
2
  export declare function checkSetup(): Promise<CheckSetupResponse>;
3
3
  export declare function login(email: string, password: string): Promise<LoginResponse>;
4
4
  export declare function signup(email: string, password: string, displayName: string): Promise<LoginResponse>;
@@ -1,5 +1,5 @@
1
- import type { ListParams, ListResponse, DataResponse } from "@/types/api";
2
- import type { PkValues } from "@/types/schema";
1
+ import type { ListParams, ListResponse, DataResponse } from "../types/api";
2
+ import type { PkValues } from "../types/schema";
3
3
  export declare function listEntities(entity: string, params?: ListParams): Promise<ListResponse>;
4
4
  export declare function getEntity(entity: string, pkValues: PkValues | string): Promise<DataResponse>;
5
5
  export declare function createEntity(entity: string, data: Record<string, unknown>): Promise<DataResponse>;
@@ -1,4 +1,4 @@
1
- import type { Refs, V2ListParams, V2Meta, V2StatusInstance, V2PropertyInstance, EnrichedRow } from "@/types/api";
1
+ import type { Refs, V2ListParams, V2Meta, V2StatusInstance, V2PropertyInstance, EnrichedRow } from "../types/api";
2
2
  /** Helper methods injected onto enriched rows. */
3
3
  export interface RowHelpers {
4
4
  $status(groupCode: string): V2StatusInstance | undefined;
@@ -1,3 +1,3 @@
1
- import type { PublicParam, ResolvedParam } from "@/types/api";
1
+ import type { PublicParam, ResolvedParam } from "../types/api";
2
2
  export declare function fetchPublicParams(): Promise<PublicParam[]>;
3
3
  export declare function fetchParam(code: string): Promise<ResolvedParam>;
@@ -1,3 +1,3 @@
1
- import type { PropertyValue } from "@/types/api";
1
+ import type { PropertyValue } from "../types/api";
2
2
  export declare function setObjectProperty(entity: string, id: string, propertyCode: string, value: unknown): Promise<PropertyValue>;
3
3
  export declare function deleteObjectProperty(entity: string, id: string, propertyCode: string): Promise<void>;
@@ -1,2 +1,2 @@
1
- import type { Schema } from "@/types/schema";
1
+ import type { Schema } from "../types/schema";
2
2
  export declare function fetchSchema(): Promise<Schema>;
@@ -1,2 +1,2 @@
1
- import type { StatusInfo } from "@/types/api";
1
+ import type { StatusInfo } from "../types/api";
2
2
  export declare function setObjectStatus(entity: string, id: string, groupCode: string, statusCode: string, note?: string): Promise<StatusInfo>;
@@ -1,4 +1,4 @@
1
- import type { LayoutNode } from "@/types/schema";
1
+ import type { LayoutNode } from "../../types/schema";
2
2
  import type { LayoutContext } from "./LayoutRenderer";
3
3
  interface AssociatedBlockProps {
4
4
  node: LayoutNode;
@@ -1,4 +1,4 @@
1
- import type { Entity } from "@/types/schema";
1
+ import type { Entity } from "../../types/schema";
2
2
  interface AssociatedToolbarProps {
3
3
  entity: Entity;
4
4
  searchable?: boolean;
@@ -1,5 +1,5 @@
1
- import type { LayoutNode, Schema } from "@/types/schema";
2
- import { type ResolvedChildConfig } from "@/lib/child-config";
1
+ import type { LayoutNode, Schema } from "../../types/schema";
2
+ import { type ResolvedChildConfig } from "../../lib/child-config";
3
3
  import type { LayoutContext } from "./LayoutRenderer";
4
4
  interface ChildrenBlockProps {
5
5
  node: LayoutNode;
@@ -1,7 +1,7 @@
1
- import type { Entity, Schema } from "@/types/schema";
2
- import type { RefsMap } from "@/components/fields";
1
+ import type { Entity, Schema } from "../../types/schema";
2
+ import type { RefsMap } from "../../components/fields";
3
3
  import type { PendingChildRow } from "./LayoutRenderer";
4
- import type { ResolvedChildConfig } from "@/lib/child-config";
4
+ import type { ResolvedChildConfig } from "../../lib/child-config";
5
5
  interface DraggableChildrenTableProps {
6
6
  config: ResolvedChildConfig;
7
7
  childEntity: Entity;
@@ -1,7 +1,7 @@
1
- import type { Entity, Schema } from "@/types/schema";
2
- import type { RefsMap } from "@/components/fields";
1
+ import type { Entity, Schema } from "../../types/schema";
2
+ import type { RefsMap } from "../../components/fields";
3
3
  import type { PendingChildRow } from "./LayoutRenderer";
4
- import type { ResolvedChildConfig } from "@/lib/child-config";
4
+ import type { ResolvedChildConfig } from "../../lib/child-config";
5
5
  interface EditableChildrenTableProps {
6
6
  config: ResolvedChildConfig;
7
7
  childEntity: Entity;
@@ -1,4 +1,4 @@
1
- import type { ColumnConfig, LayoutNode } from "@/types/schema";
1
+ import type { ColumnConfig, LayoutNode } from "../../types/schema";
2
2
  import { type LayoutContext } from "./LayoutRenderer";
3
3
  interface LayoutColumnProps {
4
4
  config: ColumnConfig;
@@ -1,6 +1,6 @@
1
- import type { Entity, LayoutNode, Schema } from "@/types/schema";
2
- import type { StatusInfo, PropertyValue } from "@/types/api";
3
- import type { RefsMap } from "@/components/fields";
1
+ import type { Entity, LayoutNode, Schema } from "../../types/schema";
2
+ import type { StatusInfo, PropertyValue } from "../../types/api";
3
+ import type { RefsMap } from "../../components/fields";
4
4
  export interface PendingChildRow {
5
5
  _key: string;
6
6
  _deleted?: boolean;
@@ -1,4 +1,4 @@
1
- import type { RowConfig } from "@/types/schema";
1
+ import type { RowConfig } from "../../types/schema";
2
2
  import { type LayoutContext } from "./LayoutRenderer";
3
3
  interface LayoutRowProps {
4
4
  config: RowConfig;
@@ -1,4 +1,4 @@
1
- import type { TabsConfig } from "@/types/schema";
1
+ import type { TabsConfig } from "../../types/schema";
2
2
  import { type LayoutContext } from "./LayoutRenderer";
3
3
  interface LayoutTabsProps {
4
4
  config: TabsConfig;
@@ -1,4 +1,4 @@
1
- import type { LayoutNode } from "@/types/schema";
1
+ import type { LayoutNode } from "../../types/schema";
2
2
  import type { LayoutContext } from "./LayoutRenderer";
3
3
  interface PropertiesBlockProps {
4
4
  node: LayoutNode;
@@ -1,5 +1,5 @@
1
- import type { ResolvedChildConfig } from "@/lib/child-config";
2
- import type { Schema } from "@/types/schema";
1
+ import type { ResolvedChildConfig } from "../../lib/child-config";
2
+ import type { Schema } from "../../types/schema";
3
3
  interface QuickAddFormProps {
4
4
  config: ResolvedChildConfig;
5
5
  parentEntity: string;
@@ -1,4 +1,4 @@
1
- import type { SectionNode } from "@/types/schema";
1
+ import type { SectionNode } from "../../types/schema";
2
2
  import type { LayoutContext } from "./LayoutRenderer";
3
3
  interface SectionBlockProps {
4
4
  config: SectionNode;
@@ -1,4 +1,4 @@
1
- import type { LayoutNode } from "@/types/schema";
1
+ import type { LayoutNode } from "../../types/schema";
2
2
  import type { LayoutContext } from "./LayoutRenderer";
3
3
  interface StatusesBlockProps {
4
4
  node: LayoutNode;
@@ -1,5 +1,5 @@
1
- import type { ResolvedChildConfig } from "@/lib/child-config";
2
- import type { Schema } from "@/types/schema";
1
+ import type { ResolvedChildConfig } from "../../lib/child-config";
2
+ import type { Schema } from "../../types/schema";
3
3
  interface TimelineComposerProps {
4
4
  config: ResolvedChildConfig;
5
5
  parentEntity: string;
@@ -1,6 +1,6 @@
1
1
  import { type FormEvent } from "react";
2
- import type { ResolvedChildConfig } from "@/lib/child-config";
3
- import type { Schema } from "@/types/schema";
2
+ import type { ResolvedChildConfig } from "../../lib/child-config";
3
+ import type { Schema } from "../../types/schema";
4
4
  export interface UseQuickAddResult {
5
5
  values: Record<string, unknown>;
6
6
  quickAdd: ResolvedChildConfig["quick_add"];
@@ -1,4 +1,4 @@
1
- import type { EntityField } from "@/types/schema";
1
+ import type { EntityField } from "../../types/schema";
2
2
  export type RefsMap = Record<string, Record<string, Record<string, unknown>>>;
3
3
  export interface FieldRendererProps {
4
4
  field: EntityField;
@@ -1,4 +1,4 @@
1
- import { type FilterNode } from "@/lib/filters";
1
+ import { type FilterNode } from "../../lib/filters";
2
2
  interface FilterChipsProps {
3
3
  filters: FilterNode[];
4
4
  onRemove: (field: string) => void;
@@ -1,4 +1,4 @@
1
- import { type FilterNode, type FilterOp } from "@/lib/filters";
1
+ import { type FilterNode, type FilterOp } from "../../lib/filters";
2
2
  export interface FilterFieldMeta {
3
3
  code: string;
4
4
  label: string;
@@ -1,4 +1,4 @@
1
- import type { Action } from "@/types/schema";
1
+ import type { Action } from "../../types/schema";
2
2
  interface ActionButtonProps {
3
3
  actionCode: string;
4
4
  action: Action;
@@ -1,4 +1,4 @@
1
- import type { Action } from "@/types/schema";
1
+ import type { Action } from "../../types/schema";
2
2
  interface ActionDialogProps {
3
3
  open: boolean;
4
4
  onOpenChange: (open: boolean) => void;
@@ -1,4 +1,4 @@
1
- import type { AssociationDef, Schema } from "@/types/schema";
1
+ import type { AssociationDef, Schema } from "../../types/schema";
2
2
  interface AssociationTabsProps {
3
3
  entityCode: string;
4
4
  recordId: string;
@@ -1,4 +1,4 @@
1
- import type { Action } from "@/types/schema";
1
+ import type { Action } from "../../types/schema";
2
2
  interface RowActionItemProps {
3
3
  actionCode: string;
4
4
  action: Action;
@@ -1,5 +1,5 @@
1
- import type { StatusGroupDef } from "@/types/schema";
2
- import type { StatusInfo } from "@/types/api";
1
+ import type { StatusGroupDef } from "../../types/schema";
2
+ import type { StatusInfo } from "../../types/api";
3
3
  interface StatusGroupsDisplayProps {
4
4
  statusGroups: Record<string, StatusGroupDef>;
5
5
  objectStatuses: StatusInfo[] | undefined;
@@ -1,4 +1,4 @@
1
- import type { V2ListResponse } from "@/types/api";
1
+ import type { V2ListResponse } from "../types/api";
2
2
  /**
3
3
  * useAssociatedData fetches associated (non-aggregate) child entity records
4
4
  * with cursor-based pagination, search, and filter support.
@@ -1,3 +1,3 @@
1
- import type { ListResponse } from "@/types/api";
1
+ import type { ListResponse } from "../types/api";
2
2
  export declare const ENTITY_CHILDREN_KEY: "entity-children";
3
3
  export declare function useChildrenData(parentEntity: string, parentId: string, childCode: string, foreignKey: string | string[], sort?: string, limit?: number): import("@tanstack/react-query").UseQueryResult<ListResponse<Record<string, unknown>>, Error>;
@@ -1,2 +1,2 @@
1
- import type { Entity } from "@/types/schema";
1
+ import type { Entity } from "../types/schema";
2
2
  export declare function useEntity(entityCode: string | undefined): Entity | undefined;
@@ -1,2 +1,2 @@
1
- import type { ListParams } from "@/types/api";
2
- export declare function useEntityData(entity: string | undefined, params: ListParams): import("@tanstack/react-query").UseQueryResult<import("@/types/api").ListResponse<Record<string, unknown>>, Error>;
1
+ import type { ListParams } from "../types/api";
2
+ export declare function useEntityData(entity: string | undefined, params: ListParams): import("@tanstack/react-query").UseQueryResult<import("../types/api").ListResponse<Record<string, unknown>>, Error>;
@@ -1,2 +1,2 @@
1
- import type { PkValues } from "@/types/schema";
1
+ import type { PkValues } from "../types/schema";
2
2
  export declare function useEntityItem(entity: string | undefined, pkValues: PkValues | string | undefined): import("@tanstack/react-query").UseQueryResult<import("..").DataResponse<Record<string, unknown>>, Error>;
@@ -1,4 +1,4 @@
1
- import { type FilterNode } from "@/lib/filters";
1
+ import { type FilterNode } from "../lib/filters";
2
2
  /**
3
3
  * useFilters reads/writes the JSON `filters` URL param.
4
4
  * URL is the source of truth.
@@ -1,5 +1,5 @@
1
- import type { PkValues } from "@/types/schema";
2
- import type { ActionExecuteRequest } from "@/api/data";
1
+ import type { PkValues } from "../types/schema";
2
+ import type { ActionExecuteRequest } from "../api/data";
3
3
  export declare function useCreateEntity(entityCode: string): import("@tanstack/react-query").UseMutationResult<import("..").DataResponse<Record<string, unknown>>, Error, Record<string, unknown>, unknown>;
4
4
  export declare function useUpdateEntity(entityCode: string): import("@tanstack/react-query").UseMutationResult<import("..").DataResponse<Record<string, unknown>>, Error, {
5
5
  pkValues: PkValues | string;
@@ -7,7 +7,7 @@ export declare function useUpdateEntity(entityCode: string): import("@tanstack/r
7
7
  }, unknown>;
8
8
  export declare function useDeleteEntity(entityCode: string): import("@tanstack/react-query").UseMutationResult<void, Error, string | PkValues, unknown>;
9
9
  export declare function useRestoreEntity(entityCode: string): import("@tanstack/react-query").UseMutationResult<void, Error, string | PkValues, unknown>;
10
- export declare function useExecuteAction(entityCode?: string): import("@tanstack/react-query").UseMutationResult<import("@/api/data").ActionExecuteResponse, Error, {
10
+ export declare function useExecuteAction(entityCode?: string): import("@tanstack/react-query").UseMutationResult<import("../api/data").ActionExecuteResponse, Error, {
11
11
  actionCode: string;
12
12
  body: ActionExecuteRequest;
13
13
  }, unknown>;
@@ -1,2 +1,2 @@
1
- import type { Screen } from "@/types/schema";
1
+ import type { Screen } from "../types/schema";
2
2
  export declare function useScreen(screenCode: string | undefined): Screen | undefined;
@@ -1,4 +1,4 @@
1
- import type { ViewItem } from "@/components/views/ViewSwitcher";
1
+ import type { ViewItem } from "../components/views/ViewSwitcher";
2
2
  /**
3
3
  * useViews fetches DB views for a screen and merges with system views (presets) from DSL.
4
4
  * Returns a unified list with source tagging.
@@ -1,4 +1,4 @@
1
- import type { Action, ActionCondition, Schema } from "@/types/schema";
1
+ import type { Action, ActionCondition, Schema } from "../types/schema";
2
2
  /**
3
3
  * Evaluates action conditions against row data.
4
4
  * Returns true if the action is available (all conditions pass).
@@ -1,4 +1,4 @@
1
- import type { ChildDisplayMode, ChildQuickAdd, ChildRelation, CardsConfig, Entity, LayoutNode, LocalizedString, TimelineConfig } from "@/types/schema";
1
+ import type { ChildDisplayMode, ChildQuickAdd, ChildRelation, CardsConfig, Entity, LayoutNode, LocalizedString, TimelineConfig } from "../types/schema";
2
2
  export interface ResolvedChildConfig {
3
3
  entity: string;
4
4
  foreign_key: string | string[];
@@ -1,3 +1,3 @@
1
- import type { Schema } from "@/types/schema";
2
- import type { PendingChildRow } from "@/components/detail-layout/LayoutRenderer";
1
+ import type { Schema } from "../types/schema";
2
+ import type { PendingChildRow } from "../components/detail-layout/LayoutRenderer";
3
3
  export declare function validatePendingChildren(pendingChildren: Record<string, PendingChildRow[]> | undefined, schema: Schema | undefined): Record<string, Record<string, string[]>>;
@@ -1,4 +1,4 @@
1
- import type { SizeValue } from "@/types/schema";
1
+ import type { SizeValue } from "../types/schema";
2
2
  export type ParsedSizeValue = {
3
3
  kind: "weight";
4
4
  value: number;
@@ -1,3 +1,3 @@
1
- import type { ThemeDef } from "@/types/schema";
1
+ import type { ThemeDef } from "../types/schema";
2
2
  export declare const THEME_TOKENS: string[];
3
3
  export declare function themeDefToTokens(def: ThemeDef): Record<string, string>;
@@ -1,4 +1,4 @@
1
- import type { AuthUser, Tenant } from "@/types/api";
1
+ import type { AuthUser, Tenant } from "../types/api";
2
2
  interface AuthState {
3
3
  user: AuthUser | null;
4
4
  isAuthenticated: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@declarion/react",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "description": "React SDK for Declarion, the schema-driven business apps platform.",
@@ -70,6 +70,7 @@
70
70
  "react": "^19.0.0",
71
71
  "react-dom": "^19.0.0",
72
72
  "tailwindcss": "^4.0.0",
73
+ "tsc-alias": "^1.8.16",
73
74
  "typescript": "^5.7.0",
74
75
  "vite": "^6.0.0",
75
76
  "vitest": "^4.1.0"
@@ -77,7 +78,7 @@
77
78
  "scripts": {
78
79
  "dev": "vite",
79
80
  "build": "tsc --noEmit && vite build",
80
- "build:lib": "vite build --config vite.lib.config.ts && tsc -p tsconfig.lib.json",
81
+ "build:lib": "vite build --config vite.lib.config.ts && tsc -p tsconfig.lib.json && tsc-alias -p tsconfig.lib.json",
81
82
  "lint": "tsc --noEmit",
82
83
  "test": "vitest run",
83
84
  "preview": "vite preview"