@knkcs/contenthub-ui 0.1.0 → 0.2.0

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,123 +1,123 @@
1
1
  import { S as e, h as t, y as n } from "./heads-Brd2Gtjm.js";
2
- import { useCallback as r, useEffect as i, useMemo as a, useState as o } from "react";
3
- import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
4
- import { Button as u, EmptyState as d } from "@knkcs/anker/atoms";
5
- import { DataTable as f, DateCell as p, Modal as ee, Toolbar as m, TreeViewBranchControl as h, TreeViewBranchIndicator as g, TreeViewBranchText as _, TreeViewItem as v, TreeViewItemText as y, TreeViewLabel as b, TreeViewNode as x, TreeViewRoot as S, TreeViewTree as C, TruncatedTextCell as w, createTreeCollection as T } from "@knkcs/anker/components";
6
- import { Alert as E, Box as te, HStack as D, NativeSelect as O, Spinner as k, Stack as ne, Text as A, Tooltip as re } from "@knkcs/anker/primitives";
7
- import { IndexPageTemplate as ie, SubNavLayout as j } from "@knkcs/anker/templates";
8
- import { keepPreviousData as ae, useInfiniteQuery as oe, useQuery as M, useQueryClient as se } from "@tanstack/react-query";
9
- import { ChevronRight as ce, FileText as le, Lock as N, Plus as ue } from "lucide-react";
10
- import { useTranslation as P } from "react-i18next";
11
- import { zodResolver as de } from "@hookform/resolvers/zod";
12
- import { BaseSelectField as F, InputField as I, LookupSelectField as fe } from "@knkcs/anker/forms";
13
- import { FormProvider as L, useForm as R, useWatch as z } from "react-hook-form";
14
- import { z as B } from "zod";
15
- import { useHostIdentity as pe } from "@knkcs/anker/host";
16
- import { useSearchParams as me } from "react-router";
2
+ import { useCallback as r, useEffect as i, useMemo as a, useRef as o, useState as s } from "react";
3
+ import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
4
+ import { Button as d, EmptyState as f } from "@knkcs/anker/atoms";
5
+ import { DataTable as p, DateCell as m, Modal as h, Toolbar as g, TreeViewBranchControl as _, TreeViewBranchIndicator as v, TreeViewBranchText as y, TreeViewItem as b, TreeViewItemText as x, TreeViewLabel as S, TreeViewNode as ee, TreeViewRoot as C, TreeViewTree as w, TruncatedTextCell as T, createTreeCollection as E } from "@knkcs/anker/components";
6
+ import { Alert as D, HStack as te, NativeSelect as O, Spinner as ne, Stack as k, Text as A } from "@knkcs/anker/primitives";
7
+ import { IndexPageTemplate as j, SubNavLayout as M } from "@knkcs/anker/templates";
8
+ import { keepPreviousData as re, useInfiniteQuery as ie, useQuery as N, useQueryClient as ae } from "@tanstack/react-query";
9
+ import { ChevronRight as P, FileText as oe, Lock as F, Plus as se } from "lucide-react";
10
+ import { useTranslation as I } from "react-i18next";
11
+ import { zodResolver as ce } from "@hookform/resolvers/zod";
12
+ import { BaseSelectField as L, InputField as R, LookupSelectField as le } from "@knkcs/anker/forms";
13
+ import { FormProvider as z, useForm as B, useWatch as V } from "react-hook-form";
14
+ import { z as H } from "zod";
15
+ import { useHostIdentity as ue } from "@knkcs/anker/host";
16
+ import { useSearchParams as de } from "react-router";
17
17
  //#region src/common/query-keys.ts
