@legendapp/spark 0.0.1-next.3 → 0.0.1-next.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 (161) hide show
  1. package/README.md +1 -1
  2. package/camera.ts +13 -0
  3. package/customize.ts +2 -0
  4. package/html.ts +1 -0
  5. package/markdown.ts +1 -0
  6. package/package.json +34 -15
  7. package/patches/camera/react-native-nitro-image.patch +320 -0
  8. package/patches/camera/react-native-nitro-modules.patch +50 -0
  9. package/patches/camera/react-native-vision-camera.patch +2662 -0
  10. package/patches/camera/upstream.json +22 -0
  11. package/patches/dependencies.json +14 -0
  12. package/patches/react-native-enriched-html@1.1.1.patch +854 -0
  13. package/patches/react-native-enriched-markdown@1.1.1.patch +9261 -0
  14. package/postinstall.cjs +1 -0
  15. package/schema.json +104 -0
  16. package/skills/spark/SKILL.md +56 -0
  17. package/skills/spark/UPGRADING.md +246 -0
  18. package/ui-swipe.ts +1 -0
  19. package/vendor/node_modules/@legendapp/spark-ai/package.json +4 -4
  20. package/vendor/node_modules/@legendapp/spark-ai/src/invocation-command.cjs +11 -0
  21. package/vendor/node_modules/@legendapp/spark-ai/src/invocation-command.d.cts +2 -0
  22. package/vendor/node_modules/@legendapp/spark-ai/src/invocations.ts +2 -19
  23. package/vendor/node_modules/@legendapp/spark-audio/package.json +3 -3
  24. package/vendor/node_modules/@legendapp/spark-auth-session/package.json +3 -3
  25. package/vendor/node_modules/@legendapp/spark-cli/dist/add-desktop.js +4 -4
  26. package/vendor/node_modules/@legendapp/spark-cli/dist/build.js +65 -11
  27. package/vendor/node_modules/@legendapp/spark-cli/dist/cli-arguments.js +2 -1
  28. package/vendor/node_modules/@legendapp/spark-cli/dist/commands.js +3 -2
  29. package/vendor/node_modules/@legendapp/spark-cli/dist/create.js +36 -13
  30. package/vendor/node_modules/@legendapp/spark-cli/dist/credentials.js +41 -26
  31. package/vendor/node_modules/@legendapp/spark-cli/dist/customize-ai.cjs +108 -0
  32. package/vendor/node_modules/@legendapp/spark-cli/dist/customize-artifacts.js +315 -0
  33. package/vendor/node_modules/@legendapp/spark-cli/dist/customize-cli.cjs +75 -0
  34. package/vendor/node_modules/@legendapp/spark-cli/dist/customize-github.cjs +133 -0
  35. package/vendor/node_modules/@legendapp/spark-cli/dist/customize-policy.cjs +102 -0
  36. package/vendor/node_modules/@legendapp/spark-cli/dist/customize-provider.cjs +2 -0
  37. package/vendor/node_modules/@legendapp/spark-cli/dist/customize-worker.cjs +273 -0
  38. package/vendor/node_modules/@legendapp/spark-cli/dist/dependency-pins.js +157 -0
  39. package/vendor/node_modules/@legendapp/spark-cli/dist/dev-command.js +3 -1
  40. package/vendor/node_modules/@legendapp/spark-cli/dist/dev.js +1 -1
  41. package/vendor/node_modules/@legendapp/spark-cli/dist/enriched-html-pins.js +128 -0
  42. package/vendor/node_modules/@legendapp/spark-cli/dist/errors.js +100 -0
  43. package/vendor/node_modules/@legendapp/spark-cli/dist/examples.js +1 -1
  44. package/vendor/node_modules/@legendapp/spark-cli/dist/expo-dev-patch.cjs +30 -1
  45. package/vendor/node_modules/@legendapp/spark-cli/dist/expo-native.cjs +5 -1
  46. package/vendor/node_modules/@legendapp/spark-cli/dist/helpers.js +1 -1
  47. package/vendor/node_modules/@legendapp/spark-cli/dist/index.js +52 -7
  48. package/vendor/node_modules/@legendapp/spark-cli/dist/init-template.d.cts +1 -0
  49. package/vendor/node_modules/@legendapp/spark-cli/dist/js-runtime.cjs +96 -0
  50. package/vendor/node_modules/@legendapp/spark-cli/dist/json.js +16 -0
  51. package/vendor/node_modules/@legendapp/spark-cli/dist/migration-helpers.cjs +152 -0
  52. package/vendor/node_modules/@legendapp/spark-cli/dist/migration-helpers.d.cts +15 -0
  53. package/vendor/node_modules/@legendapp/spark-cli/dist/migrations.cjs +184 -0
  54. package/vendor/node_modules/@legendapp/spark-cli/dist/migrations.d.cts +16 -0
  55. package/vendor/node_modules/@legendapp/spark-cli/dist/native-patch-preflight.js +5 -1
  56. package/vendor/node_modules/@legendapp/spark-cli/dist/package-manager-config.js +41 -0
  57. package/vendor/node_modules/@legendapp/spark-cli/dist/package-manager.js +13 -0
  58. package/vendor/node_modules/@legendapp/spark-cli/dist/process.js +7 -0
  59. package/vendor/node_modules/@legendapp/spark-cli/dist/project-version.js +12 -0
  60. package/vendor/node_modules/@legendapp/spark-cli/dist/project.js +66 -30
  61. package/vendor/node_modules/@legendapp/spark-cli/dist/release.js +2 -1
  62. package/vendor/node_modules/@legendapp/spark-cli/dist/release.json +20 -20
  63. package/vendor/node_modules/@legendapp/spark-cli/dist/runtime-bootstrap.ps1 +87 -0
  64. package/vendor/node_modules/@legendapp/spark-cli/dist/runtime-bootstrap.sh +107 -0
  65. package/vendor/node_modules/@legendapp/spark-cli/dist/runtime-downloads.tsv +13 -0
  66. package/vendor/node_modules/@legendapp/spark-cli/dist/sdk-install.js +8 -3
  67. package/vendor/node_modules/@legendapp/spark-cli/dist/universal.cjs +2 -1
  68. package/vendor/node_modules/@legendapp/spark-cli/dist/upgrade.js +102 -0
  69. package/vendor/node_modules/@legendapp/spark-cli/dist/windows.js +1 -8
  70. package/vendor/node_modules/@legendapp/spark-cli/package.json +6 -4
  71. package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/.claude/skills/spark/SKILL.md +9 -0
  72. package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/AGENTS.md +4 -0
  73. package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/CLAUDE.md +4 -0
  74. package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/README.md +15 -0
  75. package/vendor/node_modules/@legendapp/spark-cli/templates/blank-typescript/package.json +47 -3
  76. package/vendor/node_modules/@legendapp/spark-cli/templates/universal/.claude/skills/spark/SKILL.md +9 -0
  77. package/vendor/node_modules/@legendapp/spark-cli/templates/universal/AGENTS.md +4 -0
  78. package/vendor/node_modules/@legendapp/spark-cli/templates/universal/CLAUDE.md +4 -0
  79. package/vendor/node_modules/@legendapp/spark-cli/templates/universal/README.md +15 -0
  80. package/vendor/node_modules/@legendapp/spark-cli/templates/universal/package.json +46 -3
  81. package/vendor/node_modules/@legendapp/spark-cli/templates/windows/.claude/skills/spark/SKILL.md +9 -0
  82. package/vendor/node_modules/@legendapp/spark-cli/templates/windows/AGENTS.md +4 -0
  83. package/vendor/node_modules/@legendapp/spark-cli/templates/windows/CLAUDE.md +4 -0
  84. package/vendor/node_modules/@legendapp/spark-cli/templates/windows/README.md +15 -0
  85. package/vendor/node_modules/@legendapp/spark-cli/templates/windows/package.json +47 -3
  86. package/vendor/node_modules/@legendapp/spark-clipboard/package.json +3 -3
  87. package/vendor/node_modules/@legendapp/spark-codex/package.json +4 -4
  88. package/vendor/node_modules/@legendapp/spark-commands/package.json +6 -6
  89. package/vendor/node_modules/@legendapp/spark-context-menu/package.json +3 -3
  90. package/vendor/node_modules/@legendapp/spark-desktop-app/macos/RNDesktopApp.mm +14 -1
  91. package/vendor/node_modules/@legendapp/spark-desktop-app/package.json +2 -2
  92. package/vendor/node_modules/@legendapp/spark-desktop-app/src/contracts/menu.ts +6 -4
  93. package/vendor/node_modules/@legendapp/spark-desktop-app/src/customize-hooks.ts +17 -0
  94. package/vendor/node_modules/@legendapp/spark-desktop-app/src/customize.ts +117 -0
  95. package/vendor/node_modules/@legendapp/spark-desktop-config/app.plugin.cjs +20 -1
  96. package/vendor/node_modules/@legendapp/spark-desktop-config/config.cjs +5 -2
  97. package/vendor/node_modules/@legendapp/spark-desktop-config/config.d.cts +14 -0
  98. package/vendor/node_modules/@legendapp/spark-desktop-config/customize-provider.cjs +16 -0
  99. package/vendor/node_modules/@legendapp/spark-desktop-config/customize.cjs +16 -0
  100. package/vendor/node_modules/@legendapp/spark-desktop-config/expo.cjs +1 -0
  101. package/vendor/node_modules/@legendapp/spark-desktop-config/native-patches.cjs +106 -0
  102. package/vendor/node_modules/@legendapp/spark-desktop-config/native-patches.d.cts +1 -0
  103. package/vendor/node_modules/@legendapp/spark-desktop-config/package.json +5 -4
  104. package/vendor/node_modules/@legendapp/spark-desktop-config/schema.json +104 -0
  105. package/vendor/node_modules/@legendapp/spark-desktop-host/SparkCustomize.mm +517 -0
  106. package/vendor/node_modules/@legendapp/spark-desktop-host/package.json +4 -3
  107. package/vendor/node_modules/@legendapp/spark-desktop-links/package.json +3 -3
  108. package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/macos/RNDesktopShortcuts.mm +3 -1
  109. package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/macos/keyboard-manager/RNKeyboardManager.h +3 -0
  110. package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/macos/keyboard-manager/RNKeyboardManager.mm +1 -1
  111. package/vendor/node_modules/@legendapp/spark-desktop-shortcuts/package.json +3 -3
  112. package/vendor/node_modules/@legendapp/spark-desktop-windows/macos/window-manager/RNWindowManager.mm +44 -4
  113. package/vendor/node_modules/@legendapp/spark-desktop-windows/package.json +4 -4
  114. package/vendor/node_modules/@legendapp/spark-desktop-windows/src/api.ts +65 -26
  115. package/vendor/node_modules/@legendapp/spark-desktop-windows/src/macos-adapter.ts +8 -6
  116. package/vendor/node_modules/@legendapp/spark-documents/package.json +8 -8
  117. package/vendor/node_modules/@legendapp/spark-drag-drop/package.json +3 -3
  118. package/vendor/node_modules/@legendapp/spark-file-dialog/package.json +3 -3
  119. package/vendor/node_modules/@legendapp/spark-file-system/macos/SparkFileMutations.h +1 -0
  120. package/vendor/node_modules/@legendapp/spark-file-system/macos/SparkFileMutations.mm +11 -10
  121. package/vendor/node_modules/@legendapp/spark-file-system/package.json +3 -3
  122. package/vendor/node_modules/@legendapp/spark-global-shortcuts/package.json +3 -3
  123. package/vendor/node_modules/@legendapp/spark-html/package.json +24 -0
  124. package/vendor/node_modules/@legendapp/spark-html/src/Html.tsx +22 -0
  125. package/vendor/node_modules/@legendapp/spark-html/src/HtmlInput.tsx +102 -0
  126. package/vendor/node_modules/@legendapp/spark-html/src/index.ts +4 -0
  127. package/vendor/node_modules/@legendapp/spark-html/src/types.ts +4 -0
  128. package/vendor/node_modules/@legendapp/spark-markdown/package.json +24 -0
  129. package/vendor/node_modules/@legendapp/spark-markdown/src/Markdown.tsx +24 -0
  130. package/vendor/node_modules/@legendapp/spark-markdown/src/MarkdownInput.tsx +111 -0
  131. package/vendor/node_modules/@legendapp/spark-markdown/src/index.ts +4 -0
  132. package/vendor/node_modules/@legendapp/spark-message-dialog/package.json +3 -3
  133. package/vendor/node_modules/@legendapp/spark-native-menu/package.json +3 -3
  134. package/vendor/node_modules/@legendapp/spark-notifications/package.json +3 -3
  135. package/vendor/node_modules/@legendapp/spark-notifications/windows/SparkNotifications/SparkNotifications.h +16 -11
  136. package/vendor/node_modules/@legendapp/spark-processes/package.json +3 -3
  137. package/vendor/node_modules/@legendapp/spark-rich-text/package.json +18 -0
  138. package/vendor/node_modules/@legendapp/spark-rich-text/src/components.tsx +52 -0
  139. package/vendor/node_modules/@legendapp/spark-rich-text/src/index.ts +4 -0
  140. package/vendor/node_modules/@legendapp/spark-rich-text/src/types.ts +24 -0
  141. package/vendor/node_modules/@legendapp/spark-rich-text/src/useInputShortcuts.macos.ts +55 -0
  142. package/vendor/node_modules/@legendapp/spark-rich-text/src/useInputShortcuts.ts +13 -0
  143. package/vendor/node_modules/@legendapp/spark-rich-text/src/useInputValue.ts +14 -0
  144. package/vendor/node_modules/@legendapp/spark-rich-text/src/value.ts +16 -0
  145. package/vendor/node_modules/@legendapp/spark-secure-storage/package.json +3 -3
  146. package/vendor/node_modules/@legendapp/spark-settings/package.json +3 -3
  147. package/vendor/node_modules/@legendapp/spark-settings-ui/package.json +5 -5
  148. package/vendor/node_modules/@legendapp/spark-sqlite/package.json +3 -3
  149. package/vendor/node_modules/@legendapp/spark-system/package.json +3 -3
  150. package/vendor/node_modules/@legendapp/spark-tray/package.json +3 -3
  151. package/vendor/node_modules/@legendapp/spark-ui/macos/appkit-split-view/RNSidebarSplitViewComponent.mm +360 -35
  152. package/vendor/node_modules/@legendapp/spark-ui/macos/swipe-actions/RNSwipeActions.h +10 -0
  153. package/vendor/node_modules/@legendapp/spark-ui/macos/swipe-actions/RNSwipeActions.mm +422 -0
  154. package/vendor/node_modules/@legendapp/spark-ui/package.json +4 -3
  155. package/vendor/node_modules/@legendapp/spark-ui/src/appkit-split-view/SidebarSplitViewNativeComponent.ts +11 -0
  156. package/vendor/node_modules/@legendapp/spark-ui/src/appkit-split-view/index.tsx +30 -13
  157. package/vendor/node_modules/@legendapp/spark-ui/src/swipe-actions/SwipeActionsNativeComponent.ts +11 -0
  158. package/vendor/node_modules/@legendapp/spark-ui/src/swipe-actions/index.tsx +41 -0
  159. package/vendor/node_modules/@legendapp/spark-updates/package.json +3 -3
  160. package/vendor/node_modules/@legendapp/spark-webview/package.json +2 -2
  161. package/vendor/node_modules/@legendapp/spark-window-options/package.json +1 -1
