@stacksjs/desktop 0.2.70 → 0.2.71

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/iap.d.ts CHANGED
@@ -73,7 +73,7 @@ export declare interface IAPAPI {
73
73
  isEligibleForIntroOffer: (productId: string) => Promise<boolean>
74
74
  }
75
75
  export type IAPProductType = | 'consumable'
76
- | 'non-consumable'
77
- | 'auto-subscription'
78
- | 'non-auto-subscription';
76
+ | 'non-consumable'
77
+ | 'auto-subscription'
78
+ | 'non-auto-subscription';
79
79
  export type IAPSubscriptionPeriod = 'day' | 'week' | 'month' | 'year';
package/dist/index.js CHANGED
@@ -355,7 +355,7 @@ function createButton(props) {
355
355
  const iconHtml = icon ? `<span class="stx-button-icon">${icon}</span>` : "";
356
356
  const loadingHtml = loading ? '<span class="stx-button-spinner"></span>' : "";
357
357
  const content = iconPosition === "left" ? `${iconHtml}${loadingHtml}<span class="stx-button-text">${escapeHtml2(text)}</span>` : `<span class="stx-button-text">${escapeHtml2(text)}</span>${iconHtml}${loadingHtml}`;
358
- return `<button id="${id}" class="${classes}" ${disabled || loading ? "disabled" : ""} ${styleStr ? `style="${styleStr}"` : ""}>${content}</button>`;
358
+ return `<button id="${id}" class="${classes}" ${disabled || loading ? "disabled" : ""} ${styleStr ? `style='${styleStr}'` : ""}>${content}</button>`;
359
359
  }
