@legendapp/spark 0.0.4 → 0.0.6

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 (79) hide show
  1. package/package.json +4 -4
  2. package/skills/spark/UPGRADING.md +105 -0
  3. package/skills/spark/storage-settings.md +2 -28
  4. package/skills/spark/ui.md +27 -1
  5. package/vendor/node_modules/@legendapp/spark-ai/package.json +3 -3
  6. package/vendor/node_modules/@legendapp/spark-audio/package.json +2 -2
  7. package/vendor/node_modules/@legendapp/spark-auth-session/package.json +3 -3
  8. package/vendor/node_modules/@legendapp/spark-cli/dist/build.js +47 -25
  9. package/vendor/node_modules/@legendapp/spark-cli/dist/expo-desktop-template-bare-minimum-55.83.10.tgz +0 -0
  10. package/vendor/node_modules/@legendapp/spark-cli/dist/migrations.cjs +6 -0
  11. package/vendor/node_modules/@legendapp/spark-cli/dist/package.js +4 -8
  12. package/vendor/node_modules/@legendapp/spark-cli/dist/project.js +5 -3
  13. package/vendor/node_modules/@legendapp/spark-cli/dist/publish-directory.js +40 -0
  14. package/vendor/node_modules/@legendapp/spark-cli/dist/release-app.js +139 -0
  15. package/vendor/node_modules/@legendapp/spark-cli/dist/release.json +21 -21
  16. package/vendor/node_modules/@legendapp/spark-cli/dist/signing.js +61 -41
  17. package/vendor/node_modules/@legendapp/spark-cli/package.json +4 -4
  18. package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/package.json +2 -2
  19. package/vendor/node_modules/@legendapp/spark-cli/templates/universal/package.json +2 -2
  20. package/vendor/node_modules/@legendapp/spark-cli/templates/windows/package.json +2 -2
  21. package/vendor/node_modules/@legendapp/spark-clipboard/package.json +2 -2
  22. package/vendor/node_modules/@legendapp/spark-codex/package.json +2 -2
  23. package/vendor/node_modules/@legendapp/spark-commands/package.json +5 -5
  24. package/vendor/node_modules/@legendapp/spark-context-menu/package.json +2 -2
  25. package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkTestDriver.h +2 -0
  26. package/vendor/node_modules/@legendapp/spark-desktop-app/macos/SparkTestDriver.mm +1 -0
  27. package/vendor/node_modules/@legendapp/spark-desktop-app/package.json +1 -1
  28. package/vendor/node_modules/@legendapp/spark-desktop-config/app.plugin.cjs +1 -0
  29. package/vendor/node_modules/@legendapp/spark-desktop-config/native-patches.cjs +15 -1
  30. package/vendor/node_modules/@legendapp/spark-desktop-config/native-patches.d.cts +1 -0
  31. package/vendor/node_modules/@legendapp/spark-desktop-config/package.json +3 -3
  32. package/vendor/node_modules/@legendapp/spark-desktop-config/rpaths.cjs +20 -0
  33. package/vendor/node_modules/@legendapp/spark-desktop-config/rpaths.d.cts +1 -0
  34. package/vendor/node_modules/@legendapp/spark-desktop-host/AppDelegate.mm +16 -5
  35. package/vendor/node_modules/@legendapp/spark-desktop-host/package.json +2 -2
  36. package/vendor/node_modules/@legendapp/spark-desktop-links/package.json +2 -2
  37. package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/package.json +2 -2
  38. package/vendor/node_modules/@legendapp/spark-desktop-windows/package.json +3 -3
  39. package/vendor/node_modules/@legendapp/spark-documents/package.json +7 -7
  40. package/vendor/node_modules/@legendapp/spark-drag-drop/package.json +2 -2
  41. package/vendor/node_modules/@legendapp/spark-expo-compat/package.json +4 -4
  42. package/vendor/node_modules/@legendapp/spark-file-dialog/package.json +2 -2
  43. package/vendor/node_modules/@legendapp/spark-file-system/package.json +2 -2
  44. package/vendor/node_modules/@legendapp/spark-global-shortcuts/package.json +2 -2
  45. package/vendor/node_modules/@legendapp/spark-html/package.json +2 -2
  46. package/vendor/node_modules/@legendapp/spark-markdown/package.json +2 -2
  47. package/vendor/node_modules/@legendapp/spark-message-dialog/package.json +2 -2
  48. package/vendor/node_modules/@legendapp/spark-native-menu/package.json +2 -2
  49. package/vendor/node_modules/@legendapp/spark-notifications/package.json +2 -2
  50. package/vendor/node_modules/@legendapp/spark-processes/package.json +2 -2
  51. package/vendor/node_modules/@legendapp/spark-rich-text/package.json +2 -2
  52. package/vendor/node_modules/@legendapp/spark-secure-storage/package.json +2 -2
  53. package/vendor/node_modules/@legendapp/spark-settings/package.json +3 -3
  54. package/vendor/node_modules/@legendapp/spark-settings-ui/package.json +5 -5
  55. package/vendor/node_modules/@legendapp/spark-settings-ui/src/heading.tsx +14 -0
  56. package/vendor/node_modules/@legendapp/spark-settings-ui/src/index.tsx +132 -332
  57. package/vendor/node_modules/@legendapp/spark-settings-ui/src/rows.tsx +185 -0
  58. package/vendor/node_modules/@legendapp/spark-sqlite/package.json +3 -3
  59. package/vendor/node_modules/@legendapp/spark-system/package.json +2 -2
  60. package/vendor/node_modules/@legendapp/spark-tray/package.json +2 -2
  61. package/vendor/node_modules/@legendapp/spark-ui/macos/native-select/RNNativeSegmentedControl.mm +29 -0
  62. package/vendor/node_modules/@legendapp/spark-ui/macos/native-select/RNNativeSelect.mm +17 -1
  63. package/vendor/node_modules/@legendapp/spark-ui/macos/sidebar/RNSidebar.mm +20 -0
  64. package/vendor/node_modules/@legendapp/spark-ui/package.json +2 -2
  65. package/vendor/node_modules/@legendapp/spark-ui/src/availability.ts +2 -1
  66. package/vendor/node_modules/@legendapp/spark-ui/src/control.ts +1 -1
  67. package/vendor/node_modules/@legendapp/spark-ui/src/desktop.tsx +15 -12
  68. package/vendor/node_modules/@legendapp/spark-ui/src/index.android.tsx +7 -6
  69. package/vendor/node_modules/@legendapp/spark-ui/src/index.ios.tsx +10 -9
  70. package/vendor/node_modules/@legendapp/spark-ui/src/index.web.tsx +6 -4
  71. package/vendor/node_modules/@legendapp/spark-ui/src/native-select/NativeSegmentedControlNativeComponent.ts +2 -1
  72. package/vendor/node_modules/@legendapp/spark-ui/src/native-select/NativeSelectNativeComponent.ts +1 -0
  73. package/vendor/node_modules/@legendapp/spark-ui/src/select.ts +4 -0
  74. package/vendor/node_modules/@legendapp/spark-ui/src/switch.tsx +13 -0
  75. package/vendor/node_modules/@legendapp/spark-ui/src/types.ts +16 -4
  76. package/vendor/node_modules/@legendapp/spark-updates/package.json +2 -2
  77. package/vendor/node_modules/@legendapp/spark-webview/package.json +2 -2
  78. package/vendor/node_modules/@legendapp/spark-window-options/package.json +1 -1
  79. /package/{settings-window.ts → ui-settings.ts} +0 -0