@@ -0,0 +1,4 @@
1
+ export { Html } from "./Html";
2
+ export type { HtmlProps } from "./Html";
3
+ export { HtmlInput, EditableHtml } from "./HtmlInput";
4
+ export type { HtmlInputProps, HtmlInputRef } from "./types";
@@ -0,0 +1,4 @@
1
+ import type { RichTextInputProps, RichTextInputRef } from "@legendapp/spark-rich-text";
2
+
3
+ export interface HtmlInputProps extends RichTextInputProps {}
4
+ export type HtmlInputRef = RichTextInputRef;
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "@legendapp/spark-markdown",
3
+ "version": "0.0.1-next.5",
4
+ "private": true,
5
+ "license": "MIT",
6
+ "main": "src/index.ts",
7
+ "react-native": "src/index.ts",
8
+ "files": [
9
+ "src"
10
+ ],
11
+ "peerDependencies": {
12
+ "react": "^19.1.0",
13
+ "react-native": "0.81.6",
14
+ "react-native-enriched-markdown": "1.1.1"
15
+ },
16
+ "dependencies": {
17
+ "@legendapp/spark-rich-text": "0.0.1-next.5"
18
+ },
19
+ "peerDependenciesMeta": {
20
+ "react-native-enriched-markdown": {
21
+ "optional": true
22
+ }
23
+ }
24
+ }
@@ -0,0 +1,24 @@
1
+ import { StyleSheet, type StyleProp, type TextStyle, type ViewProps } from "react-native";
2
+ import { EnrichedMarkdownText, type MarkdownStyle } from "react-native-enriched-markdown";
3
+
4
+ export interface MarkdownProps extends Omit<ViewProps, "children" | "style"> {
5
+ value?: string;
6
+ children?: string;
7
+ style?: StyleProp<TextStyle>;
8
+ markdownStyle?: MarkdownStyle;
9
+ selectable?: boolean;
10
+ onLinkPress?(event: { url: string }): void;
11
+ }
12
+
13
+ export function Markdown({ value, children, style, selectable = true, ...props }: MarkdownProps) {
14
+ return (
15
+ <EnrichedMarkdownText
16
+ {...props}
17
+ markdown={value ?? children ?? ""}
18
+ containerStyle={StyleSheet.flatten(style)}
19
+ selectable={selectable}
20
+ allowTrailingMargin={false}
21
+ enableTaskListItemToggle={false}
22
+ />
23
+ );
24
+ }
@@ -0,0 +1,111 @@
1
+ import { useImperativeHandle, useRef, useState } from "react";
2
+ import { StyleSheet, Text, View } from "react-native";
3
+ import {
4
+ EnrichedMarkdownTextInput,
5
+ type EnrichedMarkdownTextInputInstance,
6
+ type MarkdownStyle,
7
+ } from "react-native-enriched-markdown";
8
+ import {
9
+ FormattingButtons,
10
+ InputPreview,
11
+ useInputValue,
12
+ useInputShortcuts,
13
+ type FormattingAction,
14
+ type RichTextInputProps,
15
+ type RichTextInputRef,
16
+ } from "@legendapp/spark-rich-text";
17
+
18
+ import { Markdown } from "./Markdown";
19
+
20
+ export interface MarkdownInputProps extends RichTextInputProps {
21
+ markdownStyle?: MarkdownStyle;
22
+ }
23
+ export type MarkdownInputRef = RichTextInputRef;
24
+
25
+ export function MarkdownInput(props: MarkdownInputProps) {
26
+ return <MarkdownEditor {...props} />;
27
+ }
28
+
29
+ export function EditableMarkdown(props: MarkdownInputProps) {
30
+ return <MarkdownEditor {...props} preview />;
31
+ }
32
+
33
+ function MarkdownEditor({
34
+ value,
35
+ onChangeText,
36
+ placeholder,
37
+ autoFocus,
38
+ onFocus,
39
+ onBlur,
40
+ style,
41
+ markdownStyle,
42
+ ref,
43
+ formatting,
44
+ onRequestLink,
45
+ accessibilityLabel,
46
+ testID,
47
+ preview = false,
48
+ }: MarkdownInputProps & { preview?: boolean }) {
49
+ const input = useRef<EnrichedMarkdownTextInputInstance | null>(null);
50
+ const [editing, setEditing] = useState(false);
51
+ const format = (action: FormattingAction) => {
52
+ const url = action === "link" ? onRequestLink?.() : undefined;
53
+ input.current?.focus();
54
+ if (action === "link") {
55
+ if (url) input.current?.setLink(url);
56
+ } else if (action === "bold") input.current?.toggleBold();
57
+ else if (action === "italic") input.current?.toggleItalic();
58
+ else if (action === "unorderedList") input.current?.toggleUnorderedList();
59
+ else input.current?.toggleOrderedList();
60
+ };
61
+ useInputShortcuts(input, editing, formatting ? { onFormat: format, linkEnabled: !!onRequestLink } : undefined);
62
+ const change = useInputValue(value, (next) => input.current?.setValue(next), onChangeText);
63
+ useImperativeHandle(ref, () => ({ focus: () => input.current?.focus(), blur: () => input.current?.blur() }), []);
64
+ const inputStyle = StyleSheet.flatten([{ minHeight: 44, padding: 0, fontSize: 16 }, style]);
65
+ return (
66
+ <View>
67
+ {formatting && <FormattingButtons linkEnabled={!!onRequestLink} onFormat={format} />}
68
+ <View>
69
+ {/* Slides' NotesText keeps this native view alive so a click never needs a source-offset estimate. */}
70
+ <EnrichedMarkdownTextInput
71
+ ref={input}
72
+ defaultValue={value}
73
+ multiline
74
+ scrollEnabled={false}
75
+ autoFocus={autoFocus}
76
+ placeholder={placeholder}
77
+ markdownStyle={markdownStyle}
78
+ style={inputStyle}
79
+ accessibilityLabel={accessibilityLabel}
80
+ testID={testID}
81
+ onChangeMarkdown={change}
82
+ onFocus={() => {
83
+ setEditing(true);
84
+ onFocus?.();
85
+ }}
86
+ onBlur={() => {
87
+ setEditing(false);
88
+ onBlur?.();
89
+ }}
90
+ onKeyPress={(event) => {
91
+ if (event.nativeEvent.key === "Escape") input.current?.blur();
92
+ }}
93
+ />
94
+ {preview && (
95
+ <InputPreview editing={editing} style={style}>
96
+ {value ? (
97
+ <Markdown
98
+ value={value}
99
+ markdownStyle={markdownStyle}
100
+ style={inputStyle}
101
+ selectable={false}
102
+ />
103
+ ) : (
104
+ <Text style={[inputStyle, { color: "#888" }]}>{placeholder}</Text>
105
+ )}
106
+ </InputPreview>
107
+ )}
108
+ </View>
109
+ </View>
110
+ );
111
+ }
@@ -0,0 +1,4 @@
1
+ export { Markdown } from "./Markdown";
2
+ export type { MarkdownProps } from "./Markdown";
3
+ export { MarkdownInput, EditableMarkdown } from "./MarkdownInput";
4
+ export type { MarkdownInputProps, MarkdownInputRef } from "./MarkdownInput";
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/spark-message-dialog",
3
- "version": "0.0.1-next.3",
3
+ "version": "0.0.1-next.5",
4
4
  "license": "MIT",