18
- var V = {
18
+ var U = {
19
19
  all: ["contenthub"],
20
- blockReasons: () => [...V.all, "block-reasons"],
21
- changeSets: () => [...V.all, "change-sets"],
22
- changeSetLists: () => [...V.changeSets(), "list"],
23
- changeSetList: (e) => [...V.changeSetLists(), e],
24
- openChangeSets: () => [...V.changeSetLists(), "open-picker"],
20
+ blockReasons: () => [...U.all, "block-reasons"],
21
+ changeSets: () => [...U.all, "change-sets"],
22
+ changeSetLists: () => [...U.changeSets(), "list"],
23
+ changeSetList: (e) => [...U.changeSetLists(), e],
24
+ openChangeSets: () => [...U.changeSetLists(), "open-picker"],
25
25
  changeSet: (e) => [
26
- ...V.changeSets(),
26
+ ...U.changeSets(),
27
27
  "detail",
28
28
  e
29
29
  ],
30
30
  publishReadiness: (e) => [
31
- ...V.changeSets(),
31
+ ...U.changeSets(),
32
32
  "readiness",
33
33
  e
34
34
  ],
35
- publishReadinessAt: (e, t) => [...V.publishReadiness(e), t],
35
+ publishReadinessAt: (e, t) => [...U.publishReadiness(e), t],
36
36
  checkStandings: (e) => [
37
- ...V.changeSets(),
37
+ ...U.changeSets(),
38
38
  "checks",
39
39
  e
40
40
  ],
41
- changeSetStatuses: () => [...V.all, "change-set-statuses"],
42
- requiredChecks: () => [...V.all, "required-checks"],
41
+ changeSetStatuses: () => [...U.all, "change-set-statuses"],
42
+ requiredChecks: () => [...U.all, "required-checks"],
43
43
  requiredCheckRecorders: (e) => [
44
- ...V.requiredChecks(),
44
+ ...U.requiredChecks(),
45
45
  "recorders",
46
46
  e
47
47
  ],
48
- collections: () => [...V.all, "collections"],
48
+ collections: () => [...U.all, "collections"],
49
49
  collectionGrants: (e) => [
50
- ...V.collections(),
50
+ ...U.collections(),
51
51
  "grants",
52
52
  e
53
53
  ],
54
- contents: () => [...V.all, "contents"],
55
- contentLists: () => [...V.contents(), "list"],
56
- contentList: (e) => [...V.contentLists(), e],
54
+ contents: () => [...U.all, "contents"],
55
+ contentLists: () => [...U.contents(), "list"],
56
+ contentList: (e) => [...U.contentLists(), e],
57
57
  content: (e) => [
58
- ...V.contents(),
58
+ ...U.contents(),
59
59
  "detail",
60
60
  e
61
61
  ],
62
62
  contentRead: (e, t) => [
63
- ...V.content(e),
63
+ ...U.content(e),
64
64
  "read",
65
65
  t
66
66
  ],
67
- contentTimeline: (e) => [...V.content(e), "timeline"],
67
+ contentTimeline: (e) => [...U.content(e), "timeline"],
68
68
  contentRevisions: (e, t) => [
69
- ...V.content(e),
69
+ ...U.content(e),
70
70
  "revisions",
71
71
  t
72
72
  ],
73
73
  contentCompare: (e, t, n) => [
74
- ...V.content(e),
74
+ ...U.content(e),
75
75
  "compare",
76
76
  t,
77
77
  n
78
78
  ],
79
79
  contentReferences: (e, t) => [
80
- ...V.content(e),
80
+ ...U.content(e),
81
81
  "references",
82
82
  t
83
83
  ],
84
- contentReferrers: (e) => [...V.content(e), "referrers"],
84
+ contentReferrers: (e) => [...U.content(e), "referrers"],
85
85
  contentOutdatedPins: (e, t) => [
86
- ...V.content(e),
86
+ ...U.content(e),
87
87
  "outdated-pins",
88
88
  t
89
89
  ],
90
- contentChangeSets: (e) => [...V.content(e), "change-sets"],
90
+ contentChangeSets: (e) => [...U.content(e), "change-sets"],
91
91
  chainPreview: (e, t, ...n) => [
92
- ...V.content(e),
92
+ ...U.content(e),
93
93
  "preview",
94
94
  t,
95
95
  ...n
96
96
  ],
97
97
  previewInForce: (e, t, n) => [
98
- ...V.content(e),
98
+ ...U.content(e),
99
99
  "preview-in-force",
100
100
  t,
101
101
  n
102
102
  ],
103
103
  pendingMerge: (e) => [
104
- ...V.all,
104
+ ...U.all,
105
105
  "pending-merge",
106
106
  e
107
107
  ],
108
- blueprints: () => [...V.all, "blueprints"],
108
+ blueprints: () => [...U.all, "blueprints"],
109
109
  blueprintNames: (e) => [
110
- ...V.blueprints(),
110
+ ...U.blueprints(),
111
111
  "names",
112
112
  e
113
113
  ],
114
- blueprintFilterOptions: () => [...V.blueprints(), "filter-options"],
114
+ blueprintFilterOptions: () => [...U.blueprints(), "filter-options"],
115
115
  blueprintReleases: (e) => [
116
- ...V.blueprints(),
116
+ ...U.blueprints(),
117
117
  "releases",
118
118
  e
119
119
  ]
120
- }, H = {
120
+ }, W = {
121
121
  common: { cancel: "Abbrechen" },
122
122
  settings: {
123
123
  section: "Einstellungen",
@@ -574,7 +574,6 @@ var V = {
574
574
  more: "Mehr anzeigen",
575
575
  create: {
576
576
  button: "Neuer Inhalt",
577
- unavailable: "Neue Inhalte brauchen die Blueprints des Arbeitsbereichs, und dieser Host ist nicht mit blueprinthub verbunden.",
578
577
  title: "Neuer Inhalt",
579
578
  blueprint: "Blueprint",
580
579
  blueprintHelp: "Die Art des Inhalts, wie ein Blueprint sie festlegt.",
@@ -584,6 +583,11 @@ var V = {
584
583
  releaseHelp: "Das Release, auf das der Inhalt festgelegt wird. Das neueste ist vorausgewählt.",
585
584
  releaseRequired: "Wählen Sie ein Release.",
586
585
  noRelease: "Dieser Blueprint hat noch kein Release. Erstellen Sie zuerst eines in blueprinthub.",
586
+ noUsableRelease: "Kein Release dieses Blueprints kann verwendet werden. Korrigieren Sie den Blueprint in blueprinthub und erstellen Sie ein neues Release.",
587
+ releasesFailed: "Die Releases konnten nicht geladen werden: blueprinthub antwortet nicht. Versuchen Sie es erneut.",
588
+ refusedRelease: "{{name}} (nicht verwendbar)",
589
+ refusedReleases: "Auf diese Releases kann contenthub nicht festlegen:",
590
+ refusedReleaseReasons: "{{name}}: {{reasons}}",
587
591
  changeSet: "Change Set",
588
592
  changeSetHelp: "Ein neuer Inhalt entsteht in einem Change Set und existiert nur dort, bis es veröffentlicht wird.",
589
593
  changeSetRequired: "Wählen Sie ein Change Set.",
@@ -834,7 +838,7 @@ var V = {
834
838
  confirm: "Archivieren"
835
839
  }
836
840
  }
837
- }, U = {
841
+ }, G = {
838
842
  common: { cancel: "Cancel" },
839
843
  settings: {
840
844
  section: "Settings",
@@ -1525,7 +1529,6 @@ var V = {
1525
1529
  more: "Show more",
1526
1530
  create: {
1527
1531
  button: "New Content",
1528
- unavailable: "New Content needs the workspace's Blueprints, and this host has no connection to blueprinthub.",
1529
1532
  title: "New Content",
1530
1533
  blueprint: "Blueprint",
1531
1534
  blueprintHelp: "The kind of Content, as a Blueprint defines it.",
@@ -1535,6 +1538,11 @@ var V = {
1535
1538
  releaseHelp: "The Release the Content pins. The newest is chosen for you.",
1536
1539
  releaseRequired: "Choose a Release.",
1537
1540
  noRelease: "This Blueprint has no Release yet. Cut one in blueprinthub first.",
1541
+ noUsableRelease: "No Release of this Blueprint can be used. Fix the Blueprint in blueprinthub and cut a new Release.",
1542
+ releasesFailed: "The Releases could not be loaded: blueprinthub isn't answering. Try again.",
1543
+ refusedRelease: "{{name}} (can't be used)",
1544
+ refusedReleases: "contenthub can't pin these Releases:",
1545
+ refusedReleaseReasons: "{{name}}: {{reasons}}",
1538
1546
  changeSet: "Change Set",
1539
1547
  changeSetHelp: "New Content is created in a Change Set and exists only there until it is published.",
1540
1548
  changeSetRequired: "Choose a Change Set.",
@@ -1785,19 +1793,44 @@ var V = {
1785
1793
  confirm: "Archive"
1786
1794
  }
1787
1795
  }
1788
- }, W = "contenthub-ui", G = {
1789
- en: { [W]: U },
1790
- de: { [W]: H }
1791
- }, K = {
1792
- namespace: W,
1793
- resources: G
1794
- }, q = 200;
1795
- function J(e, t = !0) {
1796
- return M({
1797
- queryKey: V.openChangeSets(),
1796
+ }, K = "contenthub-ui", q = {
1797
+ en: { [K]: G },
1798
+ de: { [K]: W }
1799
+ }, J = {
1800
+ namespace: K,
1801
+ resources: q
1802
+ };
1803
+ //#endregion
1804
+ //#region src/common/blueprint-source.ts
1805
+ function fe(e) {
1806
+ let t = /* @__PURE__ */ new Map();
1807
+ return {
1808
+ async searchBlueprints(n) {
1809
+ let r = await e.searchBlueprints(n);
1810
+ for (let e of r.blueprints) t.set(e.id, e);
1811
+ return r;
1812
+ },
1813
+ async getBlueprints(e) {
1814
+ return e.flatMap((e) => {
1815
+ let n = t.get(e);
1816
+ return n ? [{ ...n }] : [];
1817
+ });
1818
+ },
1819
+ listReleases: (t) => e.listBlueprintReleases(t)
1820
+ };
1821
+ }
1822
+ function pe(e, t) {
1823
+ return a(() => t ?? fe(e), [e, t]);
1824
+ }
1825
+ //#endregion
1826
+ //#region src/common/use-open-change-sets.ts
1827
+ var me = 200;
1828
+ function he(e, t = !0) {
1829
+ return N({
1830
+ queryKey: U.openChangeSets(),
1798
1831
  queryFn: () => e.listChangeSets({
1799
1832
  state: "open",
1800
- pageSize: q
1833
+ pageSize: me
1801
1834
  }),
1802
1835
  enabled: t
1803
1836
  });
@@ -1805,20 +1838,20 @@ function J(e, t = !0) {
1805
1838
  //#endregion
1806
1839
  //#region src/screens/collection-tree.tsx
1807
1840
  var Y = "__all__";
1808
- function he(e, t) {
1841
+ function ge(e, t) {
1809
1842
  let n = new Map(t.map((e) => [e.id, e])), r = [], i = /* @__PURE__ */ new Set(), a = n.get(e);
1810
1843
  for (; a && !i.has(a.id);) i.add(a.id), r.unshift(a), a = n.get(a.parentId);
1811
1844
  return r;
1812
1845
  }
1813
1846
  function X() {
1814
- let { t: e } = P(W);
1815
- return /* @__PURE__ */ c(N, {
1847
+ let { t: e } = I(K);
1848
+ return /* @__PURE__ */ l(F, {
1816
1849
  size: 12,
1817
1850
  "aria-label": e("library.restricted")
1818
1851
  });
1819
1852
  }
1820
- function ge({ collections: e, activeId: t, onSelect: n }) {
1821
- let { t: r } = P(W), i = a(() => new Map(e.map((e) => [e.id, e])), [e]), s = a(() => {
1853
+ function _e({ collections: e, activeId: t, onSelect: n }) {
1854
+ let { t: r } = I(K), i = a(() => new Map(e.map((e) => [e.id, e])), [e]), o = a(() => {
1822
1855
  let t = /* @__PURE__ */ new Map();
1823
1856
  for (let n of e) {
1824
1857
  let e = n.parentId !== "" && i.has(n.parentId) ? n.parentId : "", r = t.get(e) ?? [];
@@ -1837,7 +1870,7 @@ function ge({ collections: e, activeId: t, onSelect: n }) {
1837
1870
  children: i.map((e) => n(e, a))
1838
1871
  };
1839
1872
  }, a = (t.get("") ?? []).map((e) => n(e, /* @__PURE__ */ new Set([e.id])));
1840
- return T({
1873
+ return E({
1841
1874
  rootNode: {
1842
1875
  id: "ROOT",
1843
1876
  name: "",
@@ -1855,24 +1888,24 @@ function ge({ collections: e, activeId: t, onSelect: n }) {
1855
1888
  e,
1856
1889
  i,
1857
1890
  r
1858
- ]), [u] = o(() => he(t, e).slice(0, -1).map((e) => e.id));
1859
- return /* @__PURE__ */ l(S, {
1860
- collection: s,
1891
+ ]), [c] = s(() => ge(t, e).slice(0, -1).map((e) => e.id));
1892
+ return /* @__PURE__ */ u(C, {
1893
+ collection: o,
1861
1894
  size: "sm",
1862
1895
  selectedValue: [t === "" ? Y : t],
1863
- defaultExpandedValue: u,
1896
+ defaultExpandedValue: c,
1864
1897
  onSelectionChange: (e) => {
1865
1898
  let t = e.selectedValue[0];
1866
1899
  t !== void 0 && n(t === Y ? "" : t);
1867
1900
  },
1868
- children: [/* @__PURE__ */ c(b, {
1901
+ children: [/* @__PURE__ */ l(S, {
1869
1902
  srOnly: !0,
1870
1903
  children: r("library.collections")
1871
- }), /* @__PURE__ */ c(C, { children: /* @__PURE__ */ c(x, { render: ({ node: e, nodeState: t }) => t.isBranch ? /* @__PURE__ */ l(h, { children: [
1872
- /* @__PURE__ */ c(g, { children: /* @__PURE__ */ c(ce, { size: 14 }) }),
1873
- /* @__PURE__ */ c(_, { children: e.name }),
1874
- e.restricted ? /* @__PURE__ */ c(X, {}) : null
1875
- ] }) : /* @__PURE__ */ l(v, { children: [/* @__PURE__ */ c(y, { children: e.name }), e.restricted ? /* @__PURE__ */ c(X, {}) : null] }) }) })]
1904
+ }), /* @__PURE__ */ l(w, { children: /* @__PURE__ */ l(ee, { render: ({ node: e, nodeState: t }) => t.isBranch ? /* @__PURE__ */ u(_, { children: [
1905
+ /* @__PURE__ */ l(v, { children: /* @__PURE__ */ l(P, { size: 14 }) }),
1906
+ /* @__PURE__ */ l(y, { children: e.name }),
1907
+ e.restricted ? /* @__PURE__ */ l(X, {}) : null
1908
+ ] }) : /* @__PURE__ */ u(b, { children: [/* @__PURE__ */ l(x, { children: e.name }), e.restricted ? /* @__PURE__ */ l(X, {}) : null] }) }) })]
1876
1909
  });
1877
1910
  }
1878
1911
  //#endregion
@@ -1881,30 +1914,30 @@ var Z = {
1881
1914
  name: "",
1882
1915
  sourceDate: "",
1883
1916
  sourceReference: ""
1884
- }, Q = "contenthub-create-change-set", $ = /^[^\u0000-\u001f\u007f]*$/;
1885
- function _e({ open: t, onClose: n, onSubmit: r }) {
1886
- let { t: s } = P(W), d = a(() => B.object({
1887
- name: B.string().trim().min(1, s("changeSets.form.nameRequired")).max(200, s("changeSets.form.tooLong", { max: 200 })).regex($, s("changeSets.form.oneLine")),
1888
- sourceDate: B.string().trim(),
1889
- sourceReference: B.string().trim().max(500, s("changeSets.form.tooLong", { max: 500 })).regex($, s("changeSets.form.oneLine"))
1917
+ }, ve = "contenthub-create-change-set", Q = /^[^\u0000-\u001f\u007f]*$/;
1918
+ function ye({ open: t, onClose: n, onSubmit: r }) {
1919
+ let { t: o } = I(K), c = a(() => H.object({
1920
+ name: H.string().trim().min(1, o("changeSets.form.nameRequired")).max(200, o("changeSets.form.tooLong", { max: 200 })).regex(Q, o("changeSets.form.oneLine")),
1921
+ sourceDate: H.string().trim(),
1922
+ sourceReference: H.string().trim().max(500, o("changeSets.form.tooLong", { max: 500 })).regex(Q, o("changeSets.form.oneLine"))
1890
1923
  }).superRefine((e, t) => {
1891
1924
  e.sourceReference !== "" && e.sourceDate === "" && t.addIssue({
1892
1925
  code: "custom",
1893
1926
  path: ["sourceDate"],
1894
- message: s("changeSets.form.sourceDateRequired")
1927
+ message: o("changeSets.form.sourceDateRequired")
1895
1928
  }), e.sourceDate !== "" && e.sourceReference === "" && t.addIssue({
1896
1929
  code: "custom",
1897
1930
  path: ["sourceReference"],
1898
- message: s("changeSets.form.sourceReferenceRequired")
1931
+ message: o("changeSets.form.sourceReferenceRequired")
1899
1932
  });
1900
- }), [s]), f = R({
1901
- resolver: de(d),
1933
+ }), [o]), f = B({
1934
+ resolver: ce(c),
1902
1935
  defaultValues: Z
1903
- }), [p, m] = o(null), h = f.formState.isSubmitting;
1936
+ }), [p, m] = s(null), g = f.formState.isSubmitting;
1904
1937
  i(() => {
1905
1938
  t && (f.reset(Z), m(null));
1906
1939
  }, [t, f]);
1907
- let g = f.handleSubmit(async (t) => {
1940
+ let _ = f.handleSubmit(async (t) => {
1908
1941
  m(null);
1909
1942
  try {
1910
1943
  await r({
@@ -1915,60 +1948,60 @@ function _e({ open: t, onClose: n, onSubmit: r }) {
1915
1948
  }
1916
1949
  });
1917
1950
  } catch (t) {
1918
- m(t instanceof e ? t.message : s("changeSets.form.failed"));
1951
+ m(t instanceof e ? t.message : o("changeSets.form.failed"));
1919
1952
  }
1920
1953
  });
1921
- return /* @__PURE__ */ c(ee, {
1954
+ return /* @__PURE__ */ l(h, {
1922
1955
  open: t,
1923
1956
  onClose: n,
1924
1957
  lazyMount: !0,
1925
1958
  unmountOnExit: !0,
1926
1959
  size: "md",
1927
- header: s("changeSets.form.createTitle"),
1928
- footer: /* @__PURE__ */ l(D, {
1960
+ header: o("changeSets.form.createTitle"),
1961
+ footer: /* @__PURE__ */ u(te, {
1929
1962
  gap: "2",
1930
- children: [/* @__PURE__ */ c(u, {
1963
+ children: [/* @__PURE__ */ l(d, {
1931
1964
  size: "sm",
1932
1965
  variant: "ghost",
1933
1966
  onClick: n,
1934
- children: s("common.cancel")
1935
- }), /* @__PURE__ */ c(u, {
1967
+ children: o("common.cancel")
1968
+ }), /* @__PURE__ */ l(d, {
1936
1969
  type: "submit",
1937
- form: Q,
1970
+ form: ve,
1938
1971
  size: "sm",
1939
1972
  variant: "solid",
1940
- loading: h,
1941
- children: s("changeSets.form.createSubmit")
1973
+ loading: g,
1974
+ children: o("changeSets.form.createSubmit")
1942
1975
  })]
1943
1976
  }),
1944
- children: /* @__PURE__ */ c(L, {
1977
+ children: /* @__PURE__ */ l(z, {
1945
1978
  ...f,
1946
- children: /* @__PURE__ */ c("form", {
1947
- id: Q,
1979
+ children: /* @__PURE__ */ l("form", {
1980
+ id: ve,
1948
1981
  onSubmit: (e) => {
1949
- e.preventDefault(), g();
1982
+ e.preventDefault(), _();
1950
1983
  },
1951
- children: /* @__PURE__ */ l(ne, {
1984
+ children: /* @__PURE__ */ u(k, {
1952
1985
  gap: "4",
1953
1986
  children: [
1954
- /* @__PURE__ */ c(I, {
1987
+ /* @__PURE__ */ l(R, {
1955
1988
  name: "name",
1956
- label: s("changeSets.form.name"),
1957
- helperText: s("changeSets.form.nameHelp"),
1989
+ label: o("changeSets.form.name"),
1990
+ helperText: o("changeSets.form.nameHelp"),
1958
1991
  required: !0
1959
1992
  }),
1960
- /* @__PURE__ */ c(I, {
1993
+ /* @__PURE__ */ l(R, {
1961
1994
  name: "sourceDate",
1962
1995
  type: "date",
1963
- label: s("changeSets.form.sourceDate"),
1964
- helperText: s("changeSets.form.sourceDateHelp")
1996
+ label: o("changeSets.form.sourceDate"),
1997
+ helperText: o("changeSets.form.sourceDateHelp")
1965
1998
  }),
1966
- /* @__PURE__ */ c(I, {
1999
+ /* @__PURE__ */ l(R, {
1967
2000
  name: "sourceReference",
1968
- label: s("changeSets.form.sourceReference"),
1969
- helperText: s("changeSets.form.sourceReferenceHelp")
2001
+ label: o("changeSets.form.sourceReference"),
2002
+ helperText: o("changeSets.form.sourceReferenceHelp")
1970
2003
  }),
1971
- p ? /* @__PURE__ */ c(E, {
2004
+ p ? /* @__PURE__ */ l(D, {
1972
2005
  status: "error",
1973
2006
  title: p
1974
2007
  }) : null
@@ -1980,8 +2013,8 @@ function _e({ open: t, onClose: n, onSubmit: r }) {
1980
2013
  }
1981
2014
  //#endregion
1982
2015
  //#region src/screens/change-set-choice.tsx
1983
- var ve = "@new";
1984
- function ye(e, t, n = !1) {
2016
+ var be = "@new";
2017
+ function xe(e, t, n = !1) {
1985
2018
  if (!t.changeSetId) return {
1986
2019
  path: "changeSetId",
1987
2020
  message: e("library.create.changeSetRequired")
@@ -1994,27 +2027,27 @@ function ye(e, t, n = !1) {
1994
2027
  } : [...r].length > 200 ? {
1995
2028
  path: "changeSetName",
1996
2029
  message: e("changeSets.form.tooLong", { max: 200 })
1997
- } : $.test(r) ? null : {
2030
+ } : Q.test(r) ? null : {
1998
2031
  path: "changeSetName",
1999
2032
  message: e("changeSets.form.oneLine")
2000
2033
  };
2001
2034
  }
2002
- function be({ client: e, open: t, helperText: n, nameHelperText: r, nameOptional: i = !1 }) {
2003
- let { t: o } = P(W), u = J(e, t), d = a(() => [{
2004
- id: ve,
2035
+ function Se({ client: e, open: t, helperText: n, nameHelperText: r, nameOptional: i = !1 }) {
2036
+ let { t: o } = I(K), s = he(e, t), d = a(() => [{
2037
+ id: be,
2005
2038
  label: o("library.create.newChangeSet")
2006
- }, ...(u.data?.changeSets ?? []).map((e) => ({
2039
+ }, ...(s.data?.changeSets ?? []).map((e) => ({
2007
2040
  id: e.id,
2008
2041
  label: e.name
2009
- }))], [u.data, o]), f = z({ name: "changeSetId" });
2010
- return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c(F, {
2042
+ }))], [s.data, o]), f = V({ name: "changeSetId" });
2043
+ return /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(L, {
2011
2044
  name: "changeSetId",
2012
2045
  label: o("library.create.changeSet"),
2013
2046
  helperText: n,
2014
2047
  options: d,
2015
2048
  isClearable: !1,
2016
2049
  required: !0
2017
- }), f === "@new" ? /* @__PURE__ */ c(I, {
2050
+ }), f === "@new" ? /* @__PURE__ */ l(R, {
2018
2051
  name: "changeSetName",
2019
2052
  label: o("library.create.changeSetName"),
2020
2053
  helperText: r ?? o("changeSets.form.nameHelp"),
@@ -2023,13 +2056,13 @@ function be({ client: e, open: t, helperText: n, nameHelperText: r, nameOptional
2023
2056
  }
2024
2057
  //#endregion
2025
2058
  //#region src/screens/create-content-modal.tsx
2026
- var xe = "contenthub-create-content";
2027
- function Se({ open: s, onClose: d, client: f, blueprintSource: p, initialChangeSetId: m, onCreated: h }) {
2028
- let { t: g } = P(W), _ = se(), v = a(() => B.object({
2029
- blueprintId: B.string().nullable().refine((e) => !!e, g("library.create.blueprintRequired")),
2030
- releaseId: B.string().nullable().refine((e) => !!e, g("library.create.releaseRequired")),
2031
- changeSetId: B.string().nullable().refine((e) => !!e, g("library.create.changeSetRequired")),
2032
- changeSetName: B.string().trim()
2059
+ var Ce = "contenthub-create-content", $ = (e) => !e.refusals?.length, we = (e) => e.path ? `${e.code} (${e.path})` : e.code;
2060
+ function Te({ open: c, onClose: f, client: p, blueprintSource: m, initialChangeSetId: g, onCreated: _ }) {
2061
+ let { t: v } = I(K), y = ae(), b = a(() => H.object({
2062
+ blueprintId: H.string().nullable().refine((e) => !!e, v("library.create.blueprintRequired")),
2063
+ releaseId: H.string().nullable().refine((e) => !!e, v("library.create.releaseRequired")),
2064
+ changeSetId: H.string().nullable().refine((e) => !!e, v("library.create.changeSetRequired")),
2065
+ changeSetName: H.string().trim()
2033
2066
  }).superRefine((e, t) => {
2034
2067
  if (e.changeSetId !== "@new") return;
2035
2068
  let n = (e) => t.addIssue({
@@ -2037,57 +2070,59 @@ function Se({ open: s, onClose: d, client: f, blueprintSource: p, initialChangeS
2037
2070
  path: ["changeSetName"],
2038
2071
  message: e
2039
2072
  });
2040
- e.changeSetName === "" ? n(g("changeSets.form.nameRequired")) : [...e.changeSetName].length > 200 ? n(g("changeSets.form.tooLong", { max: 200 })) : $.test(e.changeSetName) || n(g("changeSets.form.oneLine"));
2041
- }), [g]), y = a(() => ({
2073
+ e.changeSetName === "" ? n(v("changeSets.form.nameRequired")) : [...e.changeSetName].length > 200 ? n(v("changeSets.form.tooLong", { max: 200 })) : Q.test(e.changeSetName) || n(v("changeSets.form.oneLine"));
2074
+ }), [v]), x = a(() => ({
2042
2075
  blueprintId: null,
2043
2076
  releaseId: null,
2044
- changeSetId: m || "@new",
2077
+ changeSetId: g || "@new",
2045
2078
  changeSetName: ""
2046
- }), [m]), b = R({
2047
- resolver: de(v),
2048
- defaultValues: y
2049
- }), [x, S] = o(null), C = b.formState.isSubmitting, w = z({
2050
- control: b.control,
2079
+ }), [g]), S = B({
2080
+ resolver: ce(b),
2081
+ defaultValues: x
2082
+ }), [ee, C] = s(null), w = S.formState.isSubmitting, T = V({
2083
+ control: S.control,
2051
2084
  name: "blueprintId"
2052
- }), T = z({
2053
- control: b.control,
2085
+ }), E = V({
2086
+ control: S.control,
2054
2087
  name: "changeSetId"
2055
2088
  });
2056
2089
  i(() => {
2057
- s && (b.reset(y), S(null));
2090
+ c && (S.reset(x), C(null));
2058
2091
  }, [
2059
- s,
2060
- b,
2061
- y
2092
+ c,
2093
+ S,
2094
+ x
2062
2095
  ]);
2063
- let te = J(f, s), O = a(() => [{
2064
- id: ve,
2065
- label: g("library.create.newChangeSet")
2066
- }, ...(te.data?.changeSets ?? []).map((e) => ({
2096
+ let O = he(p, c), ne = a(() => [{
2097
+ id: be,
2098
+ label: v("library.create.newChangeSet")
2099
+ }, ...(O.data?.changeSets ?? []).map((e) => ({
2067
2100
  id: e.id,
2068
2101
  label: e.name
2069
- }))], [te.data, g]), k = M({
2070
- queryKey: V.blueprintReleases(w ?? ""),
2071
- queryFn: () => p.listReleases(w),
2072
- enabled: s && !!w
2073
- }), A = a(() => (k.data ?? []).map((e) => ({
2102
+ }))], [O.data, v]), j = N({
2103
+ queryKey: U.blueprintReleases(T ?? ""),
2104
+ queryFn: () => m.listReleases(T),
2105
+ enabled: c && !!T
2106
+ }), M = a(() => (j.data ?? []).map((e) => ({
2074
2107
  id: e.id,
2075
- label: e.name
2076
- })), [k.data]);
2108
+ label: $(e) ? e.name : v("library.create.refusedRelease", { name: e.name }),
2109
+ data: { refused: !$(e) }
2110
+ })), [j.data, v]), re = a(() => (j.data ?? []).filter((e) => !$(e)), [j.data]), ie = o(T);
2077
2111
  i(() => {
2078
- let e = b.getValues("releaseId"), t = k.data;
2079
- if (!w) {
2080
- e !== null && b.setValue("releaseId", null);
2112
+ ie.current !== T && (ie.current = T, S.setValue("releaseId", null));
2113
+ let e = S.getValues("releaseId"), t = j.data;
2114
+ if (!T) {
2115
+ e !== null && S.setValue("releaseId", null);
2081
2116
  return;
2082
2117
  }
2083
- t && !t.some((t) => t.id === e) && b.setValue("releaseId", t[0]?.id ?? null);
2118
+ t && !t.some((t) => t.id === e && $(t)) && S.setValue("releaseId", t.find($)?.id ?? null);
2084
2119
  }, [
2085
- w,
2086
- k.data,
2087
- b
2120
+ T,
2121
+ j.data,
2122
+ S
2088
2123
  ]);
2089
- let re = !!w && k.isSuccess && k.data.length === 0, ie = r(async ({ query: e, cursor: t, signal: n }) => {
2090
- let r = await p.searchBlueprints({
2124
+ let P = !!T && j.isSuccess && j.data.length === 0, oe = !!T && j.isSuccess && j.data.length > 0 && !j.data.some($), F = r(async ({ query: e, cursor: t, signal: n }) => {
2125
+ let r = await m.searchBlueprints({
2091
2126
  query: e,
2092
2127
  pageToken: t ?? void 0,
2093
2128
  signal: n
@@ -2099,109 +2134,132 @@ function Se({ open: s, onClose: d, client: f, blueprintSource: p, initialChangeS
2099
2134
  })),
2100
2135
  nextCursor: r.nextPageToken || null
2101
2136
  };
2102
- }, [p]), j = r(async ({ ids: e }) => {
2103
- let t = await p.getBlueprints(e);
2137
+ }, [m]), se = r(async ({ ids: e }) => {
2138
+ let t = await m.getBlueprints(e);
2104
2139
  return e.map((e) => ({
2105
2140
  id: e,
2106
2141
  label: t.find((t) => t.id === e)?.name ?? e
2107
2142
  }));
2108
- }, [p]), ae = b.handleSubmit(async (e) => {
2109
- S(null);
2143
+ }, [m]), ue = S.handleSubmit(async (e) => {
2144
+ C(null);
2110
2145
  let t = e.changeSetId, n = !1;
2111
2146
  try {
2112
2147
  if (t === "@new") {
2113
- let r = await f.createChangeSet({ name: e.changeSetName.trim() });
2114
- n = !0, t = r.id, b.setValue("changeSetId", t);
2148
+ let r = await p.createChangeSet({ name: e.changeSetName.trim() });
2149
+ n = !0, t = r.id, S.setValue("changeSetId", t);
2115
2150
  }
2116
- let r = await f.createContent({
2151
+ let r = await p.createContent({
2117
2152
  changeSetId: t,
2118
2153
  blueprintReleaseId: e.releaseId
2119
2154
  });
2120
- _.invalidateQueries({ queryKey: V.contents() }), h(r);
2155
+ y.invalidateQueries({ queryKey: U.contents() }), _(r);
2121
2156
  } catch (e) {
2122
- if (S(oe(e)), !n) return;
2157
+ if (C(de(e)), !n) return;
2123
2158
  }
2124
- _.invalidateQueries({ queryKey: V.changeSets() });
2159
+ y.invalidateQueries({ queryKey: U.changeSets() });
2125
2160
  });
2126
- function oe(r) {
2161
+ function de(r) {
2127
2162
  if (r instanceof n) {
2128
- let e = r.reasons.map((e) => e.path ? `${e.code} (${e.path})` : e.code).join(", ");
2129
- return g("library.create.refused", { reasons: e });
2163
+ let e = r.reasons.map(we).join(", ");
2164
+ return v("library.create.refused", { reasons: e });
2130
2165
  }
2131
- return r instanceof t ? g("library.create.changeSetClosed") : r instanceof e ? r.message : g("library.create.failed");
2166
+ return r instanceof t ? v("library.create.changeSetClosed") : r instanceof e ? r.message : v("library.create.failed");
2132
2167
  }
2133
- return /* @__PURE__ */ c(ee, {
2134
- open: s,
2135
- onClose: d,
2168
+ return /* @__PURE__ */ l(h, {
2169
+ open: c,
2170
+ onClose: f,
2136
2171
  lazyMount: !0,
2137
2172
  unmountOnExit: !0,
2138
2173
  size: "md",
2139
- header: g("library.create.title"),
2140
- footer: /* @__PURE__ */ l(D, {
2174
+ header: v("library.create.title"),
2175
+ footer: /* @__PURE__ */ u(te, {
2141
2176
  gap: "2",
2142
- children: [/* @__PURE__ */ c(u, {
2177
+ children: [/* @__PURE__ */ l(d, {
2143
2178
  size: "sm",
2144
2179
  variant: "ghost",
2145
- onClick: d,
2146
- children: g("common.cancel")
2147
- }), /* @__PURE__ */ c(u, {
2180
+ onClick: f,
2181
+ children: v("common.cancel")
2182
+ }), /* @__PURE__ */ l(d, {
2148
2183
  type: "submit",
2149
- form: xe,
2184
+ form: Ce,
2150
2185
  size: "sm",
2151
2186
  variant: "solid",
2152
- loading: C,
2153
- disabled: re,
2154
- children: g("library.create.submit")
2187
+ loading: w,
2188
+ disabled: P || oe || j.isError,
2189
+ children: v("library.create.submit")
2155
2190
  })]
2156
2191
  }),
2157
- children: /* @__PURE__ */ c(L, {
2158
- ...b,
2159
- children: /* @__PURE__ */ c("form", {
2160
- id: xe,
2192
+ children: /* @__PURE__ */ l(z, {
2193
+ ...S,
2194
+ children: /* @__PURE__ */ l("form", {
2195
+ id: Ce,
2161
2196
  onSubmit: (e) => {
2162
- e.preventDefault(), ae();
2197
+ e.preventDefault(), ue();
2163
2198
  },
2164
- children: /* @__PURE__ */ l(ne, {
2199
+ children: /* @__PURE__ */ u(k, {
2165
2200
  gap: "4",
2166
2201
  children: [
2167
- /* @__PURE__ */ c(fe, {
2202
+ /* @__PURE__ */ l(le, {
2168
2203
  name: "blueprintId",
2169
- label: g("library.create.blueprint"),
2170
- helperText: g("library.create.blueprintHelp"),
2171
- search: ie,
2172
- resolve: j,
2173
- placeholder: g("library.create.pickBlueprint"),
2204
+ label: v("library.create.blueprint"),
2205
+ helperText: v("library.create.blueprintHelp"),
2206
+ search: F,
2207
+ resolve: se,
2208
+ placeholder: v("library.create.pickBlueprint"),
2174
2209
  required: !0
2175
2210
  }),
2176
- w ? /* @__PURE__ */ c(F, {
2211
+ T ? /* @__PURE__ */ l(L, {
2177
2212
  name: "releaseId",
2178
- label: g("library.create.release"),
2179
- helperText: g("library.create.releaseHelp"),
2180
- options: A,
2213
+ label: v("library.create.release"),
2214
+ helperText: v("library.create.releaseHelp"),
2215
+ options: M,
2181
2216
  isClearable: !1,
2182
- required: !0
2217
+ required: !0,
2218
+ selectProps: { isOptionDisabled: (e) => e.data?.refused === !0 }
2183
2219
  }) : null,
2184
- re ? /* @__PURE__ */ c(E, {
2220
+ P ? /* @__PURE__ */ l(D, {
2185
2221
  status: "warning",
2186
- title: g("library.create.noRelease")
2222
+ title: v("library.create.noRelease")
2223
+ }) : null,
2224
+ oe ? /* @__PURE__ */ l(D, {
2225
+ status: "warning",
2226
+ title: v("library.create.noUsableRelease")
2227
+ }) : null,
2228
+ j.isError ? /* @__PURE__ */ l(D, {
2229
+ status: "error",
2230
+ title: v("library.create.releasesFailed")
2231
+ }) : null,
2232
+ re.length > 0 ? /* @__PURE__ */ l(D, {
2233
+ status: "info",
2234
+ title: v("library.create.refusedReleases"),
2235
+ children: /* @__PURE__ */ l(k, {
2236
+ gap: "1",
2237
+ children: re.map((e) => /* @__PURE__ */ l(A, {
2238
+ textStyle: "sm",
2239
+ children: v("library.create.refusedReleaseReasons", {
2240
+ name: e.name,
2241
+ reasons: (e.refusals ?? []).map(we).join(", ")
2242
+ })
2243
+ }, e.id))
2244
+ })
2187
2245
  }) : null,
2188
- /* @__PURE__ */ c(F, {
2246
+ /* @__PURE__ */ l(L, {
2189
2247
  name: "changeSetId",
2190
- label: g("library.create.changeSet"),
2191
- helperText: g("library.create.changeSetHelp"),
2192
- options: O,
2248
+ label: v("library.create.changeSet"),
2249
+ helperText: v("library.create.changeSetHelp"),
2250
+ options: ne,
2193
2251
  isClearable: !1,
2194
2252
  required: !0
2195
2253
  }),
2196
- T === "@new" ? /* @__PURE__ */ c(I, {
2254
+ E === "@new" ? /* @__PURE__ */ l(R, {
2197
2255
  name: "changeSetName",
2198
- label: g("library.create.changeSetName"),
2199
- helperText: g("changeSets.form.nameHelp"),
2256
+ label: v("library.create.changeSetName"),
2257
+ helperText: v("changeSets.form.nameHelp"),
2200
2258
  required: !0
2201
2259
  }) : null,
2202
- x ? /* @__PURE__ */ c(E, {
2260
+ ee ? /* @__PURE__ */ l(D, {
2203
2261
  status: "error",
2204
- title: x
2262
+ title: ee
2205
2263
  }) : null
2206
2264
  ]
2207
2265
  })
@@ -2211,82 +2269,81 @@ function Se({ open: s, onClose: d, client: f, blueprintSource: p, initialChangeS
2211
2269
  }
2212
2270
  //#endregion
2213
2271
  //#region src/screens/content-library.tsx
2214
- var Ce = [
2272
+ var Ee = [
2215
2273
  "main",
2216
2274
  "in_force",
2217
2275
  "change_set"
2218
- ], we = 50, Te = 300, Ee = 5, De = "@me", Oe = "collection";
2219
- function ke(e) {
2276
+ ], De = 50, Oe = 300, ke = 5, Ae = "@me", je = "collection";
2277
+ function Me(e) {
2220
2278
  return Object.values(e).filter((e) => typeof e == "string" && e.trim() !== "" && e.length <= 200).slice(0, 2).join(" ");
2221
2279
  }
2222
- function Ae({ client: t, blueprintSource: n, onOpenContent: s, onOpenBranch: ee }) {
2223
- let { t: h } = P(W), [g, _] = me(), v = g.get("collection") ?? "", [y, b] = o("main"), [x, S] = o(""), [C, T] = o(""), [se, ce] = o(""), [N, de] = o(""), [F, I] = o(""), [fe, L] = o(!1), { userId: R, members: z } = pe();
2280
+ function Ne({ client: t, blueprintSource: n, onOpenContent: o, onOpenBranch: c }) {
2281
+ let { t: h } = I(K), _ = pe(t, n), [v, y] = de(), b = v.get("collection") ?? "", [x, S] = s("main"), [ee, C] = s(""), [w, E] = s(""), [ae, P] = s(""), [F, ce] = s(""), [L, R] = s(""), [le, z] = s(!1), { userId: B, members: V } = ue();
2224
2282
  i(() => {
2225
- let e = setTimeout(() => ce(C), Te);
2283
+ let e = setTimeout(() => P(w), Oe);
2226
2284
  return () => clearTimeout(e);
2227
- }, [C]);
2228
- let B = r((e) => _((t) => {
2285
+ }, [w]);
2286
+ let H = r((e) => y((t) => {
2229
2287
  let n = new URLSearchParams(t);
2230
- return e ? n.set(Oe, e) : n.delete(Oe), n;
2231
- }), [_]), H = M({
2232
- queryKey: V.collections(),
2288
+ return e ? n.set(je, e) : n.delete(je), n;
2289
+ }), [y]), W = N({
2290
+ queryKey: U.collections(),
2233
2291
  queryFn: () => t.listCollections()
2234
- }), U = J(t), G = r((e) => U.data?.changeSets.find((t) => t.id === e)?.name ?? e, [U.data]), K = x || U.data?.changeSets[0]?.id || "", q = a(() => y === "change_set" ? K ? {
2292
+ }), G = he(t), q = r((e) => G.data?.changeSets.find((t) => t.id === e)?.name ?? e, [G.data]), J = ee || G.data?.changeSets[0]?.id || "", fe = a(() => x === "change_set" ? J ? {
2235
2293
  kind: "change_set",
2236
- changeSetId: K
2237
- } : void 0 : { kind: y }, [y, K]), Y = a(() => ({
2238
- view: q,
2239
- collectionId: v || void 0,
2240
- search: y === "in_force" ? void 0 : se.trim() || void 0,
2241
- blueprintIds: N ? [N] : void 0,
2242
- assigneeId: F === De ? R : F || void 0
2294
+ changeSetId: J
2295
+ } : void 0 : { kind: x }, [x, J]), me = a(() => ({
2296
+ view: fe,
2297
+ collectionId: b || void 0,
2298
+ search: x === "in_force" ? void 0 : ae.trim() || void 0,
2299
+ blueprintIds: F ? [F] : void 0,
2300
+ assigneeId: L === Ae ? B : L || void 0
2243
2301
  }), [
2244
- q,
2245
- v,
2246
- y,
2247
- se,
2248
- N,
2302
+ fe,
2303
+ b,
2304
+ x,
2305
+ ae,
2249
2306
  F,
2250
- R
2251
- ]), X = oe({
2252
- queryKey: V.contentList(Y),
2307
+ L,
2308
+ B
2309
+ ]), Y = ie({
2310
+ queryKey: U.contentList(me),
2253
2311
  queryFn: ({ pageParam: e }) => t.listContents({
2254
- ...Y,
2255
- pageSize: we,
2312
+ ...me,
2313
+ pageSize: De,
2256
2314
  pageToken: e
2257
2315
  }),
2258
2316
  initialPageParam: "",
2259
2317
  getNextPageParam: (e) => e.nextPageToken || void 0,
2260
- enabled: q !== void 0,
2261
- placeholderData: ae
2262
- }), Z = a(() => X.data?.pages.flatMap((e) => e.contents) ?? [], [X.data]), Q = a(() => [...new Set(Z.map((e) => e.blueprintId))].sort(), [Z]), $ = M({
2263
- queryKey: V.blueprintNames(Q),
2264
- queryFn: () => n.getBlueprints(Q),
2265
- enabled: n !== void 0 && Q.length > 0,
2266
- placeholderData: ae,
2318
+ enabled: fe !== void 0,
2319
+ placeholderData: re
2320
+ }), X = a(() => Y.data?.pages.flatMap((e) => e.contents) ?? [], [Y.data]), Z = a(() => [...new Set(X.map((e) => e.blueprintId))].sort(), [X]), ve = N({
2321
+ queryKey: U.blueprintNames(Z),
2322
+ queryFn: () => _.getBlueprints(Z),
2323
+ enabled: Z.length > 0,
2324
+ placeholderData: re,
2267
2325
  staleTime: 6e4
2268
- }), _e = r((e) => $.data?.find((t) => t.id === e)?.name ?? e, [$.data]), ve = M({
2269
- queryKey: V.blueprintFilterOptions(),
2326
+ }), Q = r((e) => ve.data?.find((t) => t.id === e)?.name ?? e, [ve.data]), ye = N({
2327
+ queryKey: U.blueprintFilterOptions(),
2270
2328
  queryFn: async () => {
2271
- let e = n, t = [], r = "";
2272
- for (let n = 0; n < Ee; n++) {
2273
- let n = await e.searchBlueprints({
2329
+ let e = [], t = "";
2330
+ for (let n = 0; n < ke; n++) {
2331
+ let n = await _.searchBlueprints({
2274
2332
  query: "",
2275
- pageToken: r
2333
+ pageToken: t
2276
2334
  });
2277
- if (t.push(...n.blueprints), r = n.nextPageToken, r === "") break;
2335
+ if (e.push(...n.blueprints), t = n.nextPageToken, t === "") break;
2278
2336
  }
2279
- return t;
2337
+ return e;
2280
2338
  },
2281
- enabled: n !== void 0,
2282
2339
  staleTime: 6e4
2283
- }), ye = a(() => [
2340
+ }), be = a(() => [
2284
2341
  {
2285
2342
  id: "content",
2286
2343
  header: h("library.columns.content"),
2287
2344
  cell: ({ row: e }) => {
2288
- let t = ke(e.original.data);
2289
- return /* @__PURE__ */ c(w, {
2345
+ let t = Me(e.original.data);
2346
+ return /* @__PURE__ */ l(T, {
2290
2347
  value: t || e.original.id,
2291
2348
  subText: t ? e.original.id : void 0
2292
2349
  });
@@ -2295,200 +2352,187 @@ function Ae({ client: t, blueprintSource: n, onOpenContent: s, onOpenBranch: ee
2295
2352
  {
2296
2353
  id: "blueprint",
2297
2354
  header: h("library.columns.blueprint"),
2298
- cell: ({ row: e }) => /* @__PURE__ */ c(w, { value: _e(e.original.blueprintId) })
2355
+ cell: ({ row: e }) => /* @__PURE__ */ l(T, { value: Q(e.original.blueprintId) })
2299
2356
  },
2300
2357
  {
2301
2358
  id: "readOn",
2302
2359
  header: h("library.columns.readOn"),
2303
2360
  cell: ({ row: e }) => {
2304
- let t = e.original, n = t.changeSetId ? G(t.changeSetId) : t.releaseId ? h("library.readOn.release") : h("library.readOn.main");
2305
- return /* @__PURE__ */ c(w, { value: n });
2361
+ let t = e.original, n = t.changeSetId ? q(t.changeSetId) : t.releaseId ? h("library.readOn.release") : h("library.readOn.main");
2362
+ return /* @__PURE__ */ l(T, { value: n });
2306
2363
  }
2307
2364
  },
2308
2365
  {
2309
2366
  id: "revised",
2310
2367
  header: h("library.columns.revised"),
2311
- cell: ({ row: e }) => /* @__PURE__ */ c(p, { value: e.original.revisionCreateTime })
2368
+ cell: ({ row: e }) => /* @__PURE__ */ l(m, { value: e.original.revisionCreateTime })
2312
2369
  }
2313
2370
  ], [
2314
2371
  h,
2315
- _e,
2316
- G
2317
- ]), be = n ? /* @__PURE__ */ l(u, {
2372
+ Q,
2373
+ q
2374
+ ]), xe = /* @__PURE__ */ u(d, {
2318
2375
  size: "sm",
2319
2376
  variant: "solid",
2320
- onClick: () => L(!0),
2321
- children: [/* @__PURE__ */ c(ue, { size: 16 }), h("library.create.button")]
2322
- }) : /* @__PURE__ */ c(re, {
2323
- content: h("library.create.unavailable"),
2324
- children: /* @__PURE__ */ c(te, {
2325
- as: "span",
2326
- display: "inline-flex",
2327
- children: /* @__PURE__ */ l(u, {
2328
- size: "sm",
2329
- variant: "solid",
2330
- disabled: !0,
2331
- title: h("library.create.unavailable"),
2332
- children: [/* @__PURE__ */ c(ue, { size: 16 }), h("library.create.button")]
2333
- })
2334
- })
2335
- }), xe = X.error instanceof e ? X.error.message : h("library.loadError"), Ae = v ? he(v, H.data ?? []).map((e) => e.name).join(" / ") || v : h("library.allContent");
2336
- return /* @__PURE__ */ l(ie, {
2377
+ onClick: () => z(!0),
2378
+ children: [/* @__PURE__ */ l(se, { size: 16 }), h("library.create.button")]
2379
+ }), Se = Y.error instanceof e ? Y.error.message : h("library.loadError"), Ce = b ? ge(b, W.data ?? []).map((e) => e.name).join(" / ") || b : h("library.allContent");
2380
+ return /* @__PURE__ */ u(j, {
2337
2381
  title: h("library.title"),
2338
2382
  breadcrumbs: [{ label: h("library.title") }],
2339
- actions: be,
2340
- toolbar: /* @__PURE__ */ l(m, { children: [
2341
- y === "in_force" ? /* @__PURE__ */ c(A, {
2383
+ actions: xe,
2384
+ toolbar: /* @__PURE__ */ u(g, { children: [
2385
+ x === "in_force" ? /* @__PURE__ */ l(A, {
2342
2386
  fontSize: "sm",
2343
2387
  color: "muted",
2344
2388
  children: h("library.filter.searchInForce")
2345
- }) : /* @__PURE__ */ c(m.Search, {
2389
+ }) : /* @__PURE__ */ l(g.Search, {
2346
2390
  placeholder: h("library.filter.searchPlaceholder"),
2347
- value: C,
2348
- onChange: (e) => T([...e].slice(0, 200).join(""))
2391
+ value: w,
2392
+ onChange: (e) => E([...e].slice(0, 200).join(""))
2349
2393
  }),
2350
- /* @__PURE__ */ l(m.Filters, { children: [
2351
- /* @__PURE__ */ c(O, {
2394
+ /* @__PURE__ */ u(g.Filters, { children: [
2395
+ /* @__PURE__ */ l(O, {
2352
2396
  size: "sm",
2353
2397
  "aria-label": h("library.filter.view"),
2354
- value: y,
2398
+ value: x,
2355
2399
  onChange: (e) => {
2356
2400
  let t = e.target.value;
2357
- t === "in_force" && (T(""), ce("")), b(t);
2401
+ t === "in_force" && (E(""), P("")), S(t);
2358
2402
  },
2359
- children: Ce.map((e) => /* @__PURE__ */ c("option", {
2403
+ children: Ee.map((e) => /* @__PURE__ */ l("option", {
2360
2404
  value: e,
2361
2405
  children: h(`library.view.${e}`)
2362
2406
  }, e))
2363
2407
  }),
2364
- y === "change_set" ? /* @__PURE__ */ l(O, {
2408
+ x === "change_set" ? /* @__PURE__ */ u(O, {
2365
2409
  size: "sm",
2366
2410
  "aria-label": h("library.filter.changeSet"),
2367
- value: K,
2368
- onChange: (e) => S(e.target.value),
2369
- children: [U.data?.changeSets.length ? null : /* @__PURE__ */ c("option", {
2411
+ value: J,
2412
+ onChange: (e) => C(e.target.value),
2413
+ children: [G.data?.changeSets.length ? null : /* @__PURE__ */ l("option", {
2370
2414
  value: "",
2371
2415
  children: h("library.filter.noOpenChangeSet")
2372
- }), (U.data?.changeSets ?? []).map((e) => /* @__PURE__ */ c("option", {
2416
+ }), (G.data?.changeSets ?? []).map((e) => /* @__PURE__ */ l("option", {
2373
2417
  value: e.id,
2374
2418
  children: e.name
2375
2419
  }, e.id))]
2376
2420
  }) : null,
2377
- n ? /* @__PURE__ */ l(O, {
2421
+ /* @__PURE__ */ u(O, {
2378
2422
  size: "sm",
2379
2423
  "aria-label": h("library.filter.blueprint"),
2380
- value: N,
2381
- onChange: (e) => de(e.target.value),
2382
- children: [/* @__PURE__ */ c("option", {
2424
+ value: F,
2425
+ onChange: (e) => ce(e.target.value),
2426
+ children: [/* @__PURE__ */ l("option", {
2383
2427
  value: "",
2384
2428
  children: h("library.filter.anyBlueprint")
2385
- }), (ve.data ?? []).map((e) => /* @__PURE__ */ c("option", {
2429
+ }), (ye.data ?? []).map((e) => /* @__PURE__ */ l("option", {
2386
2430
  value: e.id,
2387
2431
  children: e.name
2388
2432
  }, e.id))]
2389
- }) : null,
2390
- /* @__PURE__ */ l(O, {
2433
+ }),
2434
+ /* @__PURE__ */ u(O, {
2391
2435
  size: "sm",
2392
2436
  "aria-label": h("library.filter.assignee"),
2393
- value: F,
2394
- onChange: (e) => I(e.target.value),
2437
+ value: L,
2438
+ onChange: (e) => R(e.target.value),
2395
2439
  children: [
2396
- /* @__PURE__ */ c("option", {
2440
+ /* @__PURE__ */ l("option", {
2397
2441
  value: "",
2398
2442
  children: h("library.filter.anyone")
2399
2443
  }),
2400
- /* @__PURE__ */ c("option", {
2401
- value: De,
2444
+ /* @__PURE__ */ l("option", {
2445
+ value: Ae,
2402
2446
  children: h("library.filter.me")
2403
2447
  }),
2404
- z.list().filter((e) => e.userId !== R).map((e) => /* @__PURE__ */ c("option", {
2448
+ V.list().filter((e) => e.userId !== B).map((e) => /* @__PURE__ */ l("option", {
2405
2449
  value: e.userId,
2406
2450
  children: e.displayName
2407
2451
  }, e.userId))
2408
2452
  ]
2409
2453
  })
2410
2454
  ] }),
2411
- /* @__PURE__ */ c(m.Right, { children: X.isError ? null : /* @__PURE__ */ l(m.Count, { children: [h("library.count", { count: Z.length }), X.hasNextPage ? "+" : ""] }) })
2455
+ /* @__PURE__ */ l(g.Right, { children: Y.isError ? null : /* @__PURE__ */ u(g.Count, { children: [h("library.count", { count: X.length }), Y.hasNextPage ? "+" : ""] }) })
2412
2456
  ] }),
2413
- children: [/* @__PURE__ */ l(j, {
2457
+ children: [/* @__PURE__ */ u(M, {
2414
2458
  storageKey: "contenthub-library-subnav",
2415
- children: [/* @__PURE__ */ c(j.Nav, {
2459
+ children: [/* @__PURE__ */ l(M.Nav, {
2416
2460
  "aria-label": h("library.collections"),
2417
- children: H.isSuccess ? /* @__PURE__ */ c(ge, {
2418
- collections: H.data,
2419
- activeId: v,
2420
- onSelect: B
2421
- }) : H.isError ? /* @__PURE__ */ c(A, {
2461
+ children: W.isSuccess ? /* @__PURE__ */ l(_e, {
2462
+ collections: W.data,
2463
+ activeId: b,
2464
+ onSelect: H
2465
+ }) : W.isError ? /* @__PURE__ */ l(A, {
2422
2466
  fontSize: "sm",
2423
2467
  color: "muted",
2424
2468
  px: "3",
2425
2469
  py: "2",
2426
2470
  children: h("library.collectionsError")
2427
- }) : /* @__PURE__ */ c(D, {
2471
+ }) : /* @__PURE__ */ l(te, {
2428
2472
  justify: "center",
2429
2473
  py: "4",
2430
- children: /* @__PURE__ */ c(k, { size: "sm" })
2474
+ children: /* @__PURE__ */ l(ne, { size: "sm" })
2431
2475
  })
2432
- }), /* @__PURE__ */ l(j.Detail, { children: [/* @__PURE__ */ c(j.Toolbar, { children: /* @__PURE__ */ c(A, {
2476
+ }), /* @__PURE__ */ u(M.Detail, { children: [/* @__PURE__ */ l(M.Toolbar, { children: /* @__PURE__ */ l(A, {
2433
2477
  fontSize: "sm",
2434
2478
  fontWeight: "medium",
2435
- children: Ae
2436
- }) }), /* @__PURE__ */ l(ne, {
2479
+ children: Ce
2480
+ }) }), /* @__PURE__ */ u(k, {
2437
2481
  gap: "3",
2438
2482
  children: [
2439
- X.isError ? /* @__PURE__ */ c(E, {
2483
+ Y.isError ? /* @__PURE__ */ l(D, {
2440
2484
  status: "error",
2441
- title: xe,
2485
+ title: Se,
2442
2486
  mx: "8",
2443
2487
  mt: "4"
2444
2488
  }) : null,
2445
- /* @__PURE__ */ c(f, {
2446
- columns: ye,
2447
- data: Z,
2448
- loading: X.isLoading,
2489
+ /* @__PURE__ */ l(p, {
2490
+ columns: be,
2491
+ data: X,
2492
+ loading: Y.isLoading,
2449
2493
  getRowId: (e) => `${e.id}/${e.branchId}/${e.releaseId}`,
2450
- onRowClick: (e) => s({
2494
+ onRowClick: (e) => o({
2451
2495
  contentId: e.id,
2452
2496
  changeSetId: e.changeSetId || void 0
2453
2497
  }),
2454
2498
  variant: "hoverable",
2455
- emptyState: /* @__PURE__ */ c(d, {
2456
- icon: /* @__PURE__ */ c(le, { size: 32 }),
2499
+ emptyState: /* @__PURE__ */ l(f, {
2500
+ icon: /* @__PURE__ */ l(oe, { size: 32 }),
2457
2501
  header: h("library.empty"),
2458
2502
  description: h("library.emptyHint")
2459
2503
  })
2460
2504
  }),
2461
- X.hasNextPage ? /* @__PURE__ */ c(D, {
2505
+ Y.hasNextPage ? /* @__PURE__ */ l(te, {
2462
2506
  justify: "center",
2463
2507
  pb: "4",
2464
- children: /* @__PURE__ */ c(u, {
2508
+ children: /* @__PURE__ */ l(d, {
2465
2509
  size: "sm",
2466
2510
  variant: "outline",
2467
- loading: X.isFetchingNextPage,
2468
- onClick: () => void X.fetchNextPage(),
2511
+ loading: Y.isFetchingNextPage,
2512
+ onClick: () => void Y.fetchNextPage(),
2469
2513
  children: h("library.more")
2470
2514
  })
2471
2515
  }) : null
2472
2516
  ]
2473
2517
  })] })]
2474
- }), n ? /* @__PURE__ */ c(Se, {
2475
- open: fe,
2476
- onClose: () => L(!1),
2518
+ }), /* @__PURE__ */ l(Te, {
2519
+ open: le,
2520
+ onClose: () => z(!1),
2477
2521
  client: t,
2478
- blueprintSource: n,
2479
- initialChangeSetId: y === "change_set" ? K : void 0,
2522
+ blueprintSource: _,
2523
+ initialChangeSetId: x === "change_set" ? J : void 0,
2480
2524
  onCreated: (e) => {
2481
- L(!1), ee({
2525
+ z(!1), c({
2482
2526
  changeSetId: e.changeSetId,
2483
2527
  contentId: e.id,
2484
2528
  branchId: e.branchId
2485
2529
  });
2486
2530
  }
2487
- }) : null]
2531
+ })]
2488
2532
  });
2489
2533
  }
2490
- Ae.displayName = "ContentLibrary";
2534
+ Ne.displayName = "ContentLibrary";
2491
2535
  //#endregion
2492
- export { ve as a, he as c, K as d, G as f, be as i, J as l, Ae as n, ye as o, V as p, ke as r, _e as s, Oe as t, W as u };
2536
+ export { be as a, ge as c, K as d, J as f, Se as i, he as l, U as m, Ne as n, xe as o, q as p, Me as r, ye as s, je as t, pe as u };
2493
2537
 
2494
- //# sourceMappingURL=content-library-B2eauvHt.js.map
2538
+ //# sourceMappingURL=content-library-B6Y9Bxph.js.map