@declarion/react 0.1.89 → 0.1.91

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.
@@ -0,0 +1,5 @@
1
+ import { type LocalizedString } from "../types/schema";
2
+ import type { PublicParam } from "../types/api";
3
+ export type MessageCatalog = Record<string, LocalizedString> | undefined;
4
+ export declare function localizedMessage(messages: MessageCatalog, code: string, locale: string, fallback?: string): string;
5
+ export declare function publicLocale(parameters: PublicParam[] | undefined): string;
@@ -0,0 +1,3 @@
1
+ import type { Schema } from "../types/schema";
2
+ export declare function schemaDefaultRoute(schema: Schema | undefined): string | null;
3
+ export declare function accessibleRedirectPath(requestedPath: string, schema: Schema | undefined): string;
@@ -1,4 +1,5 @@
1
1
  export type TabMode = "view" | "edit" | "create";
2
+ export type TabCloseScope = "current" | "others" | "right" | "all";
2
3
  export interface TabItem {
3
4
  id: string;
4
5
  pathname: string;
@@ -19,6 +20,7 @@ interface TabState {
19
20
  activeTabId: string | null;
20
21
  openTab: (tab: Omit<TabItem, "id">) => string;
21
22
  closeTab: (id: string) => void;
23
+ closeTabs: (ids: string[]) => TabItem | null;
22
24
  switchTab: (id: string) => void;
23
25
  reorderTabs: (activeId: string, overId: string) => void;
24
26
  findTabByPathname: (pathname: string) => TabItem | undefined;
@@ -30,6 +32,7 @@ interface TabState {
30
32
  setScope: (tenantId: string | null, userId: string | null) => void;
31
33
  hydrate: () => void;
32
34
  }
35
+ export declare function tabIdsForCloseScope(tabs: TabItem[], activeTabId: string | null, scope: TabCloseScope, targetId?: string): string[];
33
36
  export declare function peekTenantLandingPath(tenantId: string, userId: string): string | null;
34
37
  export declare const useTabStore: import("zustand").UseBoundStore<import("zustand").StoreApi<TabState>>;
35
38
  export {};
@@ -163,6 +163,7 @@ export interface PublicMeta {
163
163
  export interface PublicParamsResponse {
164
164
  parameters: PublicParam[];
165
165
  accents?: Record<string, AccentDef>;
166
+ messages?: Record<string, LocalizedString>;
166
167
  branding?: PublicBranding;
167
168
  meta?: PublicMeta;
168
169
  }
@@ -739,6 +739,7 @@ export interface Schema {
739
739
  handlers?: Record<string, HandlerDef>;
740
740
  enums: Record<string, EnumDef>;
741
741
  parameters: Record<string, ParameterDef>;
742
+ messages?: Record<string, LocalizedString>;
742
743
  branding?: Branding;
743
744
  areas?: AreaDef[];
744
745
  accents?: Record<string, AccentDef>;
@@ -1203,14 +1203,16 @@ function _e({ value: e, onChange: t, id: n, ariaLabelledby: r }) {
1203
1203
  }
1204
1204
  //#endregion
1205
1205
  //#region src/components/primitives/MenuItem.tsx
1206
- function ve({ icon: e, children: t, onClick: n, danger: r, kbd: i, active: a, divider: o, "data-testid": s }) {
1206
+ function ve({ icon: e, children: t, onClick: n, danger: r, kbd: i, active: a, divider: o, disabled: s, title: c, "data-testid": l }) {
1207
1207
  return o ? /* @__PURE__ */ I("div", { style: {
1208
1208
  height: 1,
1209
1209
  background: "var(--divider)",
1210
1210
  margin: "4px 0"
1211
1211
  } }) : /* @__PURE__ */ L("div", {
1212
- onClick: n,
1213
- "data-testid": s,
1212
+ onClick: s ? void 0 : n,
1213
+ "data-testid": l,
1214
+ "aria-disabled": s || void 0,
1215
+ title: c,
1214
1216
  style: {
1215
1217
  display: "flex",
1216
1218
  alignItems: "center",
@@ -1219,11 +1221,12 @@ function ve({ icon: e, children: t, onClick: n, danger: r, kbd: i, active: a, di
1219
1221
  borderRadius: 5,
1220
1222
  fontSize: 12.5,
1221
1223
  color: r ? "var(--danger)" : "var(--text-2)",
1222
- cursor: "pointer",
1223
- background: a ? "var(--surface-3)" : "transparent"
1224
+ cursor: s ? "not-allowed" : "pointer",
1225
+ background: a ? "var(--surface-3)" : "transparent",
1226
+ opacity: s ? .45 : 1
1224
1227
  },
1225
1228
  onMouseEnter: (e) => {
1226
- e.currentTarget.style.background = "var(--surface-3)";
1229
+ s || (e.currentTarget.style.background = "var(--surface-3)");
1227
1230
  },
1228
1231
  onMouseLeave: (e) => {
1229
1232
  e.currentTarget.style.background = a ? "var(--surface-3)" : "transparent";
@@ -5855,4 +5858,4 @@ function Va() {
5855
5858
  //#endregion
5856
5859
  export { ft as $, en as A, be as At, xt as B, ie as Bt, gn as C, Pe as Ct, Yt as D, Ce as Dt, rn as E, Ae as Et, Xt as F, he as Ft, vt as G, K as Gt, yt as H, re as Ht, Gt as I, fe as It, mt as J, gt as K, G as Kt, Vt as L, Z as Lt, qt as M, ve as Mt, on as N, _e as Nt, Zt as O, Q as Ot, $t as P, ge as Pt, ht as Q, Ht as R, de as Rt, _n as S, ke as St, tn as T, we as Tt, st as U, J as Ut, bt as V, Y as Vt, ut as W, q as Wt, ct as X, dt as Y, lt as Z, er as _, Ve as _t, Kr as a, Ke as at, An as b, xe as bt, Lr as c, Ge as ct, gr as d, qe as dt, Ie as et, hr as f, Xe as ft, $n as g, Ze as gt, rr as h, Ue as ht, Gr as i, We as it, Jt as j, ye as jt, an as k, Ne as kt, Ir as l, tt as lt, ir as m, Je as mt, Ra as n, $e as nt, Mr as o, He as ot, mr as p, Ye as pt, _t as q, ne as qt, Ia as r, et as rt, Pr as s, Le as st, Va as t, Qe as tt, Fr as u, $ as ut, Qn as v, Fe as vt, cn as w, Me as wt, kn as x, je as xt, jn as y, Te as yt, Bt as z, ae as zt };
5857
5860
 
5858
- //# sourceMappingURL=useUserLocale-C7cAecf5.js.map
5861
+ //# sourceMappingURL=useUserLocale-DyXRSWj9.js.map