5
5
  "main": "src/index.ts",
6
6
  "react-native": "src/index.ts",
@@ -12,7 +12,7 @@
12
12
  "react-native.config.js"
13
13
  ],
14
14
  "peerDependencies": {
15
- "react": "19.1.4",
15
+ "react": "^19.1.0",
16
16
  "react-native": "0.81.6"
17
17
  },
18
18
  "codegenConfig": {
@@ -40,7 +40,7 @@
40
40
  ]
41
41
  },
42
42
  "dependencies": {
43
- "@legendapp/spark-desktop-app": "0.0.1-next.3"
43
+ "@legendapp/spark-desktop-app": "0.0.1-next.5"
44
44
  },
45
45
  "private": true
46
46
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/spark-native-menu",
3
- "version": "0.0.1-next.3",
3
+ "version": "0.0.1-next.5",
4
4
  "main": "src/index",
5
5
  "react-native": "src/index",
6
6
  "codegenConfig": {
@@ -18,7 +18,7 @@
18
18
  }
19
19
  },
20
20
  "peerDependencies": {
21
- "react": "19.1.4",
21
+ "react": "^19.1.0",
22
22
  "react-native": "0.81.6"
23
23
  },
24
24
  "license": "MIT",
@@ -41,6 +41,6 @@
41
41
  },
