@trops/dash-core 0.1.349 → 0.1.351

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.js CHANGED
@@ -38827,6 +38827,12 @@ var PublishDashboardModal = function PublishDashboardModal(_ref) {
38827
38827
  result = _useState24[0],
38828
38828
  setResult = _useState24[1];
38829
38829
 
38830
+ // Visibility — chosen on the Details step. Defaults to public.
38831
+ var _useState25 = React.useState("public"),
38832
+ _useState26 = _slicedToArray(_useState25, 2),
38833
+ visibility = _useState26[0],
38834
+ setVisibility = _useState26[1];
38835
+
38830
38836
  // Fetch publish preview (widget names) on open
38831
38837
  React.useEffect(function () {
38832
38838
  if (!isOpen || !appId || !workspaceId) return;
@@ -38919,6 +38925,7 @@ var PublishDashboardModal = function PublishDashboardModal(_ref) {
38919
38925
  setPreview(null);
38920
38926
  setIsPublishing(false);
38921
38927
  setResult(null);
38928
+ setVisibility("public");
38922
38929
  }
38923
38930
  function handleClose() {
38924
38931
  setIsOpen(false);
@@ -38973,6 +38980,7 @@ var PublishDashboardModal = function PublishDashboardModal(_ref) {
38973
38980
  description: description.trim() || undefined,
38974
38981
  tags: selectedTags,
38975
38982
  icon: icon || undefined,
38983
+ visibility: visibility,
38976
38984
  componentConfigs: componentConfigs
38977
38985
  };
38978
38986
  _context2.next = 3;
@@ -39263,6 +39271,49 @@ var PublishDashboardModal = function PublishDashboardModal(_ref) {
39263
39271
  onChange: setDescription,
39264
39272
  placeholder: "A brief description of this dashboard...",
39265
39273
  rows: 3
39274
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
39275
+ children: [/*#__PURE__*/jsxRuntime.jsx("label", {
39276
+ className: "block text-sm font-medium opacity-70 mb-2",
39277
+ children: "Visibility"
39278
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
39279
+ className: "space-y-2",
39280
+ children: [{
39281
+ value: "public",
39282
+ label: "Public",
39283
+ desc: "Anyone can find and install this dashboard."
39284
+ }, {
39285
+ value: "private",
39286
+ label: "Private",
39287
+ desc: "Only you and users you grant access to can install. The package is hidden from search and listings."
39288
+ }].map(function (opt) {
39289
+ var active = visibility === opt.value;
39290
+ return /*#__PURE__*/jsxRuntime.jsx("button", {
39291
+ type: "button",
39292
+ onClick: function onClick() {
39293
+ return setVisibility(opt.value);
39294
+ },
39295
+ 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"),
39296
+ children: /*#__PURE__*/jsxRuntime.jsxs("div", {
39297
+ className: "flex items-start gap-2.5",
39298
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
39299
+ 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"),
39300
+ children: active && /*#__PURE__*/jsxRuntime.jsx("div", {
39301
+ className: "h-full w-full rounded-full border-2 border-gray-900"
39302
+ })
39303
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
39304
+ className: "flex-1 min-w-0",
39305
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
39306
+ className: "text-sm font-medium",
39307
+ children: opt.label
39308
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
39309
+ className: "text-xs opacity-60 mt-0.5",
39310
+ children: opt.desc
39311
+ })]
39312
+ })]
39313
+ })
39314
+ }, opt.value);
39315
+ })
39316
+ })]
39266
39317
  })]
39267
39318
  })
39268
39319
  }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Stepper.Step, {
@@ -43918,6 +43969,12 @@ var PublishThemeModal = function PublishThemeModal(_ref) {
43918
43969
  result = _useState22[0],
43919
43970
  setResult = _useState22[1];
43920
43971
 
43972
+ // Visibility — chosen on the Details step. Defaults to public.
43973
+ var _useState23 = React.useState("public"),
43974
+ _useState24 = _slicedToArray(_useState23, 2),
43975
+ visibility = _useState24[0],
43976
+ setVisibility = _useState24[1];
43977
+
43921
43978
  // Fetch publish preview on open
43922
43979
  React.useEffect(function () {
43923
43980
  if (!isOpen || !appId || !themeKey) return;
@@ -44008,6 +44065,7 @@ var PublishThemeModal = function PublishThemeModal(_ref) {
44008
44065
  setPreview(null);
44009
44066
  setIsPublishing(false);
44010
44067
  setResult(null);
44068
+ setVisibility("public");
44011
44069
  }
44012
44070
  function handleClose() {
44013
44071
  setIsOpen(false);
@@ -44047,7 +44105,8 @@ var PublishThemeModal = function PublishThemeModal(_ref) {
44047
44105
  options = {
44048
44106
  authorName: authorName.trim(),
44049
44107
  description: description.trim() || undefined,
44050
- tags: selectedTags
44108
+ tags: selectedTags,
44109
+ visibility: visibility
44051
44110
  };
44052
44111
  _context2.next = 3;
44053
44112
  return window.mainApi.themes.publishTheme(appId, themeKey, options);
@@ -44359,6 +44418,49 @@ var PublishThemeModal = function PublishThemeModal(_ref) {
44359
44418
  onChange: setDescription,
44360
44419
  placeholder: "A brief description of this theme...",
44361
44420
  rows: 3
44421
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
44422
+ children: [/*#__PURE__*/jsxRuntime.jsx("label", {
44423
+ className: "block text-sm font-medium opacity-70 mb-2",
44424
+ children: "Visibility"
44425
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
44426
+ className: "space-y-2",
44427
+ children: [{
44428
+ value: "public",
44429
+ label: "Public",
44430
+ desc: "Anyone can find and install this theme."
44431
+ }, {
44432
+ value: "private",
44433
+ label: "Private",
44434
+ desc: "Only you and users you grant access to can install. The theme is hidden from search and listings."
44435
+ }].map(function (opt) {
44436
+ var active = visibility === opt.value;
44437
+ return /*#__PURE__*/jsxRuntime.jsx("button", {
44438
+ type: "button",
44439
+ onClick: function onClick() {
44440
+ return setVisibility(opt.value);
44441
+ },
44442
+ 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"),
44443
+ children: /*#__PURE__*/jsxRuntime.jsxs("div", {
44444
+ className: "flex items-start gap-2.5",
44445
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
44446
+ 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"),
44447
+ children: active && /*#__PURE__*/jsxRuntime.jsx("div", {
44448
+ className: "h-full w-full rounded-full border-2 border-gray-900"
44449
+ })
44450
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
44451
+ className: "flex-1 min-w-0",
44452
+ children: [/*#__PURE__*/jsxRuntime.jsx("div", {
44453
+ className: "text-sm font-medium",
44454
+ children: opt.label
44455
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {
44456
+ className: "text-xs opacity-60 mt-0.5",
44457
+ children: opt.desc
44458
+ })]
44459
+ })]
44460
+ })
44461
+ }, opt.value);
44462
+ })
44463
+ })]
44362
44464
  })]
44363
44465
  })
44364
44466
  }), /*#__PURE__*/jsxRuntime.jsx(DashReact.Stepper.Step, {