@code0-tech/pictor 0.0.0-mvp.19 → 0.0.0-mvp.20

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.
@@ -1,8 +1,11 @@
1
- import { NamespaceLicense, NamespacesLicensesCreateInput, NamespacesLicensesCreatePayload, NamespacesLicensesDeleteInput, NamespacesLicensesDeletePayload } from '@code0-tech/sagittarius-graphql-types';
1
+ import { Namespace, NamespaceLicense, NamespacesLicensesCreateInput, NamespacesLicensesCreatePayload, NamespacesLicensesDeleteInput, NamespacesLicensesDeletePayload } from '@code0-tech/sagittarius-graphql-types';
2
2
  import { DNamespaceLicenseView } from './DNamespaceLicense.view';
3
- import { ReactiveArrayService } from '../../utils/reactiveArrayService';
4
- export declare abstract class DNamespaceLicenseReactiveService extends ReactiveArrayService<DNamespaceLicenseView> {
5
- getById(id: NamespaceLicense['id']): DNamespaceLicenseView | undefined;
3
+ import { ReactiveArrayService } from '../../utils';
4
+ export type DLicenseDependencies = {
5
+ namespaceId: Namespace['id'];
6
+ };
7
+ export declare abstract class DNamespaceLicenseReactiveService extends ReactiveArrayService<DNamespaceLicenseView, DLicenseDependencies> {
8
+ getById(id: NamespaceLicense['id'], dependencies?: DLicenseDependencies): DNamespaceLicenseView | undefined;
6
9
  abstract licenseCreate(payload: NamespacesLicensesCreateInput): Promise<NamespacesLicensesCreatePayload | undefined>;
7
10
  abstract licenseDelete(payload: NamespacesLicensesDeleteInput): Promise<NamespacesLicensesDeletePayload | undefined>;
8
11
  }
@@ -1,11 +1,12 @@
1
- import { ReactiveArrayService as r } from "../../utils/reactiveArrayService.js";
2
- class c extends r {
3
- //TODO: inject UI error handler for toasts
4
- //inject: namespaceId because the runtimes query needs it
5
- getById(e) {
6
- return this.values().find((i) => i.id === e);
1
+ import "../../utils/contextStore.js";
2
+ import "react";
3
+ import { ReactiveArrayService as t } from "../../utils/reactiveArrayService.js";
4
+ import "merge-props";
5
+ class p extends t {
6
+ getById(e, i) {
7
+ return this.values(i).find((r) => r.id === e);
7
8
  }
8
9
  }
9
10
  export {
10
- c as DNamespaceLicenseReactiveService
11
+ p as DNamespaceLicenseReactiveService
11
12
  };
@@ -1,8 +1,11 @@
1
1
  import { Namespace, NamespaceMember, NamespacesMembersAssignRolesInput, NamespacesMembersAssignRolesPayload, NamespacesMembersDeleteInput, NamespacesMembersDeletePayload, NamespacesMembersInviteInput, NamespacesMembersInvitePayload, User } from '@code0-tech/sagittarius-graphql-types';
2
2
  import { DNamespaceMemberView } from './DNamespaceMember.view';
3
- import { ReactiveArrayService } from '../../utils/reactiveArrayService';
4
- export declare abstract class DNamespaceMemberReactiveService extends ReactiveArrayService<DNamespaceMemberView> {
5
- getById(id: NamespaceMember['id']): DNamespaceMemberView | undefined;
3
+ import { ReactiveArrayService } from '../../utils';
4
+ export type DMemberDependencies = {
5
+ namespaceId: Namespace['id'];
6
+ };
7
+ export declare abstract class DNamespaceMemberReactiveService extends ReactiveArrayService<DNamespaceMemberView, DMemberDependencies> {
8
+ getById(id: NamespaceMember['id'], dependencies?: DMemberDependencies): DNamespaceMemberView | undefined;
6
9
  getByNamespaceIdAndUserId(namespaceId: Namespace['id'], userId: User['id']): DNamespaceMemberView | undefined;
7
10
  abstract memberInvite(payload: NamespacesMembersInviteInput): Promise<NamespacesMembersInvitePayload | undefined>;
8
11
  abstract memberDelete(payload: NamespacesMembersDeleteInput): Promise<NamespacesMembersDeletePayload | undefined>;
@@ -1,14 +1,15 @@
1
- import { ReactiveArrayService as i } from "../../utils/reactiveArrayService.js";
2
- class d extends i {
3
- //TODO: inject UI error handler for toasts
4
- //inject: namespaceId because the runtimes query needs it
5
- getById(e) {
6
- return this.values().find((r) => r.id === e);
1
+ import "../../utils/contextStore.js";
2
+ import "react";
3
+ import { ReactiveArrayService as t } from "../../utils/reactiveArrayService.js";
4
+ import "merge-props";
5
+ class m extends t {
6
+ getById(r, i) {
7
+ return this.values(i).find((e) => e.id === r);
7
8
  }
8
- getByNamespaceIdAndUserId(e, r) {
9
- return this.values().find((a) => a.namespace?.id === e && a.user?.id === r);
9
+ getByNamespaceIdAndUserId(r, i) {
10
+ return this.values().find((e) => e.namespace?.id === r && e.user?.id === i);
10
11
  }
11
12
  }
12
13
  export {
13
- d as DNamespaceMemberReactiveService
14
+ m as DNamespaceMemberReactiveService
14
15
  };
@@ -1,6 +1,6 @@
1
1
  import { Namespace } from '@code0-tech/sagittarius-graphql-types';
2
2
  import { DNamespaceView } from './DNamespace.view';
3
- import { ReactiveArrayService } from '../../utils/reactiveArrayService';
3
+ import { ReactiveArrayService } from '../../utils';
4
4
  export declare abstract class DNamespaceReactiveService extends ReactiveArrayService<DNamespaceView> {
5
5
  getById(id: Namespace['id']): DNamespaceView | undefined;
6
6
  }
@@ -1,11 +1,12 @@
1
+ import "../../utils/contextStore.js";
2
+ import "react";
1
3
  import { ReactiveArrayService as i } from "../../utils/reactiveArrayService.js";
2
- class c extends i {
3
- //TODO: inject UI error handler for toasts
4
- //inject: either userId or organizationId because the namespaces query needs it
4
+ import "merge-props";
5
+ class p extends i {
5
6
  getById(e) {
6
7
  return this.values().find((r) => r.id === e);
7
8
  }
8
9
  }
9
10
  export {
10
- c as DNamespaceReactiveService
11
+ p as DNamespaceReactiveService
11
12
  };
@@ -1,4 +1,4 @@
1
- import { ReactiveArrayService } from '../../utils/reactiveArrayService';
1
+ import { ReactiveArrayService } from '../../utils';
2
2
  import { DOrganizationView } from './DOrganization.view';
3
3
  import { Organization, OrganizationsCreateInput, OrganizationsCreatePayload, OrganizationsDeleteInput, OrganizationsDeletePayload } from '@code0-tech/sagittarius-graphql-types';
4
4
  export declare abstract class DOrganizationReactiveService extends ReactiveArrayService<DOrganizationView> {
@@ -1,11 +1,12 @@
1
+ import "../../utils/contextStore.js";
2
+ import "react";
1
3
  import { ReactiveArrayService as r } from "../../utils/reactiveArrayService.js";
2
- class c extends r {
3
- //TODO: inject UI error handler for toasts
4
- //no id's need to be injected here because the root query has a organizations field
4
+ import "merge-props";
5
+ class n extends r {
5
6
  getById(e) {
6
7
  return this.values().find((i) => i.id === e);
7
8
  }
8
9
  }
9
10
  export {
10
- c as DOrganizationReactiveService
11
+ n as DOrganizationReactiveService
11
12
  };
@@ -1,8 +1,11 @@
1
- import { NamespaceProject, NamespacesProjectsAssignRuntimesInput, NamespacesProjectsAssignRuntimesPayload, NamespacesProjectsCreateInput, NamespacesProjectsCreatePayload, NamespacesProjectsDeleteInput, NamespacesProjectsDeletePayload } from '@code0-tech/sagittarius-graphql-types';
1
+ import { Namespace, NamespaceProject, NamespacesProjectsAssignRuntimesInput, NamespacesProjectsAssignRuntimesPayload, NamespacesProjectsCreateInput, NamespacesProjectsCreatePayload, NamespacesProjectsDeleteInput, NamespacesProjectsDeletePayload } from '@code0-tech/sagittarius-graphql-types';
2
2
  import { DNamespaceProjectView } from './DNamespaceProject.view';
3
3
  import { ReactiveArrayService } from '../../utils';
4
- export declare abstract class DNamespaceProjectReactiveService extends ReactiveArrayService<DNamespaceProjectView> {
5
- getById(id: NamespaceProject['id']): DNamespaceProjectView | undefined;
4
+ export type DProjectDependencies = {
5
+ namespaceId: Namespace['id'];
6
+ };
7
+ export declare abstract class DNamespaceProjectReactiveService extends ReactiveArrayService<DNamespaceProjectView, DProjectDependencies> {
8
+ getById(id: NamespaceProject['id'], dependencies?: DProjectDependencies): DNamespaceProjectView | undefined;
6
9
  abstract projectAssignRuntimes(payload: NamespacesProjectsAssignRuntimesInput): Promise<NamespacesProjectsAssignRuntimesPayload | undefined>;
7
10
  abstract projectCreate(payload: NamespacesProjectsCreateInput): Promise<NamespacesProjectsCreatePayload | undefined>;
8
11
  abstract projectDelete(payload: NamespacesProjectsDeleteInput): Promise<NamespacesProjectsDeletePayload | undefined>;
@@ -1,14 +1,12 @@
1
1
  import "../../utils/contextStore.js";
2
2
  import "react";
3
- import { ReactiveArrayService as t } from "../../utils/reactiveArrayService.js";
3
+ import { ReactiveArrayService as i } from "../../utils/reactiveArrayService.js";
4
4
  import "merge-props";
5
- class p extends t {
6
- //TODO: inject UI error handler for toasts
7
- //inject: namespaceId because the runtimes query needs it
8
- getById(e) {
9
- return this.values().find((r) => r.id === e);
5
+ class s extends i {
6
+ getById(e, r) {
7
+ return this.values(r).find((t) => t.id === e);
10
8
  }
11
9
  }
12
10
  export {
13
- p as DNamespaceProjectReactiveService
11
+ s as DNamespaceProjectReactiveService
14
12
  };
@@ -1,8 +1,9 @@
1
1
  import { default as React } from 'react';
2
- import { NamespaceProject } from '@code0-tech/sagittarius-graphql-types';
2
+ import { Namespace, NamespaceProject } from '@code0-tech/sagittarius-graphql-types';
3
3
  import { Card } from '../card/Card';
4
4
  import { DNamespaceProjectView } from './DNamespaceProject.view';
5
5
  export interface DNamespaceProjectListProps extends Omit<Card, "children" | "onSelect"> {
6
+ namespaceId: Namespace["id"];
6
7
  filter?: (project: DNamespaceProjectView, index: number) => boolean;
7
8
  onSetting?: (projectId: NamespaceProject["id"]) => void;
8
9
  onSelect?: (projectId: NamespaceProject["id"]) => void;
@@ -1,21 +1,24 @@
1
1
  import { jsx as r } from "react/jsx-runtime";
2
- import d from "react";
3
- import { Card as f } from "../card/Card.js";
4
- import { useService as u, useStore as S } from "../../utils/contextStore.js";
2
+ import f from "react";
3
+ import { Card as u } from "../card/Card.js";
4
+ import { useService as S, useStore as l } from "../../utils/contextStore.js";
5
5
  import "merge-props";
6
6
  import { DNamespaceProjectReactiveService as o } from "./DNamespaceProject.service.js";
7
- import l from "../card/CardSection.js";
8
- import { DNamespaceProjectContent as v } from "./DNamespaceProjectContent.js";
7
+ import v from "../card/CardSection.js";
8
+ import { DNamespaceProjectContent as j } from "./DNamespaceProjectContent.js";
9
9
  const b = (i) => {
10
10
  const {
11
- filter: c = () => !0,
12
- onSetting: m,
11
+ namespaceId: c,
12
+ filter: m = () => !0,
13
+ onSetting: s,
13
14
  onSelect: t,
14
- ...s
15
- } = i, n = u(o), p = S(o), a = d.useMemo(() => n.values(), [p]);
16
- return /* @__PURE__ */ r(f, { ...s, children: a.filter(c).map((e) => e.id && /* @__PURE__ */ r(l, { border: !0, hover: !0, onClick: () => {
15
+ ...n
16
+ } = i, p = S(o), a = l(o), d = f.useMemo(() => p.values({
17
+ namespaceId: c
18
+ }), [a]);
19
+ return /* @__PURE__ */ r(u, { ...n, children: d.filter(m).map((e) => e.id && /* @__PURE__ */ r(v, { border: !0, hover: !0, onClick: () => {
17
20
  t && t(e.id);
18
- }, children: /* @__PURE__ */ r(v, { onSetting: m, projectId: e?.id }) }, e.id)) });
21
+ }, children: /* @__PURE__ */ r(j, { onSetting: s, projectId: e?.id }) }, e.id)) });
19
22
  };
20
23
  export {
21
24
  b as DNamespaceProjectList
@@ -1,8 +1,11 @@
1
- import { ReactiveArrayService } from '../../utils/reactiveArrayService';
1
+ import { ReactiveArrayService } from '../../utils';
2
2
  import { DNamespaceRoleView } from './DNamespaceRole.view';
3
- import { NamespaceRole, NamespacesRolesAssignAbilitiesInput, NamespacesRolesAssignAbilitiesPayload, NamespacesRolesAssignProjectsInput, NamespacesRolesAssignProjectsPayload, NamespacesRolesCreateInput, NamespacesRolesCreatePayload, NamespacesRolesDeleteInput, NamespacesRolesDeletePayload } from '@code0-tech/sagittarius-graphql-types';
4
- export declare abstract class DNamespaceRoleReactiveService extends ReactiveArrayService<DNamespaceRoleView> {
5
- getById(id: NamespaceRole['id']): DNamespaceRoleView | undefined;
3
+ import { Namespace, NamespaceRole, NamespacesRolesAssignAbilitiesInput, NamespacesRolesAssignAbilitiesPayload, NamespacesRolesAssignProjectsInput, NamespacesRolesAssignProjectsPayload, NamespacesRolesCreateInput, NamespacesRolesCreatePayload, NamespacesRolesDeleteInput, NamespacesRolesDeletePayload } from '@code0-tech/sagittarius-graphql-types';
4
+ export type DRoleDependencies = {
5
+ namespaceId: Namespace['id'];
6
+ };
7
+ export declare abstract class DNamespaceRoleReactiveService extends ReactiveArrayService<DNamespaceRoleView, DRoleDependencies> {
8
+ getById(id: NamespaceRole['id'], dependencies?: DRoleDependencies): DNamespaceRoleView | undefined;
6
9
  abstract roleAssignAbilities(payload: NamespacesRolesAssignAbilitiesInput): Promise<NamespacesRolesAssignAbilitiesPayload | undefined>;
7
10
  abstract roleAssignProject(payload: NamespacesRolesAssignProjectsInput): Promise<NamespacesRolesAssignProjectsPayload | undefined>;
8
11
  abstract roleCreate(payload: NamespacesRolesCreateInput): Promise<NamespacesRolesCreatePayload | undefined>;
@@ -1,11 +1,12 @@
1
- import { ReactiveArrayService as i } from "../../utils/reactiveArrayService.js";
2
- class c extends i {
3
- //TODO: inject UI error handler for toasts
4
- //inject: namespaceId because the runtimes query needs it
5
- getById(e) {
6
- return this.values().find((r) => r.id === e);
1
+ import "../../utils/contextStore.js";
2
+ import "react";
3
+ import { ReactiveArrayService as t } from "../../utils/reactiveArrayService.js";
4
+ import "merge-props";
5
+ class s extends t {
6
+ getById(e, r) {
7
+ return this.values(r).find((i) => i.id === e);
7
8
  }
8
9
  }
9
10
  export {
10
- c as DNamespaceRoleReactiveService
11
+ s as DNamespaceRoleReactiveService
11
12
  };
@@ -1,7 +1,10 @@
1
1
  import { ReactiveArrayService } from '../../utils/reactiveArrayService';
2
2
  import { DRuntimeView } from './DRuntime.view';
3
- import { Runtime, RuntimesCreateInput, RuntimesCreatePayload, RuntimesDeleteInput, RuntimesDeletePayload, RuntimesRotateTokenInput, RuntimesRotateTokenPayload } from '@code0-tech/sagittarius-graphql-types';
4
- export declare abstract class DRuntimeReactiveService extends ReactiveArrayService<DRuntimeView> {
3
+ import { Namespace, Runtime, RuntimesCreateInput, RuntimesCreatePayload, RuntimesDeleteInput, RuntimesDeletePayload, RuntimesRotateTokenInput, RuntimesRotateTokenPayload } from '@code0-tech/sagittarius-graphql-types';
4
+ export type DRuntimeDependencies = {
5
+ namespaceId: Namespace['id'];
6
+ };
7
+ export declare abstract class DRuntimeReactiveService extends ReactiveArrayService<DRuntimeView, DRuntimeDependencies> {
5
8
  getById(id: Runtime['id']): DRuntimeView | undefined;
6
9
  abstract runtimeCreate(payload: RuntimesCreateInput): Promise<RuntimesCreatePayload | undefined>;
7
10
  abstract runtimeDelete(payload: RuntimesDeleteInput): Promise<RuntimesDeletePayload | undefined>;
@@ -1,7 +1,5 @@
1
1
  import { ReactiveArrayService as r } from "../../utils/reactiveArrayService.js";
2
2
  class c extends r {
3
- //TODO: inject UI error handler for toasts
4
- //inject: namespaceId because the runtimes query needs it
5
3
  getById(e) {
6
4
  return this.values().find((i) => i.id === e);
7
5
  }
@@ -1,10 +1,10 @@
1
- export interface ArrayService<T> {
1
+ export interface ArrayService<T, D = Record<string, any>> {
2
2
  delete(index: number): void;
3
3
  add(index: T): void;
4
4
  set(index: number, value: T): void;
5
5
  has(index: number): boolean;
6
6
  get(index: number): T;
7
- values(): T[];
7
+ values(dependencies?: D): T[];
8
8
  update(): void;
9
9
  clear(): void;
10
10
  }
@@ -4,7 +4,7 @@ export type ReactiveArrayStore<T> = {
4
4
  getState: () => T[];
5
5
  setState: React.Dispatch<React.SetStateAction<T[]>>;
6
6
  };
7
- export declare class ReactiveArrayService<T> implements ArrayService<T> {
7
+ export declare class ReactiveArrayService<T, D = Record<string, any>> implements ArrayService<T, D> {
8
8
  protected readonly access: ReactiveArrayStore<T>;
9
9
  constructor(access: ReactiveArrayStore<T>);
10
10
  delete(index: number): void;
@@ -12,7 +12,7 @@ export declare class ReactiveArrayService<T> implements ArrayService<T> {
12
12
  set(index: number, value: T): void;
13
13
  has(index: number): boolean;
14
14
  get(index: number): T;
15
- values(): T[];
15
+ values(_dependencies?: D): T[];
16
16
  update(): void;
17
17
  clear(): void;
18
18
  }
@@ -45,7 +45,7 @@ class b {
45
45
  get(e) {
46
46
  return this.access.getState()[e];
47
47
  }
48
- values() {
48
+ values(e) {
49
49
  return this.access.getState();
50
50
  }
51
51
  update() {
@@ -59,7 +59,7 @@ class b {
59
59
  });
60
60
  }
61
61
  }
62
- function g(t, e = []) {
62
+ function d(t, e = []) {
63
63
  const [r, s] = n.useState(Array.isArray(e) ? e : []), c = n.useRef(r);
64
64
  n.useEffect(() => {
65
65
  c.current = r;
@@ -87,5 +87,5 @@ function g(t, e = []) {
87
87
  }
88
88
  export {
89
89
  b as ReactiveArrayService,
90
- g as useReactiveArrayService
90
+ d as useReactiveArrayService
91
91
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code0-tech/pictor",
3
- "version": "0.0.0-mvp.19",
3
+ "version": "0.0.0-mvp.20",
4
4
  "type": "module",
5
5
  "description": "A simple template for a custom React component library",
6
6
  "scripts": {
@@ -21,7 +21,7 @@
21
21
  "@babel/plugin-proposal-decorators": "^7.28.0",
22
22
  "@babel/plugin-transform-class-properties": "^7.27.1",
23
23
  "@code0-tech/definition-reader": "^0.0.18",
24
- "@code0-tech/sagittarius-graphql-types": "^0.0.0-4e14e2ae65b66543ca2d02d685fa36e9e1b8b5ec",
24
+ "@code0-tech/sagittarius-graphql-types": "^0.0.0-755f9382e6589ede0182dace55452703bcd6e85b",
25
25
  "@dagrejs/dagre": "^1.1.8",
26
26
  "@mdx-js/react": "^3.1.1",
27
27
  "@radix-ui/react-checkbox": "^1.3.3",
@@ -94,7 +94,7 @@
94
94
  "types": "dist/index.d.ts",
95
95
  "peerDependencies": {
96
96
  "@ariakit/react": "^0.4.5",
97
- "@code0-tech/sagittarius-graphql-types": "^0.0.0-beb91167a8ea12eb6d4a6e3933483bacf845f2f6",
97
+ "@code0-tech/sagittarius-graphql-types": "^0.0.0-755f9382e6589ede0182dace55452703bcd6e85b",
98
98
  "@radix-ui/react-checkbox": "^1.3.2",
99
99
  "@radix-ui/react-dialog": "^1.1.14",
100
100
  "@radix-ui/react-dropdown-menu": "^2.1.15",