42
42
  "private": true,
43
43
  "dependencies": {
44
- "@legendapp/spark-desktop-app": "0.0.1-next.3"
44
+ "@legendapp/spark-desktop-app": "0.0.1-next.5"
45
45
  }
46
46
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/spark-notifications",
3
- "version": "0.0.1-next.3",
3
+ "version": "0.0.1-next.5",
4
4
  "license": "MIT",
5
5
  "main": "src/index.ts",
6
6
  "react-native": "src/index.ts",
@@ -12,7 +12,7 @@
12
12
  "react-native.config.js"
13
13
  ],
14
14
  "peerDependencies": {
15
- "react": "19.1.4",
15
+ "react": "^19.1.0",
16
16
  "react-native": "0.81.6"
17
17
  },
18
18
  "codegenConfig": {
@@ -40,7 +40,7 @@
40
40
  ]
41
41
  },
42
42
  "dependencies": {
43
- "@legendapp/spark-desktop-app": "0.0.1-next.3"
43
+ "@legendapp/spark-desktop-app": "0.0.1-next.5"
44
44
  },
45
45
  "private": true
46
46
  }
@@ -108,22 +108,27 @@ struct NotificationsState : std::enable_shared_from_this<NotificationsState> {
108
108
  auto audio = xml.CreateElement(L"audio");
109
109
  auto tone = std::wstring(L"ms-winsoundevent:Notification.");
110
110
  if (sound == L"mail") tone += L"Mail"; else if (sound == L"message") tone += L"IM"; else if (sound == L"reminder") tone += L"Reminder";
111
- else if (sound == L"call") { tone += L"Looping.Call"; audio.SetAttribute(L"duration", L"long"); }
111
+ else if (sound == L"call") { tone += L"Looping.Call"; audio.SetAttribute(L"loop", L"true"); xml.DocumentElement().SetAttribute(L"duration", L"long"); }
112
112
  else tone += L"Default";
113
113
  audio.SetAttribute(L"src", tone.c_str()); xml.DocumentElement().AppendChild(audio);
114
114
  }