@@ -7,6 +7,7 @@ export type NativeSelectChangeEvent = {
7
7
  };
8
8
 
9
9
  export interface NativeProps extends ViewProps {
10
+ borderless?: boolean;
10
11
  enabled?: boolean;
11
12
  selectionRevision?: Int32;
12
13
  itemsJson: string;
@@ -7,3 +7,7 @@ export function selectionIndex(options: SelectProps["options"], value: string):
7
7
  if (index < 0) throw new SparkError("E_INVALID_ARGUMENT", "Select value must match an option");
8
8
  return index;
9
9
  }
10
+
11
+ export function validateSelectVariant(variant: SelectProps["variant"]) {
12
+ if (variant !== undefined && variant !== "default" && variant !== "borderless") throw new SparkError("E_INVALID_ARGUMENT", "Invalid Select variant");
13
+ }
@@ -0,0 +1,13 @@
1
+ import { Platform, Switch as NativeSwitch, View } from "react-native";
2
+ import { SparkError } from "@legendapp/spark-desktop-app/src/contracts";
3
+ import { unsupportedPlatform, useControl } from "./control";
4
+ import type { SwitchProps } from "./types";
5
+
6
+ export function Switch(props: SwitchProps) {
7
+ const { value, onValueChange, accessibilityLabel, accessibilityHint, style, testID } = props;
8
+ if (typeof value !== "boolean" || typeof onValueChange !== "function") throw new SparkError("E_INVALID_ARGUMENT", "Switch requires a boolean value and onValueChange");
9
+ const control = useControl(props, ["macos", "windows", "ios", "android", "web"].includes(Platform.OS) ? undefined : unsupportedPlatform);
10
+ if (control.failed) return <View ref={control.ref} style={style} testID={testID} accessible accessibilityRole="switch" accessibilityLabel={accessibilityLabel} accessibilityHint={accessibilityHint} accessibilityState={{ checked: value, disabled: true }} />;
11
+ return <NativeSwitch ref={control.ref} value={value} onValueChange={next => { if (control.active()) onValueChange(next); }}
12
+ disabled={control.disabled} accessibilityLabel={accessibilityLabel} accessibilityHint={accessibilityHint} accessibilityState={{ checked: value }} style={style} testID={testID} />;
13
+ }
@@ -26,6 +26,12 @@ export interface ButtonProps extends ControlProps {
26
26
  /** AppKit control size; `regular` (default) everywhere, `small` and `mini` on macOS and web. */
27
27
  size?: "regular" | "small" | "mini";
28
28
  }
