@burdenoff/microfe-bigconsole 2026.1119.3 → 2026.1119.5

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 (31) hide show
  1. package/dist/bigconsole/components/dashboard/PublishToStoreDialog.js +126 -80
  2. package/dist/bigconsole/components/parser/ParserSelector.js +150 -145
  3. package/dist/bigconsole/customWidget/CustomWidgetBuilderSheet.js +50 -49
  4. package/dist/bigconsole/customWidget/CustomWidgetProposalPanel.js +223 -201
  5. package/dist/bigconsole/customWidget/index.d.ts +2 -1
  6. package/dist/bigconsole/customWidget/index.js +1 -0
  7. package/dist/bigconsole/customWidget/proposalContract.d.ts +55 -1
  8. package/dist/bigconsole/customWidget/proposalContract.js +37 -14
  9. package/dist/bigconsole/customWidget/proposalPreviewData.d.ts +18 -0
  10. package/dist/bigconsole/customWidget/proposalPreviewData.js +70 -0
  11. package/dist/bigconsole/customWidget/proposalSource.d.ts +10 -0
  12. package/dist/bigconsole/customWidget/proposalSource.js +197 -51
  13. package/dist/bigconsole/graphql/storeTemplates.d.ts +1 -1
  14. package/dist/bigconsole/graphql/storeTemplates.js +5 -5
  15. package/dist/bigconsole/hooks/useParserOperations.js +80 -74
  16. package/dist/bigconsole/hooks/usePublishOwnerOptions.d.ts +10 -0
  17. package/dist/bigconsole/hooks/usePublishOwnerOptions.js +48 -0
  18. package/dist/bigconsole/hooks/useStoreDashboardTemplates.d.ts +8 -0
  19. package/dist/bigconsole/hooks/useStoreDashboardTemplates.js +3 -1
  20. package/dist/bigconsole/pages/ParserBuilderPage.js +540 -518
  21. package/dist/bigconsole/store/parserScope.d.ts +24 -0
  22. package/dist/bigconsole/store/parserScope.js +17 -0
  23. package/dist/bigconsole/store/parserStore.d.ts +3 -0
  24. package/dist/bigconsole/store/parserStore.js +70 -68
  25. package/dist/bigconsole/utils/publishOwner.d.ts +100 -0
  26. package/dist/bigconsole/utils/publishOwner.js +71 -0
  27. package/dist/generated/global-operations.d.ts +19 -0
  28. package/dist/generated/global-operations.js +80 -1
  29. package/dist/generated/wspace-operations.d.ts +10 -0
  30. package/dist/generated/wspace-operations.js +180 -110
  31. package/package.json +1 -1
@@ -1,149 +1,195 @@
1
- import e from "../../hooks/useStoreDashboardTemplates.js";
2
- import { memo as t, useCallback as n, useEffect as r, useState as i } from "react";
3
- import { Button as a, Dialog as o, DialogContent as s, DialogDescription as c, DialogFooter as l, DialogHeader as u, DialogTitle as d, Input as f, Spinner as p, Textarea as m } from "@burdenoff/fe-libs/ui";
4
- import { useI18n as h } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
5
- import { jsx as g, jsxs as _ } from "react/jsx-runtime";
1
+ import { usePublishOwnerOptions as e } from "../../hooks/usePublishOwnerOptions.js";
2
+ import t from "../../hooks/useStoreDashboardTemplates.js";
3
+ import { publishOwnerName as n } from "../../utils/publishOwner.js";
4
+ import { memo as r, useCallback as i, useEffect as a, useState as o } from "react";
5
+ import { Button as s, Dialog as c, DialogContent as l, DialogDescription as u, DialogFooter as ee, DialogHeader as d, DialogTitle as f, Input as p, Select as m, SelectContent as h, SelectItem as g, SelectTrigger as _, SelectValue as v, Spinner as y, Textarea as b } from "@burdenoff/fe-libs/ui";
6
+ import { useI18n as te } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
7
+ import { jsx as x, jsxs as S } from "react/jsx-runtime";
6
8
  // src/bigconsole/components/dashboard/PublishToStoreDialog.tsx