115
115
  // Action buttons activate through the same CustomActivator as the toast body,
116
116
  // carrying their own action id in the activation arguments.
117
- for (auto const &entry : args.GetNamedArray(L"actions", Json::JsonArray())) {
118
- auto action = entry.GetObject();
119
- auto button = xml.CreateElement(L"action");
120
- // JsonObject is a reference type; parse a copy so each action carries its
121
- // own action id without mutating the body/dismiss payload.
122
- auto arguments = Json::JsonObject::Parse(response.Stringify());
123
- arguments.SetNamedValue(L"action", Json::JsonValue::CreateStringValue(action.GetNamedString(L"id")));
124
- button.SetAttribute(L"content", action.GetNamedString(L"label").c_str());
125
- button.SetAttribute(L"arguments", arguments.Stringify().c_str());
126
- xml.DocumentElement().AppendChild(button);
117
+ auto entries = args.GetNamedArray(L"actions", Json::JsonArray());
118
+ if (entries.Size() > 0) {
119
+ auto actions = xml.CreateElement(L"actions");
120
+ xml.DocumentElement().AppendChild(actions);
121
+ for (auto const &entry : entries) {
122
+ auto action = entry.GetObject();
123
+ auto button = xml.CreateElement(L"action");
124
+ // JsonObject is a reference type; parse a copy so each action carries its
125
+ // own action id without mutating the body/dismiss payload.
126
+ auto arguments = Json::JsonObject::Parse(response.Stringify());
127
+ arguments.SetNamedValue(L"action", Json::JsonValue::CreateStringValue(action.GetNamedString(L"id")));
128
+ button.SetAttribute(L"content", action.GetNamedString(L"label").c_str());
129
+ button.SetAttribute(L"arguments", arguments.Stringify().c_str());
130
+ actions.AppendChild(button);
131
+ }
127
132
  }
128
133
  auto tag = Hash(id); RemovePending(tag); Forget(tag);
129
134
  if (delay > 0) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/spark-processes",
3
- "version": "0.0.1-next.3",
3
+ "version": "0.0.1-next.5",
4
4
  "license": "MIT",
5
5
  "main": "src/index.ts",
6
6
  "react-native": "src/index.ts",
@@ -12,7 +12,7 @@
12
12
  "react-native.config.js"
13
13
  ],