29
+ /** A controlled on/off switch. */
30
+ export interface SwitchProps extends ControlProps {
31
+ value: boolean;
32
+ onValueChange: (value: boolean) => void;
33
+ accessibilityHint?: string;
34
+ }
29
35
  /** A controlled native checkbox. `children` is its label; without one, set `accessibilityLabel`. */
30
36
  export interface CheckboxProps extends ControlProps {
31
37
  value: boolean;
@@ -51,22 +57,28 @@ export interface UncontrolledTextInputProps extends TextInputCommonProps {
51
57
  }
52
58
  export type TextInputProps = ControlledTextInputProps | UncontrolledTextInputProps;
53
59
  export interface SelectOption { label: string; value: string }
54
- export interface SelectProps extends ControlProps {
60
+ interface ChoiceControlProps extends ControlProps {
55
61
  options: readonly SelectOption[];
56
62
  value: string;
57
63
  onValueChange: (value: string) => void;
58
64
  }
59
- export interface SegmentedControlProps extends SelectProps {
65
+ export interface SelectProps extends ChoiceControlProps {
66
+ accessibilityHint?: string;
67
+ /** Borderless popup on macOS and web. Other platforms report `E_UNSUPPORTED_PLATFORM`. */
68
+ variant?: "default" | "borderless";
69
+ }
70
+ export interface SegmentedControlProps extends ChoiceControlProps {
71
+ accessibilityHint?: string;
60
72
  /** `small` is the compact control size. Defaults to `regular`. */
61
73
  size?: "regular" | "small";
62
74
  /** `fit` sizes segments to their labels; `fill` shares the control's width equally. Defaults to `fit`. */
63
75
  distribution?: "fit" | "fill";
64
76
  }
65
77
  /** A controlled group of native radio buttons: one per option, with `value` selected. */
66
- export interface RadioGroupProps extends SelectProps {
78
+ export interface RadioGroupProps extends ChoiceControlProps {
67
79
  /** `vertical` (default) stacks the buttons; `horizontal` puts them on one line. */
68
80
  orientation?: "vertical" | "horizontal";
69
81
  /** AppKit control size: `regular` (default), `small` or `mini`. */
70
82
  size?: "regular" | "small" | "mini";
71
83
  }
72
- export type ControlKind = "button" | "text-input" | "select" | "segmented-control" | "checkbox" | "radio-group";
84
+ export type ControlKind = "button" | "text-input" | "select" | "segmented-control" | "checkbox" | "radio-group" | "switch";
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/spark-updates",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "license": "MIT",
5
5
  "main": "src/index.ts",
6
6
  "react-native": "src/index.ts",
@@ -32,7 +32,7 @@
32
32
  ]
33
33
  },
34
34
  "dependencies": {
35
- "@legendapp/spark-desktop-app": "0.0.4"
35
+ "@legendapp/spark-desktop-app": "0.0.6"
36
36
  },
37
37
  "private": true
38
38
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/spark-webview",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "license": "MIT",
5
5
  "main": "src/index.ts",
6
6
  "react-native": "src/index.ts",
@@ -8,7 +8,7 @@
8
8
  "src"
9
9
  ],
10
10
  "dependencies": {
11
- "@legendapp/spark-desktop-app": "0.0.4"
11
+ "@legendapp/spark-desktop-app": "0.0.6"
12
12
  },
13
13
  "private": true,
14
14
  "peerDependencies": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/spark-window-options",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "license": "MIT",
5
5
  "main": "index.cjs",
6
6
  "types": "index.d.ts",
File without changes