360
360
  function createTextInput(props) {
361
361
  const {
@@ -464,7 +464,7 @@ function createSlider(props) {
464
464
  if (showValue) {
465
465
  html += `<span class="stx-slider-value">${value}</span>`;
466
466
  }
467
- return `<div class="${classes}" ${styleStr ? `style="${styleStr}"` : ""}>${html}</div>`;
467
+ return `<div class="${classes}" ${styleStr ? `style='${styleStr}'` : ""}>${html}</div>`;
468
468
  }
469
469
  function createProgressBar(props) {
470
470
  const {
@@ -499,7 +499,7 @@ function createBadge(props) {
499
499
  } = props;
500
500
  const classes = buildClasses("stx-badge", `stx-badge--${variant}`, `stx-badge--${size}`, className);
501
501
  const styleStr = buildStyles(style);
502
- return `<span id="${id}" class="${classes}" ${styleStr ? `style="${styleStr}"` : ""}>${escapeHtml2(text)}</span>`;
502
+ return `<span id="${id}" class="${classes}" ${styleStr ? `style='${styleStr}'` : ""}>${escapeHtml2(text)}</span>`;
503
503
  }
504
504
  function createAvatar(props) {
505
505
  const {
@@ -558,7 +558,7 @@ function createCard(props) {
558
558
  if (footer) {
559
559
  html += `<div class="stx-card-footer">${escapeHtml2(footer)}</div>`;
560
560
  }
561
- return `<div id="${id}" class="${classes}" ${styleStr ? `style="${styleStr}"` : ""}>${html}</div>`;
561
+ return `<div id="${id}" class="${classes}" ${styleStr ? `style='${styleStr}'` : ""}>${html}</div>`;
562
562
  }
563
563
  function createTabs(props) {
564
564
  const {
@@ -576,7 +576,7 @@ function createTabs(props) {
576
576
  const tabClasses = buildClasses("stx-tab", isActive && "stx-tab--active", tab.disabled && "stx-tab--disabled");
577
577
  return `<button class="${tabClasses}" data-value="${escapeHtml2(tab.value)}" ${tab.disabled ? "disabled" : ""} role="tab" aria-selected="${isActive}">${escapeHtml2(tab.label)}</button>`;
578
578
  }).join("");
579
- return `<div id="${id}" class="${classes}" role="tablist" ${styleStr ? `style="${styleStr}"` : ""}>${tabsHtml}</div>`;
579
+ return `<div id="${id}" class="${classes}" role="tablist" ${styleStr ? `style='${styleStr}'` : ""}>${tabsHtml}</div>`;
580
580
  }
581
581
  function createDropdown(props) {
582
582
  const {
@@ -596,7 +596,7 @@ function createDropdown(props) {
596
596
  return `<option value="${escapeHtml2(opt.value)}" ${selected} ${disabledAttr}>${escapeHtml2(opt.label)}</option>`;
597
597
  }).join("");
598
598
  const placeholderOption = value ? "" : `<option value="" disabled selected>${escapeHtml2(placeholder)}</option>`;
599
- return `<select id="${id}" class="${classes}" ${disabled ? "disabled" : ""} ${styleStr ? `style="${styleStr}"` : ""}>${placeholderOption}${optionsHtml}</select>`;
599
+ return `<select id="${id}" class="${classes}" ${disabled ? "disabled" : ""} ${styleStr ? `style='${styleStr}'` : ""}>${placeholderOption}${optionsHtml}</select>`;
600
600
  }
601
601
  function createRating(props) {
602
602
  const {
@@ -618,7 +618,7 @@ function createRating(props) {
618
618
  const starClass = filled ? "stx-star--filled" : halfFilled ? "stx-star--half" : "";
619
619
  starsHtml += `<span class="stx-star ${starClass}" data-value="${i}">\u2605</span>`;
620
620
  }
621
- return `<div id="${id}" class="${classes}" role="slider" aria-valuenow="${value}" aria-valuemin="0" aria-valuemax="${max}" ${styleStr ? `style="${styleStr}"` : ""}>${starsHtml}</div>`;
621
+ return `<div id="${id}" class="${classes}" role="slider" aria-valuenow="${value}" aria-valuemin="0" aria-valuemax="${max}" ${styleStr ? `style='${styleStr}'` : ""}>${starsHtml}</div>`;
622
622
  }
623
623
  function createRadioButton(props) {
624
624
  const {
@@ -676,7 +676,7 @@ function createColorPicker(props) {
676
676
  }
677
677
  html += "</div>";
678
678
  }
679
- return `<div class="${classes}" ${styleStr ? `style="${styleStr}"` : ""}>${html}</div>`;
679
+ return `<div class="${classes}" ${styleStr ? `style='${styleStr}'` : ""}>${html}</div>`;
680
680
  }
681
681
  function createDatePicker(props) {
682
682
  const {
@@ -713,7 +713,7 @@ function createDatePicker(props) {
713
713
  <input ${inputAttrs} />
714
714
  ${showClear && dateValue ? '<button class="stx-date-picker-clear" type="button">&times;</button>' : ""}
715
715
  </div>`;
716
- return `<div class="${classes}" ${styleStr ? `style="${styleStr}"` : ""}>${html}</div>`;
716
+ return `<div class="${classes}" ${styleStr ? `style='${styleStr}'` : ""}>${html}</div>`;
717
717
  }
718
718
  function createTimePicker(props) {
719
719
  const {
@@ -743,7 +743,7 @@ function createTimePicker(props) {
743
743
  html += `<label class="stx-time-picker-label" for="${id}">${escapeHtml2(label)}</label>`;
744
744
  }
745
745
  html += `<input ${inputAttrs} class="stx-time-picker-input" />`;
746
- return `<div class="${classes}" ${styleStr ? `style="${styleStr}"` : ""}>${html}</div>`;
746
+ return `<div class="${classes}" ${styleStr ? `style='${styleStr}'` : ""}>${html}</div>`;
747
747
  }
748
748
  function createAutocomplete(props) {
749
749
  const {
@@ -774,7 +774,7 @@ function createAutocomplete(props) {
774
774
  html += `<li class="stx-autocomplete-item ${opt.value === value ? "stx-autocomplete-item--selected" : ""}" data-value="${escapeHtml2(opt.value)}">${escapeHtml2(opt.label)}</li>`;
775
775
  }
776
776
  html += "</ul>";
777
- return `<div class="${classes}" ${styleStr ? `style="${styleStr}"` : ""}>${html}</div>`;
777
+ return `<div class="${classes}" ${styleStr ? `style='${styleStr}'` : ""}>${html}</div>`;
778
778
  }
779
779
  function createLabel(props) {
780
780
  const {
@@ -788,7 +788,7 @@ function createLabel(props) {
788
788
  } = props;
789
789
  const classes = buildClasses("stx-label", `stx-label--${size}`, className);
790
790
  const styleStr = buildStyles(style);
791
- return `<label id="${id}" class="${classes}" ${htmlFor ? `for="${escapeHtml2(htmlFor)}"` : ""} ${styleStr ? `style="${styleStr}"` : ""}>${escapeHtml2(text)}${required ? '<span class="stx-label-required">*</span>' : ""}</label>`;
791
+ return `<label id="${id}" class="${classes}" ${htmlFor ? `for='${escapeHtml2(htmlFor)}'` : ""} ${styleStr ? `style='${styleStr}'` : ""}>${escapeHtml2(text)}${required ? '<span class="stx-label-required">*</span>' : ""}</label>`;
792
792
  }
793
793
  function createImageView(props) {
794
794
  const {
@@ -811,7 +811,7 @@ function createImageView(props) {
811
811
  imageStyles.height = typeof height === "number" ? `${height}px` : height;
812
812
  const combinedStyle = [buildStyles(imageStyles), buildStyles(style)].filter(Boolean).join("; ");
813
813
  const fallbackAttr = fallback ? `onerror="this.src='${escapeHtml2(fallback)}'"` : "";
814
- return `<img id="${id}" class="${classes}" src="${escapeHtml2(src)}" alt="${escapeHtml2(alt)}" loading="${loading}" ${combinedStyle ? `style="${combinedStyle}"` : ""} ${fallbackAttr} />`;
814
+ return `<img id="${id}" class="${classes}" src="${escapeHtml2(src)}" alt="${escapeHtml2(alt)}" loading="${loading}" ${combinedStyle ? `style='${combinedStyle}'` : ""} ${fallbackAttr} />`;
815
815
  }
816
816
  function createChip(props) {
817
817
  const {
@@ -834,7 +834,7 @@ function createChip(props) {
834
834
  if (removable) {
835
835
  html += '<button class="stx-chip-remove" type="button">&times;</button>';
836
836
  }
837
- return `<span id="${id}" class="${classes}" ${styleStr ? `style="${styleStr}"` : ""}>${html}</span>`;
837
+ return `<span id="${id}" class="${classes}" ${styleStr ? `style='${styleStr}'` : ""}>${html}</span>`;
838
838
  }
839
839
  function createTooltip(props) {
840
840
  const {
@@ -872,7 +872,7 @@ function createScrollView(props) {
872
872
  if (width)
873
873
  scrollStyles.width = typeof width === "number" ? `${width}px` : width;
874
874
  const combinedStyle = [buildStyles(scrollStyles), buildStyles(style)].filter(Boolean).join("; ");
875
- return `<div id="${id}" class="${classes}" ${combinedStyle ? `style="${combinedStyle}"` : ""}>${children}</div>`;
875
+ return `<div id="${id}" class="${classes}" ${combinedStyle ? `style='${combinedStyle}'` : ""}>${children}</div>`;
876
876
  }
877
877
  function createSplitView(props) {
878
878
  const {
@@ -918,7 +918,7 @@ function createAccordion(props) {
918
918
  </div>
919
919
  </div>`;
920
920
  });
921
- return `<div id="${id}" class="${classes}" ${styleStr ? `style="${styleStr}"` : ""}>${html}</div>`;
921
+ return `<div id="${id}" class="${classes}" ${styleStr ? `style='${styleStr}'` : ""}>${html}</div>`;
922
922
  }
923
923
  function createStepper(props) {
924
924
  const {
@@ -947,7 +947,7 @@ function createStepper(props) {
947
947
  html += '<div class="stx-step-connector"></div>';
948
948
  }
949
949
  });
950
- return `<div id="${id}" class="${classes}" ${styleStr ? `style="${styleStr}"` : ""}>${html}</div>`;
950
+ return `<div id="${id}" class="${classes}" ${styleStr ? `style='${styleStr}'` : ""}>${html}</div>`;
951
951
  }
952
952
  function createModalComponent(props) {
953
953
  const {
@@ -964,7 +964,7 @@ function createModalComponent(props) {
964
964
  const classes = buildClasses("stx-modal-component", `stx-modal-component--${size}`, className);
965
965
  const styleStr = buildStyles(style);
966
966
  if (!open) {
967
- return `<div id="${id}" class="${classes} stx-modal-component--hidden" ${styleStr ? `style="${styleStr}"` : ""}></div>`;
967
+ return `<div id="${id}" class="${classes} stx-modal-component--hidden" ${styleStr ? `style='${styleStr}'` : ""}></div>`;
968
968
  }
969
969
  let html = '<div class="stx-modal-component-overlay">';
970
970
  html += '<div class="stx-modal-component-dialog">';
@@ -983,7 +983,7 @@ function createModalComponent(props) {
983
983
  html += `<div class="stx-modal-component-footer">${footer}</div>`;
984
984
  }
985
985
  html += "</div></div>";
986
- return `<div id="${id}" class="${classes}" ${styleStr ? `style="${styleStr}"` : ""}>${html}</div>`;
986
+ return `<div id="${id}" class="${classes}" ${styleStr ? `style='${styleStr}'` : ""}>${html}</div>`;
987
987
  }
988
988
  function createListView(props) {
989
989
  const {
@@ -1008,7 +1008,7 @@ function createListView(props) {
1008
1008
  html += `<li class="${itemClasses}" data-id="${escapeHtml2(item.id)}" ${selectable ? 'tabindex="0"' : ""}>${item.content}</li>`;
1009
1009
  }
1010
1010
  html += "</ul>";
1011
- return `<div id="${id}" class="${classes}" ${styleStr ? `style="${styleStr}"` : ""}>${html}</div>`;
1011
+ return `<div id="${id}" class="${classes}" ${styleStr ? `style='${styleStr}'` : ""}>${html}</div>`;
1012
1012
  }
1013
1013
  function createTable(props) {
1014
1014
  const {
@@ -1045,7 +1045,7 @@ function createTable(props) {
1045
1045
  html += "</tr>";
1046
1046
  }
1047
1047
  html += "</tbody></table>";
1048
- return `<div id="${id}" class="${classes}" ${styleStr ? `style="${styleStr}"` : ""}>${html}</div>`;
1048
+ return `<div id="${id}" class="${classes}" ${styleStr ? `style='${styleStr}'` : ""}>${html}</div>`;
1049
1049
  }
1050
1050
  function renderTreeNode(node, expandedKeys, selectedKeys, checkable) {
1051
1051
  const isExpanded = expandedKeys.includes(node.key);
@@ -1093,7 +1093,7 @@ function createTreeView(props) {
1093
1093
  for (const node of nodes) {
1094
1094
  html += renderTreeNode(node, expandedKeys, selectedKeys, checkable);
1095
1095
  }
1096
- return `<div id="${id}" class="${classes}" role="tree" ${styleStr ? `style="${styleStr}"` : ""}>${html}</div>`;
1096
+ return `<div id="${id}" class="${classes}" role="tree" ${styleStr ? `style='${styleStr}'` : ""}>${html}</div>`;
1097
1097
  }
1098
1098
  function createDataGrid(props) {
1099
1099
  const {
@@ -1147,7 +1147,7 @@ function createDataGrid(props) {
1147
1147
  </div>
1148
1148
  </div>`;
1149
1149
  }
1150
- return `<div id="${id}" class="${classes}" ${styleStr ? `style="${styleStr}"` : ""}>${html}</div>`;
1150
+ return `<div id="${id}" class="${classes}" ${styleStr ? `style='${styleStr}'` : ""}>${html}</div>`;
1151
1151
  }
1152
1152
  function createChart(props) {
1153
1153
  const {
@@ -1239,7 +1239,7 @@ function createMediaPlayer(props) {
1239
1239
  type === "video" && poster && `poster="${escapeHtml2(poster)}"`
1240
1240
  ].filter(Boolean).join(" ");
1241
1241
  const mediaElement = type === "video" ? `<video ${mediaAttrs}>Your browser does not support the video tag.</video>` : `<audio ${mediaAttrs}>Your browser does not support the audio tag.</audio>`;
1242
- return `<div id="${id}" class="${classes}" ${combinedStyle ? `style="${combinedStyle}"` : ""}>${mediaElement}</div>`;
1242
+ return `<div id="${id}" class="${classes}" ${combinedStyle ? `style='${combinedStyle}'` : ""}>${mediaElement}</div>`;
1243
1243
  }
1244
1244
  function formatFileSize(bytes) {
1245
1245
  if (bytes === undefined)
@@ -1291,7 +1291,7 @@ function createFileExplorer(props) {
1291
1291
  }
1292
1292
  html += "</div>";
1293
1293
  }
1294
- return `<div id="${id}" class="${classes}" ${styleStr ? `style="${styleStr}"` : ""}>${html}</div>`;
1294
+ return `<div id="${id}" class="${classes}" ${styleStr ? `style='${styleStr}'` : ""}>${html}</div>`;
1295
1295
  }
1296
1296
  function createWebView(props) {
1297
1297
  const {
@@ -2631,9 +2631,9 @@ window.stxDialog = {
2631
2631
  `;
2632
2632
  }
2633
2633
  // src/window.ts
2634
+ import process3 from "process";
2634
2635
  import { existsSync } from "fs";
2635
2636
  import { join } from "path";
2636
- import process3 from "process";
2637
2637
  var currentConfig = {};
2638
2638
  function setDesktopConfig(config) {
2639
2639
  currentConfig = { ...currentConfig, ...config };
@@ -2811,6 +2811,7 @@ async function openDevWindow(port, options = {}) {
2811
2811
  darkMode: options.darkMode ?? true,
2812
2812
  hotReload: options.hotReload ?? true,
2813
2813
  devTools: true,
2814
+ titlebarHidden: options.titlebarHidden ?? false,
2814
2815
  nativeSidebar: options.nativeSidebar ?? false,
2815
2816
  sidebarWidth: options.sidebarWidth ?? 260,
2816
2817
  sidebarConfig
@@ -2841,6 +2842,8 @@ async function openDevWindow(port, options = {}) {
2841
2842
  args.push("--dark");
2842
2843
  if (options.hotReload ?? true)
2843
2844
  args.push("--hot-reload");
2845
+ if (options.titlebarHidden)
2846
+ args.push("--titlebar-hidden");
2844
2847
  const child = spawn(craftPath, args, { stdio: "inherit" });
2845
2848
  child.on("exit", () => process3.exit(0));
2846
2849
  child.on("error", (err) => console.warn("craft child error:", err.message));
@@ -3138,9 +3141,9 @@ function formatDuration(minutes) {
3138
3141
  return `${h}h ${m}m`;
3139
3142
  }
3140
3143
  // src/preferences.ts
3141
- import { existsSync as existsSync2, mkdirSync, readFileSync, writeFileSync, watch } from "fs";
3142
- import { dirname, join as join2 } from "path";
3144
+ import { existsSync as existsSync2, mkdirSync, readFileSync, watch, writeFileSync } from "fs";
3143
3145
  import { homedir, platform } from "os";
3146
+ import { dirname, join as join2 } from "path";
3144
3147
  function getDefaultPrefsDir(appName) {
3145
3148
  const os = platform();
3146
3149
  const home = homedir();
@@ -3316,8 +3319,8 @@ function createPreferences(options) {
3316
3319
  }
3317
3320
  // src/autolaunch.ts
3318
3321
  import { existsSync as existsSync3, mkdirSync as mkdirSync2, readFileSync as readFileSync2, unlinkSync, writeFileSync as writeFileSync2 } from "fs";
3319
- import { join as join3 } from "path";
3320
3322
  import { homedir as homedir2, platform as platform2 } from "os";
3323
+ import { join as join3 } from "path";
3321
3324
  function getLaunchAgentPath(appName) {
3322
3325
  const identifier = appName.toLowerCase().replace(/[^a-z0-9]/g, "-");
3323
3326
  return join3(homedir2(), "Library", "LaunchAgents", `com.${identifier}.plist`);
@@ -6373,4 +6376,4 @@ export {
6373
6376
  AVAILABLE_COMPONENTS
6374
6377
  };
6375
6378
 
6376
- //# debugId=AF3E9F0356E8BBF464756E2164756E21
6379
+ //# debugId=A359E7408923DF3E64756E2164756E21