14
14
  "peerDependencies": {
15
- "react": "19.1.4",
15
+ "react": "^19.1.0",
16
16
  "react-native": "0.81.6"
17
17
  },
18
18
  "codegenConfig": {
@@ -41,7 +41,7 @@
41
41
  ]
42
42
  },
43
43
  "dependencies": {
44
- "@legendapp/spark-desktop-app": "0.0.1-next.3"
44
+ "@legendapp/spark-desktop-app": "0.0.1-next.5"
45
45
  },
46
46
  "private": true
47
47
  }
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "@legendapp/spark-rich-text",
3
+ "version": "0.0.1-next.5",
4
+ "private": true,
5
+ "license": "MIT",
6
+ "main": "src/index.ts",
7
+ "react-native": "src/index.ts",
8
+ "files": [
9
+ "src"
10
+ ],
11
+ "peerDependencies": {
12
+ "react": "^19.1.0",
13
+ "react-native": "0.81.6"
14
+ },
15
+ "dependencies": {
16
+ "@legendapp/spark-desktop-shortcuts": "0.0.1-next.5"
17
+ }
18
+ }
@@ -0,0 +1,52 @@
1
+ import type { ReactNode } from "react";
2
+ import { Pressable, StyleSheet, Text, View, type StyleProp, type TextStyle } from "react-native";
3
+
4
+ export function InputPreview({
5
+ editing,
6
+ style,
7
+ children,
8
+ }: {
9
+ editing: boolean;
10
+ style?: StyleProp<TextStyle>;
11
+ children: ReactNode;
12
+ }) {
13
+ const backgroundColor = StyleSheet.flatten(style)?.backgroundColor ?? "white";
14
+ return (
15
+ !editing && (
16
+ <View
17
+ pointerEvents="none"
18
+ accessibilityElementsHidden
19
+ importantForAccessibility="no-hide-descendants"
20
+ style={[StyleSheet.absoluteFill, { backgroundColor }]}
21
+ >
22
+ {children}
23
+ </View>
24
+ )
25
+ );
26
+ }
27
+
28
+ export function FormattingButtons({
29
+ onFormat,
30
+ linkEnabled,
31
+ }: {
32
+ onFormat(action: "bold" | "italic" | "link" | "unorderedList" | "orderedList"): void;
33
+ linkEnabled: boolean;
34
+ }) {
35
+ return (
36
+ <View style={{ flexDirection: "row", gap: 12, paddingVertical: 6 }}>
37
+ {(["bold", "italic", "link", "unorderedList", "orderedList"] as const).map((action) => (
38
+ <Pressable
39
+ key={action}
40
+ accessibilityRole="button"
41
+ accessibilityLabel={action}
42
+ disabled={action === "link" && !linkEnabled}
43
+ onPress={() => onFormat(action)}
44
+ >
45
+ <Text style={{ color: action === "link" && !linkEnabled ? "#888" : "#2463eb" }}>
46
+ {{ bold: "Bold", italic: "Italic", link: "Link", unorderedList: "Bullets", orderedList: "Numbers" }[action]}
47
+ </Text>
48
+ </Pressable>
49
+ ))}
50
+ </View>
51
+ );
52
+ }
@@ -0,0 +1,4 @@
1
+ export type { RichTextInputProps, RichTextInputRef, FormattingAction } from "./types";
2
+ export { InputPreview, FormattingButtons } from "./components";
3
+ export { useInputValue } from "./useInputValue";
4
+ export { useInputShortcuts } from "./useInputShortcuts";
@@ -0,0 +1,24 @@
1
+ import type { Ref } from "react";
2
+ import type { StyleProp, TextStyle } from "react-native";
3
+
4
+ export interface RichTextInputRef {
5
+ focus(): void;
6
+ blur(): void;
7
+ }
8
+
9
+ export interface RichTextInputProps {
10
+ value: string;
11
+ onChangeText(value: string): void;
12
+ placeholder?: string;
13
+ autoFocus?: boolean;
14
+ onFocus?(): void;
15
+ onBlur?(): void;
16
+ style?: StyleProp<TextStyle>;
17
+ ref?: Ref<RichTextInputRef>;
18
+ formatting?: boolean;
19
+ onRequestLink?(): string | undefined;
20
+ accessibilityLabel?: string;
21
+ testID?: string;
22
+ }
23
+
24
+ export type FormattingAction = "bold" | "italic" | "link" | "unorderedList" | "orderedList";
@@ -0,0 +1,55 @@
1
+ import { useEffect, useLayoutEffect, useRef, type RefObject } from "react";
2
+ import { registerShortcut, type AsyncRegistration } from "@legendapp/spark-desktop-shortcuts";
3
+ import type { RichTextInputRef, FormattingAction } from "./types";
4
+ import type { InputFormattingShortcuts } from "./useInputShortcuts";
5
+
6
+ // Native removal is asynchronous; a newly focused editor must await the old owner.
7
+ let pendingCleanup: Promise<void> = Promise.resolve();
8
+
9
+ export function useInputShortcuts(
10
+ input: RefObject<RichTextInputRef | null>,
11
+ focused: boolean,
12
+ formatting?: InputFormattingShortcuts,
13
+ ) {
14
+ const onFormat = useRef(formatting?.onFormat);
15
+ useLayoutEffect(() => {
16
+ onFormat.current = formatting?.onFormat;
17
+ }, [formatting?.onFormat]);
18
+ const enabled = !!formatting,
19
+ linkEnabled = !!formatting?.linkEnabled;
20
+ useEffect(() => {
21
+ if (!focused) return;
22
+ let active = true;
23
+ const shortcuts = new Set<AsyncRegistration>();
24
+ const bindings: Array<[string, () => void]> = [["Escape", () => input.current?.blur()]];
25
+ if (enabled) {
26
+ const actions: Array<[string, FormattingAction]> = [
27
+ ["Cmd+B", "bold"],
28
+ ["Cmd+I", "italic"],
29
+ ["Cmd+Shift+7", "orderedList"],
30
+ ["Cmd+Shift+8", "unorderedList"],
31
+ ];
32
+ if (linkEnabled) actions.push(["Cmd+K", "link"]);
33
+ for (const [key, action] of actions) bindings.push([key, () => onFormat.current?.(action)]);
34
+ }
35
+ const setup = pendingCleanup.then(async () => {
36
+ if (!active) return;
37
+ await Promise.all(bindings.map(async ([key, handler]) => {
38
+ try {
39
+ const registration = await registerShortcut(key, () => {
40
+ if (active) handler();
41
+ });
42
+ shortcuts.add(registration);
43
+ } catch (error) {
44
+ console.error(error);
45
+ }
46
+ }));
47
+ });
48
+ return () => {
49
+ active = false;
50
+ pendingCleanup = setup.then(async () => {
51
+ await Promise.all([...shortcuts].map((shortcut) => shortcut.remove().catch(console.error)));
52
+ });
53
+ };
54
+ }, [input, focused, enabled, linkEnabled]);
55
+ }
@@ -0,0 +1,13 @@
1
+ import type { RefObject } from "react";
2
+ import type { RichTextInputRef, FormattingAction } from "./types";
3
+
4
+ export interface InputFormattingShortcuts {
5
+ onFormat(action: FormattingAction): void;
6
+ linkEnabled: boolean;
7
+ }
8
+
9
+ export function useInputShortcuts(
10
+ _input: RefObject<RichTextInputRef | null>,
11
+ _focused: boolean,
12
+ _formatting?: InputFormattingShortcuts,
13
+ ) {}
@@ -0,0 +1,14 @@
1
+ import { useLayoutEffect, useReducer, useRef } from "react";
2
+ import { createInputValue } from "./value";
3
+
4
+ export function useInputValue(value: string, setValue: (value: string) => void, onChangeText: (value: string) => void) {
5
+ const state = useRef<ReturnType<typeof createInputValue> | null>(null);
6
+ if (!state.current) state.current = createInputValue(value);
7
+ const [, render] = useReducer((version: number) => version + 1, 0);
8
+ useLayoutEffect(() => state.current!.synchronize(value, setValue));
9
+ return (next: string) => {
10
+ state.current!.change(next);
11
+ onChangeText(next);
12
+ render();
13
+ };
14
+ }
@@ -0,0 +1,16 @@
1
+ // Adapted from Slides' NotesText: native value echoes must preserve selection and undo.
2
+ export function createInputValue(value: string) {
3
+ let nativeValue = value;
4
+ return {
5
+ change(next: string) {
6
+ nativeValue = next;
7
+ return next;
8
+ },
9
+ synchronize(next: string, setValue: (value: string) => void) {
10
+ if (nativeValue !== next) {
11
+ nativeValue = next;
12
+ setValue(next);
13
+ }
14
+ },
15
+ };
16
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/spark-secure-storage",
3
- "version": "0.0.1-next.3",
3
+ "version": "0.0.1-next.5",
4
4
  "license": "MIT",
5
5
  "main": "src/index",
6
6
  "react-native": "src/index",
@@ -12,7 +12,7 @@
12
12
  "windows"
13
13
  ],
