@trops/dash-core 0.1.349 → 0.1.350

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.
package/dist/index.esm.js CHANGED
@@ -38809,6 +38809,12 @@ var PublishDashboardModal = function PublishDashboardModal(_ref) {
38809
38809
  result = _useState24[0],
38810
38810
  setResult = _useState24[1];
38811
38811
 
38812
+ // Visibility — chosen on the Details step. Defaults to public.
38813
+ var _useState25 = useState("public"),
38814
+ _useState26 = _slicedToArray(_useState25, 2),
38815
+ visibility = _useState26[0],
38816
+ setVisibility = _useState26[1];
38817
+
38812
38818
  // Fetch publish preview (widget names) on open
38813
38819
  useEffect(function () {
38814
38820
  if (!isOpen || !appId || !workspaceId) return;
@@ -38901,6 +38907,7 @@ var PublishDashboardModal = function PublishDashboardModal(_ref) {
38901
38907
  setPreview(null);
38902
38908
  setIsPublishing(false);
38903
38909
  setResult(null);
38910
+ setVisibility("public");
38904
38911
  }
38905
38912
  function handleClose() {
38906
38913
  setIsOpen(false);
@@ -38955,6 +38962,7 @@ var PublishDashboardModal = function PublishDashboardModal(_ref) {
38955
38962
  description: description.trim() || undefined,
38956
38963
  tags: selectedTags,
38957
38964
  icon: icon || undefined,
38965
+ visibility: visibility,
38958
38966
  componentConfigs: componentConfigs
38959
38967
  };
38960
38968
  _context2.next = 3;
@@ -39245,6 +39253,49 @@ var PublishDashboardModal = function PublishDashboardModal(_ref) {
39245
39253
  onChange: setDescription,
39246
39254
  placeholder: "A brief description of this dashboard...",
39247
39255
  rows: 3
39256
+ }), /*#__PURE__*/jsxs("div", {
39257
+ children: [/*#__PURE__*/jsx("label", {
39258
+ className: "block text-sm font-medium opacity-70 mb-2",
39259
+ children: "Visibility"
39260
+ }), /*#__PURE__*/jsx("div", {
39261
+ className: "space-y-2",
39262
+ children: [{
39263
+ value: "public",
39264
+ label: "Public",
39265
+ desc: "Anyone can find and install this dashboard."
39266
+ }, {
39267
+ value: "private",
39268
+ label: "Private",
39269
+ desc: "Only you and users you grant access to can install. The package is hidden from search and listings."
39270
+ }].map(function (opt) {
39271
+ var active = visibility === opt.value;
39272
+ return /*#__PURE__*/jsx("button", {
39273
+ type: "button",
39274
+ onClick: function onClick() {
39275
+ return setVisibility(opt.value);
39276
+ },
39277
+ className: "w-full text-left px-3 py-2.5 rounded-lg border transition-colors ".concat(active ? "bg-indigo-900/20 border-indigo-500/60" : "bg-white/5 border-white/10 hover:bg-white/10"),
39278
+ children: /*#__PURE__*/jsxs("div", {
39279
+ className: "flex items-start gap-2.5",
39280
+ children: [/*#__PURE__*/jsx("div", {
39281
+ className: "mt-0.5 h-4 w-4 rounded-full border flex-shrink-0 ".concat(active ? "border-indigo-400 bg-indigo-500" : "border-white/30"),
39282
+ children: active && /*#__PURE__*/jsx("div", {
39283
+ className: "h-full w-full rounded-full border-2 border-gray-900"
39284
+ })
39285
+ }), /*#__PURE__*/jsxs("div", {
39286
+ className: "flex-1 min-w-0",
39287
+ children: [/*#__PURE__*/jsx("div", {
39288
+ className: "text-sm font-medium",
39289
+ children: opt.label
39290
+ }), /*#__PURE__*/jsx("div", {
39291
+ className: "text-xs opacity-60 mt-0.5",
39292
+ children: opt.desc
39293
+ })]
39294
+ })]
39295
+ })
39296
+ }, opt.value);
39297
+ })
39298
+ })]
39248
39299
  })]
39249
39300
  })