7
- function v(e) {
9
+ var C = "__personal__";
10
+ function w(e) {
8
11
  return e.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean).join("-").slice(0, 60);
9
12
  }
10
- var y = t(function({ isOpen: t, dashboardId: y, dashboardName: b, dashboardDescription: x, onClose: S, onPublished: C }) {
11
- let { t: w } = h(), { publishToStore: T } = e({ autoLoad: !1 }), [E, D] = i(b), [O, k] = i(v(b)), [A, j] = i(x ?? ""), [M, N] = i(!1), [P, F] = i(!1), [I, L] = i(null), [R, z] = i(null);
12
- r(() => {
13
- t && (D(b), k(v(b)), j(x ?? ""), N(!1), L(null), z(null));
13
+ var T = r(function({ isOpen: r, dashboardId: T, dashboardName: E, dashboardDescription: D, onClose: O, onPublished: k }) {
14
+ let { t: A } = te(), { publishToStore: j } = t({ autoLoad: !1 }), [M, N] = o(E), [P, F] = o(w(E)), [I, L] = o(D ?? ""), [R, z] = o(!1), [B, V] = o(!1), [H, U] = o(null), [W, G] = o(null), K = e(r), [q, J] = o(null), [Y, X] = o(!1);
15
+ a(() => {
16
+ Y || J(K.defaultOrganizationId);
17
+ }, [K.defaultOrganizationId, Y]), a(() => {
18
+ r && (N(E), F(w(E)), L(D ?? ""), z(!1), U(null), G(null), X(!1));
14
19
  }, [
15
- t,
16
- b,
17
- x
20
+ r,
21
+ E,
22
+ D
18
23
  ]);
19
- let B = n(async () => {
20
- if (!E.trim()) L(w("bigconsole.dashboards.publishStore.error.nameRequired", "A template name is required"));
21
- else if (!O.trim()) L(w("bigconsole.dashboards.publishStore.error.slugRequired", "A slug is required"));
22
- else if (!A.trim()) L(w("bigconsole.dashboards.publishStore.error.descriptionRequired", "A description is required — it is what people see in the gallery"));
24
+ let Z = i(async () => {
25
+ if (!M.trim()) U(A("bigconsole.dashboards.publishStore.error.nameRequired", "A template name is required"));
26
+ else if (!P.trim()) U(A("bigconsole.dashboards.publishStore.error.slugRequired", "A slug is required"));
27
+ else if (!I.trim()) U(A("bigconsole.dashboards.publishStore.error.descriptionRequired", "A description is required — it is what people see in the gallery"));
23
28
  else {
24
- L(null), F(!0);
29
+ U(null), V(!0);
25
30
  try {
26
- let e = await T({
27
- dashboardId: y,
28
- name: E.trim(),
29
- slug: O.trim(),
30
- description: A.trim(),
31
- includeSampleData: M
31
+ let e = await j({
32
+ dashboardId: T,
33
+ name: M.trim(),
34
+ slug: P.trim(),
35
+ description: I.trim(),
36
+ includeSampleData: R,
37
+ developerOrganizationId: q
32
38
  });
33
39
  if (!e.success) {
34
- L(e.errorMessage ?? w("bigconsole.dashboards.publishStore.error.publishFailed", "Failed to publish to the store"));
40
+ U(e.errorMessage ?? A("bigconsole.dashboards.publishStore.error.publishFailed", "Failed to publish to the store"));
35
41
  return;
36
42
  }
37
- z(e), C?.(e);
43
+ G(e), k?.(e);
38
44
  } finally {
39
- F(!1);
45
+ V(!1);
40
46
  }
41
47
  }
42
48
  }, [
43
- E,
44
- O,
45
- A,
46
49
  M,
47
- y,
50
+ P,
51
+ I,
52
+ R,
53
+ q,
48
54
  T,
49
- C,
50
- w
51
- ]), V = {
55
+ j,
56
+ k,
57
+ A
58
+ ]), ne = A("bigconsole.dashboards.publishStore.owner.personal", "Personal (only you)"), re = A("bigconsole.dashboards.publishStore.owner.viewerSuffix", "viewer — cannot publish"), ie = A("bigconsole.dashboards.publishStore.owner.inactiveSuffix", "inactive member — cannot publish"), ae = (e) => e.organizationId === null ? ne : e.disabledReason === "inactive" ? `${e.name} (${ie})` : e.disabledReason === "viewer" ? `${e.name} (${re})` : e.name, Q = W ? n(K.options, W.developerOrganizationId ?? null) : null, $ = {
52
59
  display: "block",
53
60
  marginBottom: "var(--space-2xs)",
54
61
  fontSize: "var(--font-size-sm)"
55
62
  };
56
- return /* @__PURE__ */ g(o, {
57
- open: t,
58
- onOpenChange: (e) => !e && !P && S(),
59
- children: /* @__PURE__ */ _(s, {
63
+ return /* @__PURE__ */ x(c, {
64
+ open: r,
65
+ onOpenChange: (e) => !e && !B && O(),
66
+ children: /* @__PURE__ */ S(l, {
60
67
  style: { maxWidth: "520px" },
61
68
  children: [
62
- /* @__PURE__ */ _(u, { children: [/* @__PURE__ */ g(d, { children: w("bigconsole.dashboards.publishStore.title", "Publish as Template") }), /* @__PURE__ */ g(c, { children: w("bigconsole.dashboards.publishStore.subtitle", "Share this dashboard as a reusable template. Your data sources are replaced with named slots, so nothing from this workspace is published.") })] }),
63
- R ? /* @__PURE__ */ _("div", {
69
+ /* @__PURE__ */ S(d, { children: [/* @__PURE__ */ x(f, { children: A("bigconsole.dashboards.publishStore.title", "Publish as Template") }), /* @__PURE__ */ x(u, { children: A("bigconsole.dashboards.publishStore.subtitle", "Share this dashboard as a reusable template. Your data sources are replaced with named slots, so nothing from this workspace is published.") })] }),
70
+ W ? /* @__PURE__ */ S("div", {
64
71
  style: { padding: "var(--space-md) 0" },
65
72
  children: [
66
- /* @__PURE__ */ g("p", {
73
+ /* @__PURE__ */ x("p", {
67
74
  style: { fontWeight: "var(--font-weight-medium)" },
68
- children: w("bigconsole.dashboards.publishStore.result.title", "Draft template created")
75
+ children: A("bigconsole.dashboards.publishStore.result.title", "Draft template created")
76
+ }),
77
+ /* @__PURE__ */ x("p", {
78
+ style: {
79
+ fontSize: "var(--font-size-sm)",
80
+ color: "var(--color-text-muted)"
81
+ },
82
+ children: W.sinkCount === 1 ? A("bigconsole.dashboards.publishStore.result.sinksOne", "{{count}} data source turned into slots. Finish in the Developer Portal: review the listing, then submit it for approval. It appears in the gallery once approved.", { count: W.sinkCount ?? "" }) : A("bigconsole.dashboards.publishStore.result.sinksMany", "{{count}} data sources turned into slots. Finish in the Developer Portal: review the listing, then submit it for approval. It appears in the gallery once approved.", { count: W.sinkCount ?? "" })
69
83
  }),
70
- /* @__PURE__ */ g("p", {
84
+ /* @__PURE__ */ x("p", {
85
+ "data-testid": "publish-store-owner-result",
71
86
  style: {
72
87
  fontSize: "var(--font-size-sm)",
73
88
  color: "var(--color-text-muted)"
74
89
  },
75
- children: R.sinkCount === 1 ? w("bigconsole.dashboards.publishStore.result.sinksOne", "{{count}} data source turned into slots. Finish in the Developer Portal: review the listing, then submit it for approval. It appears in the gallery once approved.", { count: R.sinkCount ?? "" }) : w("bigconsole.dashboards.publishStore.result.sinksMany", "{{count}} data sources turned into slots. Finish in the Developer Portal: review the listing, then submit it for approval. It appears in the gallery once approved.", { count: R.sinkCount ?? "" })
90
+ children: Q ? A("bigconsole.dashboards.publishStore.result.ownerOrg", "Saved as a draft owned by {{owner}}. In the Developer Portal, open My Applications with {{owner}} selected in the organization switcher to find it.", { owner: Q }) : A("bigconsole.dashboards.publishStore.result.ownerPersonal", "Saved as your personal draft. In the Developer Portal, open My Applications and choose Personal (or All) in the organization switcher to find it.")
76
91
  }),
77
- R.unknownSinkIds.length > 0 && /* @__PURE__ */ g("p", {
92
+ W.unknownSinkIds.length > 0 && /* @__PURE__ */ x("p", {
78
93
  style: {
79
94
  fontSize: "var(--font-size-sm)",
80
95
  color: "var(--color-text-warning)"
81
96
  },
82
- children: R.unknownSinkIds.length === 1 ? w("bigconsole.dashboards.publishStore.result.unknownOne", "{{count}} data source could not be named — those slots use generic labels.", { count: R.unknownSinkIds.length ?? "" }) : w("bigconsole.dashboards.publishStore.result.unknownMany", "{{count}} data sources could not be named — those slots use generic labels.", { count: R.unknownSinkIds.length ?? "" })
97
+ children: W.unknownSinkIds.length === 1 ? A("bigconsole.dashboards.publishStore.result.unknownOne", "{{count}} data source could not be named — those slots use generic labels.", { count: W.unknownSinkIds.length ?? "" }) : A("bigconsole.dashboards.publishStore.result.unknownMany", "{{count}} data sources could not be named — those slots use generic labels.", { count: W.unknownSinkIds.length ?? "" })
83
98
  })
84
99
  ]
85
- }) : /* @__PURE__ */ _("div", {
100
+ }) : /* @__PURE__ */ S("div", {
86
101
  style: {
87
102
  display: "flex",
88
103
  flexDirection: "column",
89
104
  gap: "var(--space-sm)"
90
105
  },
91
106
  children: [
92
- /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
107
+ /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("label", {
93
108
  htmlFor: "tpl-name",
94
- style: V,
95
- children: w("bigconsole.dashboards.publishStore.field.name", "Template name")
96
- }), /* @__PURE__ */ g(f, {
109
+ style: $,
110
+ children: A("bigconsole.dashboards.publishStore.field.name", "Template name")
111
+ }), /* @__PURE__ */ x(p, {
97
112
  id: "tpl-name",
98
- value: E,
99
- disabled: P,
113
+ value: M,
114
+ disabled: B,
100
115
  onChange: (e) => {
101
- D(e.target.value), k(v(e.target.value));
116
+ N(e.target.value), F(w(e.target.value));
102
117
  }
103
118
  })] }),
104
- /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
119
+ /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("label", {
105
120
  htmlFor: "tpl-slug",
106
- style: V,
107
- children: w("bigconsole.dashboards.publishStore.field.slug", "Slug")
108
- }), /* @__PURE__ */ g(f, {
121
+ style: $,
122
+ children: A("bigconsole.dashboards.publishStore.field.slug", "Slug")
123
+ }), /* @__PURE__ */ x(p, {
109
124
  id: "tpl-slug",
110
- value: O,
111
- disabled: P,
112
- onChange: (e) => k(v(e.target.value))
125
+ value: P,
126
+ disabled: B,
127
+ onChange: (e) => F(w(e.target.value))
113
128
  })] }),
114
- /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
129
+ /* @__PURE__ */ S("div", { children: [
130
+ /* @__PURE__ */ x("label", {
131
+ htmlFor: "tpl-owner",
132
+ style: $,
133
+ children: A("bigconsole.dashboards.publishStore.field.owner", "Publish as")
134
+ }),
135
+ /* @__PURE__ */ S(m, {
136
+ value: q ?? C,
137
+ disabled: B || K.loading,
138
+ onValueChange: (e) => {
139
+ X(!0), J(e === C ? null : e);
140
+ },
141
+ children: [/* @__PURE__ */ x(_, {
142
+ id: "tpl-owner",
143
+ "data-testid": "publish-store-owner",
144
+ children: /* @__PURE__ */ x(v, {})
145
+ }), /* @__PURE__ */ x(h, { children: K.options.map((e) => /* @__PURE__ */ x(g, {
146
+ value: e.organizationId ?? C,
147
+ disabled: e.disabled,
148
+ children: ae(e)
149
+ }, e.organizationId ?? C)) })]
150
+ }),
151
+ /* @__PURE__ */ x("p", {
152
+ style: {
153
+ marginTop: "var(--space-2xs)",
154
+ fontSize: "var(--font-size-xs)",
155
+ color: "var(--color-text-muted)"
156
+ },
157
+ children: K.loading ? A("bigconsole.dashboards.publishStore.owner.loading", "Loading your developer organizations…") : K.error ? A("bigconsole.dashboards.publishStore.owner.loadFailed", "Could not load your developer organizations, so this template can only be published as personal.") : A("bigconsole.dashboards.publishStore.owner.hint", "The draft appears under this owner in the Developer Portal.")
158
+ })
159
+ ] }),
160
+ /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("label", {
115
161
  htmlFor: "tpl-desc",
116
- style: V,
117
- children: w("bigconsole.dashboards.publishStore.field.description", "Description")
118
- }), /* @__PURE__ */ g(m, {
162
+ style: $,
163
+ children: A("bigconsole.dashboards.publishStore.field.description", "Description")
164
+ }), /* @__PURE__ */ x(b, {
119
165
  id: "tpl-desc",
120
166
  rows: 3,
121
- value: A,
122
- disabled: P,
123
- placeholder: w("bigconsole.dashboards.publishStore.field.descriptionPlaceholder", "What is this dashboard for, and what data does it need?"),
124
- onChange: (e) => j(e.target.value)
167
+ value: I,
168
+ disabled: B,
169
+ placeholder: A("bigconsole.dashboards.publishStore.field.descriptionPlaceholder", "What is this dashboard for, and what data does it need?"),
170
+ onChange: (e) => L(e.target.value)
125
171
  })] }),
126
- I && /* @__PURE__ */ g("p", {
172
+ H && /* @__PURE__ */ x("p", {
127
173
  style: {
128
174
  color: "var(--color-text-danger)",
129
175
  fontSize: "var(--font-size-sm)"
130
176
  },
131
- children: I
177
+ children: H
132
178
  })
133
179
  ]
134
180
  }),
135
- /* @__PURE__ */ _(l, { children: [/* @__PURE__ */ g(a, {
181
+ /* @__PURE__ */ S(ee, { children: [/* @__PURE__ */ x(s, {
136
182
  variant: "outline",
137
- onClick: S,
138
- disabled: P,
139
- children: R ? w("bigconsole.dashboards.publishStore.action.done", "Done") : w("bigconsole.dashboards.publishStore.action.cancel", "Cancel")
140
- }), !R && /* @__PURE__ */ g(a, {
141
- onClick: B,
142
- disabled: P,
143
- children: P ? /* @__PURE__ */ g(p, {}) : w("bigconsole.dashboards.publishStore.action.publish", "Publish")
183
+ onClick: O,
184
+ disabled: B,
185
+ children: W ? A("bigconsole.dashboards.publishStore.action.done", "Done") : A("bigconsole.dashboards.publishStore.action.cancel", "Cancel")
186
+ }), !W && /* @__PURE__ */ x(s, {
187
+ onClick: Z,
188
+ disabled: B || K.loading,
189
+ children: B ? /* @__PURE__ */ x(y, {}) : A("bigconsole.dashboards.publishStore.action.publish", "Publish")
144
190
  })] })
145
191
  ]
146
192
  })
147
193
  });
148
194
  });
149
- export { y as PublishToStoreDialog, y as default };
195
+ export { T as PublishToStoreDialog, T as default };