14
14
  "peerDependencies": {
15
- "react": "19.1.4",
15
+ "react": "^19.1.0",
16
16
  "react-native": "0.81.6",
17
17
  "expo-secure-store": "~15.0.8"
18
18
  },
@@ -41,7 +41,7 @@
41
41
  ]
42
42
  },
43
43
  "dependencies": {
44
- "@legendapp/spark-desktop-app": "0.0.1-next.3"
44
+ "@legendapp/spark-desktop-app": "0.0.1-next.5"
45
45
  },
46
46
  "peerDependenciesMeta": {
47
47
  "expo-secure-store": {
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@legendapp/spark-settings",
3
- "version": "0.0.1-next.3",
3
+ "version": "0.0.1-next.5",
4
4
  "license": "MIT",
5
5
  "main": "src/index.ts",
6
6
  "files": [
7
7
  "src"
8
8
  ],
9
9
  "dependencies": {
10
- "@legendapp/spark-file-system": "0.0.1-next.3",
10
+ "@legendapp/spark-file-system": "0.0.1-next.5",
11
11
  "@legendapp/state": "^3.0.0-beta.42",
12
- "@legendapp/spark-desktop-app": "0.0.1-next.3"
12
+ "@legendapp/spark-desktop-app": "0.0.1-next.5"
13
13
  },
14
14
  "private": true,
15
15
  "spark": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/spark-settings-ui",
3
- "version": "0.0.1-next.3",
3
+ "version": "0.0.1-next.5",
4
4
  "private": true,
5
5
  "license": "MIT",
6
6
  "main": "src/index.tsx",
@@ -8,12 +8,12 @@
8
8
  "src"
9
9
  ],
10
10
  "dependencies": {
11
- "@legendapp/spark-ui": "0.0.1-next.3",
12
- "@legendapp/spark-desktop-windows": "0.0.1-next.3",
13
- "@legendapp/spark-desktop-app": "0.0.1-next.3"
11
+ "@legendapp/spark-ui": "0.0.1-next.5",
12
+ "@legendapp/spark-desktop-windows": "0.0.1-next.5",
13
+ "@legendapp/spark-desktop-app": "0.0.1-next.5"
14
14
  },
15
15
  "peerDependencies": {
16
- "react": "19.1.4",
16
+ "react": "^19.1.0",
17
17
  "react-native": "0.81.6",
18
18
  "@legendapp/list": ">=3.3.0"
19
19
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/spark-sqlite",
3
- "version": "0.0.1-next.3",
3
+ "version": "0.0.1-next.5",
4
4
  "license": "MIT",
5
5
  "main": "src/index.ts",
6
6
  "react-native": "src/index.ts",
@@ -9,8 +9,8 @@
9
9
  ],
10
10
  "dependencies": {
11
11
  "@op-engineering/op-sqlite": "18.2.1",
12
- "@legendapp/spark-desktop-app": "0.0.1-next.3",
13
- "@legendapp/spark-file-system": "0.0.1-next.3"
12
+ "@legendapp/spark-desktop-app": "0.0.1-next.5",
13
+ "@legendapp/spark-file-system": "0.0.1-next.5"
14
14
  },
15
15
  "private": true
16
16
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@legendapp/spark-system",
3
- "version": "0.0.1-next.3",
3
+ "version": "0.0.1-next.5",
4
4
  "license": "MIT",
5
5
  "main": "src/index.ts",
6
6
  "react-native": "src/index.ts",
@@ -12,7 +12,7 @@
12
12
  "react-native.config.js"
13
13
  ],
14
14
  "peerDependencies": {
15
- "react": "19.1.4",
15
+ "react": "^19.1.0",
16
16
  "react-native": "0.81.6"
17
17
  },
18
18
  "codegenConfig": {
@@ -40,7 +40,7 @@
40
40
  ]
41
41
  },
42
42
  "dependencies": {
43
- "@legendapp/spark-desktop-app": "0.0.1-next.3"
43
+ "@legendapp/spark-desktop-app": "0.0.1-next.5"
44
44
  },
45
45
  "private": true
46
46
  }