39250
39301
  }), /*#__PURE__*/jsx(Stepper.Step, {
@@ -43900,6 +43951,12 @@ var PublishThemeModal = function PublishThemeModal(_ref) {
43900
43951
  result = _useState22[0],
43901
43952
  setResult = _useState22[1];
43902
43953
 
43954
+ // Visibility — chosen on the Details step. Defaults to public.
43955
+ var _useState23 = useState("public"),
43956
+ _useState24 = _slicedToArray(_useState23, 2),
43957
+ visibility = _useState24[0],
43958
+ setVisibility = _useState24[1];
43959
+
43903
43960
  // Fetch publish preview on open
43904
43961
  useEffect(function () {
43905
43962
  if (!isOpen || !appId || !themeKey) return;
@@ -43990,6 +44047,7 @@ var PublishThemeModal = function PublishThemeModal(_ref) {
43990
44047
  setPreview(null);
43991
44048
  setIsPublishing(false);
43992
44049
  setResult(null);
44050
+ setVisibility("public");
43993
44051
  }
43994
44052
  function handleClose() {
43995
44053
  setIsOpen(false);
@@ -44029,7 +44087,8 @@ var PublishThemeModal = function PublishThemeModal(_ref) {
44029
44087
  options = {
44030
44088
  authorName: authorName.trim(),
44031
44089
  description: description.trim() || undefined,
44032
- tags: selectedTags
44090
+ tags: selectedTags,
44091
+ visibility: visibility
44033
44092
  };
44034
44093
  _context2.next = 3;
44035
44094
  return window.mainApi.themes.publishTheme(appId, themeKey, options);
@@ -44341,6 +44400,49 @@ var PublishThemeModal = function PublishThemeModal(_ref) {
44341
44400
  onChange: setDescription,
44342
44401
  placeholder: "A brief description of this theme...",
44343
44402
  rows: 3
44403
+ }), /*#__PURE__*/jsxs("div", {
44404
+ children: [/*#__PURE__*/jsx("label", {
44405
+ className: "block text-sm font-medium opacity-70 mb-2",
44406
+ children: "Visibility"
44407
+ }), /*#__PURE__*/jsx("div", {
44408
+ className: "space-y-2",
44409
+ children: [{
44410
+ value: "public",
44411
+ label: "Public",
44412
+ desc: "Anyone can find and install this theme."
44413
+ }, {
44414
+ value: "private",
44415
+ label: "Private",
44416
+ desc: "Only you and users you grant access to can install. The theme is hidden from search and listings."
44417
+ }].map(function (opt) {
44418
+ var active = visibility === opt.value;
44419
+ return /*#__PURE__*/jsx("button", {
44420
+ type: "button",
44421
+ onClick: function onClick() {
44422
+ return setVisibility(opt.value);
44423
+ },
44424
+ className: "w-full text-left px-3 py-2.5 rounded-lg border transition-colors ".concat(active ? "bg-indigo-900/20 border-indigo-500/60" : "bg-white/5 border-white/10 hover:bg-white/10"),
44425
+ children: /*#__PURE__*/jsxs("div", {
44426
+ className: "flex items-start gap-2.5",
44427
+ children: [/*#__PURE__*/jsx("div", {
44428
+ className: "mt-0.5 h-4 w-4 rounded-full border flex-shrink-0 ".concat(active ? "border-indigo-400 bg-indigo-500" : "border-white/30"),
44429
+ children: active && /*#__PURE__*/jsx("div", {
44430
+ className: "h-full w-full rounded-full border-2 border-gray-900"
44431
+ })
44432
+ }), /*#__PURE__*/jsxs("div", {
44433
+ className: "flex-1 min-w-0",
44434
+ children: [/*#__PURE__*/jsx("div", {
44435
+ className: "text-sm font-medium",
44436
+ children: opt.label
44437
+ }), /*#__PURE__*/jsx("div", {
44438
+ className: "text-xs opacity-60 mt-0.5",
44439
+ children: opt.desc
44440
+ })]
44441
+ })]
44442
+ })
44443
+ }, opt.value);
44444
+ })
44445
+ })]
44344
44446
  })]
44345
44447
  })
44346
44448
  }), /*#__PURE__*/jsx(Stepper.Step, {