noteloom 0.5.0 → 0.6.0

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 (69) hide show
  1. package/README.md +1 -1
  2. package/dist/canvas.cjs +1 -1
  3. package/dist/canvas.js +1 -1
  4. package/dist/collab.cjs +1 -1
  5. package/dist/collab.cjs.map +1 -1
  6. package/dist/collab.js +157 -102
  7. package/dist/collab.js.map +1 -1
  8. package/dist/comments.cjs +1 -1
  9. package/dist/comments.js +3 -3
  10. package/dist/index.cjs +1 -1
  11. package/dist/index.cjs.map +1 -1
  12. package/dist/index.d.ts +27 -0
  13. package/dist/index.js +1600 -1542
  14. package/dist/index.js.map +1 -1
  15. package/dist/shared/{CommentThreadCard-YziIa8My.cjs → CommentThreadCard-DcCHq2Dy.cjs} +2 -2
  16. package/dist/shared/{CommentThreadCard-YziIa8My.cjs.map → CommentThreadCard-DcCHq2Dy.cjs.map} +1 -1
  17. package/dist/shared/{CommentThreadCard-CwKd6fp3.js → CommentThreadCard-DwtE85Xx.js} +2 -2
  18. package/dist/shared/{CommentThreadCard-CwKd6fp3.js.map → CommentThreadCard-DwtE85Xx.js.map} +1 -1
  19. package/dist/shared/{CommentsPanel-DezejDdE.cjs → CommentsPanel-BRgACUu_.cjs} +2 -2
  20. package/dist/shared/{CommentsPanel-DezejDdE.cjs.map → CommentsPanel-BRgACUu_.cjs.map} +1 -1
  21. package/dist/shared/{CommentsPanel-dx7IaoqS.js → CommentsPanel-D4eP-K_f.js} +3 -3
  22. package/dist/shared/{CommentsPanel-dx7IaoqS.js.map → CommentsPanel-D4eP-K_f.js.map} +1 -1
  23. package/dist/shared/VersionHistory-BRBYQgj5.cjs +12 -0
  24. package/dist/shared/VersionHistory-BRBYQgj5.cjs.map +1 -0
  25. package/dist/shared/{VersionHistory-DhYb8C2e.js → VersionHistory-D9sIIAYN.js} +221 -206
  26. package/dist/shared/VersionHistory-D9sIIAYN.js.map +1 -0
  27. package/dist/shared/VoiceListeningIndicator-DgLMmGSP.js +342 -0
  28. package/dist/shared/VoiceListeningIndicator-DgLMmGSP.js.map +1 -0
  29. package/dist/shared/VoiceListeningIndicator-Dw0fggpE.cjs +2 -0
  30. package/dist/shared/VoiceListeningIndicator-Dw0fggpE.cjs.map +1 -0
  31. package/dist/shared/{icons-D5Ctow8R.js → icons-Bdptdx1e.js} +299 -279
  32. package/dist/shared/{icons-D5Ctow8R.js.map → icons-Bdptdx1e.js.map} +1 -1
  33. package/dist/shared/{icons-BCseh2pt.cjs → icons-DabR_JDW.cjs} +3 -3
  34. package/dist/shared/{icons-BCseh2pt.cjs.map → icons-DabR_JDW.cjs.map} +1 -1
  35. package/dist/shared/{index-CbIBsFmI.cjs → index-B7_F6NA9.cjs} +2 -2
  36. package/dist/shared/{index-CbIBsFmI.cjs.map → index-B7_F6NA9.cjs.map} +1 -1
  37. package/dist/shared/{index-D_8hJpI7.js → index-DOIEccLM.js} +52 -52
  38. package/dist/shared/{index-D_8hJpI7.js.map → index-DOIEccLM.js.map} +1 -1
  39. package/dist/shared/{leafBlockFactory-DSa1XCox.js → leafBlockFactory-ChlzpKIn.js} +2 -2
  40. package/dist/shared/{leafBlockFactory-DSa1XCox.js.map → leafBlockFactory-ChlzpKIn.js.map} +1 -1
  41. package/dist/shared/{leafBlockFactory-CaLWUcfa.cjs → leafBlockFactory-D3SCDvzc.cjs} +2 -2
  42. package/dist/shared/{leafBlockFactory-CaLWUcfa.cjs.map → leafBlockFactory-D3SCDvzc.cjs.map} +1 -1
  43. package/dist/shared/{serialize-BqKU9EZy.js → serialize-C1rjLsIz.js} +2 -2
  44. package/dist/shared/{serialize-BqKU9EZy.js.map → serialize-C1rjLsIz.js.map} +1 -1
  45. package/dist/shared/{serialize-CqwX55uK.cjs → serialize-k0zXqwEM.cjs} +2 -2
  46. package/dist/shared/{serialize-CqwX55uK.cjs.map → serialize-k0zXqwEM.cjs.map} +1 -1
  47. package/dist/shared/{starter-kit-mfeNxqFn.js → starter-kit-CJzWMyF8.js} +683 -673
  48. package/dist/shared/{starter-kit-mfeNxqFn.js.map → starter-kit-CJzWMyF8.js.map} +1 -1
  49. package/dist/shared/starter-kit-Ch2LEpzF.cjs +27 -0
  50. package/dist/shared/{starter-kit-DyX1U84W.cjs.map → starter-kit-Ch2LEpzF.cjs.map} +1 -1
  51. package/dist/shared/{usePopoverEdgeClamp-D_hB5t60.js → usePopoverEdgeClamp-B9KNv9SE.js} +2 -2
  52. package/dist/shared/{usePopoverEdgeClamp-D_hB5t60.js.map → usePopoverEdgeClamp-B9KNv9SE.js.map} +1 -1
  53. package/dist/shared/{usePopoverEdgeClamp-CPRWQtZV.cjs → usePopoverEdgeClamp-gRlLQeVG.cjs} +2 -2
  54. package/dist/shared/{usePopoverEdgeClamp-CPRWQtZV.cjs.map → usePopoverEdgeClamp-gRlLQeVG.cjs.map} +1 -1
  55. package/dist/starter-kit.cjs +1 -1
  56. package/dist/starter-kit.js +2 -2
  57. package/dist/versions.cjs +1 -1
  58. package/dist/versions.js +1 -1
  59. package/dist/voice.cjs +1 -1
  60. package/dist/voice.js +1 -1
  61. package/package.json +2 -2
  62. package/dist/shared/VersionHistory-DhYb8C2e.js.map +0 -1
  63. package/dist/shared/VersionHistory-DuSxis_7.cjs +0 -12
  64. package/dist/shared/VersionHistory-DuSxis_7.cjs.map +0 -1
  65. package/dist/shared/VoiceListeningIndicator-BXByLZwO.cjs +0 -2
  66. package/dist/shared/VoiceListeningIndicator-BXByLZwO.cjs.map +0 -1
  67. package/dist/shared/VoiceListeningIndicator-bv285FSY.js +0 -338
  68. package/dist/shared/VoiceListeningIndicator-bv285FSY.js.map +0 -1
  69. package/dist/shared/starter-kit-DyX1U84W.cjs +0 -27
package/dist/index.d.ts CHANGED
@@ -322,6 +322,10 @@ export class CollabSession {
322
322
  setLocalPresence(data: Record<string, unknown>): void;
323
323
  getPresence(): Map<string, Record<string, unknown>>;
324
324
  onPresenceChange(callback: (presence: Map<string, Record<string, unknown>>) => void): () => void;
325
+ sendCustom(channel: string, payload: unknown, remotePeerId?: string | null): void;
326
+ onCustomMessage(
327
+ callback: (channel: string, payload: unknown, remotePeerId: string) => void,
328
+ ): () => void;
325
329
  }
326
330
 
327
331
  export function createWebSocketSignaling(options: {
@@ -782,6 +786,10 @@ export interface EditorProviderProps {
782
786
  ) => Promise<{ src: string; name?: string; mimeType?: string }>;
783
787
  /** Byte cap for the in-document data: URL fallback ONLY (no effect once uploadFile is configured) -- an oversized file is rejected with a clear error instead of bloating the document. */
784
788
  maxFileSize?: number;
789
+ /** Turns block.props.src into whatever's actually loadable on this device right now, before EmbedBlock hands it to an img/video/audio -- see useFileUpload's own doc comment. May be a real React hook (called unconditionally on every EmbedBlock render) if it needs to be reactive. Identity when not configured. */
790
+ resolveEmbedSrc?: (src: string) => string;
791
+ /** Called once if the resolved src actually fails to load (the element's native error event) -- see useFileUpload's own doc comment. Never called for oembed/file kinds. */
792
+ onEmbedError?: (src: string) => void;
785
793
  children?: ReactNode;
786
794
  }
787
795
 
@@ -804,6 +812,8 @@ export function useFileUpload(): {
804
812
  ctx: { kind: 'image' | 'video' | 'audio' | 'file' },
805
813
  ) => Promise<{ src: string; name?: string; mimeType?: string }>;
806
814
  maxFileSize?: number;
815
+ resolveEmbedSrc: (src: string) => string;
816
+ onEmbedError?: (src: string) => void;
807
817
  };
808
818
  export function useFieldTypeEditor(): {
809
819
  editingFieldTypeId: string | null;
@@ -873,6 +883,7 @@ export const BlockGutterRow: ComponentType<Record<string, unknown>>;
873
883
  export const BlockRangeActionMenu: ComponentType<Record<string, unknown>>;
874
884
  export function useBlockRangeDrag(containerRef: RefObject<HTMLElement | null>): void;
875
885
  export function useCoarsePointer(): boolean;
886
+ export function useTouchOnlyDevice(): boolean;
876
887
  export function useVirtualKeyboardInset(): number;
877
888
  export const MobileActionBar: ComponentType<{ containerRef: RefObject<HTMLElement | null> }>;
878
889
  export const MobileBlockPickerSheet: ComponentType<Record<string, unknown>>;
@@ -1008,6 +1019,8 @@ export interface FloatingToolbarProps {
1008
1019
  onComment?: (range: CommentRange) => void;
1009
1020
  /** Adds a Comment button using a built-in inline composer (addComment(store, range, {authorId: commentAuthorId, text})) instead of onComment -- see NoteloomEditorProps.commentAuthorId. */
1010
1021
  commentAuthorId?: string;
1022
+ /** Surfaces a mic start/stop button when given and voice.isSupported is true -- pass the object useVoiceTyping({ store: editor.store }) (from the separate `noteloom/voice` entry point) returns; the explicit `store` is required here since this call site sits outside the <EditorProvider> the toolbar itself renders inside of. Omit to keep SpeechRecognition-related code out of your bundle entirely. */
1023
+ voice?: Record<string, unknown>;
1011
1024
  }
1012
1025
 
1013
1026
  export const FloatingToolbar: ComponentType<FloatingToolbarProps>;
@@ -1151,6 +1164,12 @@ export interface NoteloomEditorProps {
1151
1164
  ) => Promise<{ src: string; name?: string; mimeType?: string }>;
1152
1165
  /** Byte cap for the in-document data: URL fallback ONLY (no effect once uploadFile is configured). */
1153
1166
  maxFileSize?: number;
1167
+ /** Turns block.props.src into whatever's actually loadable on this device right now -- see EditorProviderProps.resolveEmbedSrc / useFileUpload's own doc comment. */
1168
+ resolveEmbedSrc?: (src: string) => string;
1169
+ /** Called once if the resolved src actually fails to load -- see EditorProviderProps.onEmbedError. */
1170
+ onEmbedError?: (src: string) => void;
1171
+ /** Surfaces a mic start/stop button in the floating format toolbar -- pass the object useVoiceTyping({ store: editor.store }) (from the separate `noteloom/voice` entry point) returns; see FloatingToolbarProps.voice for why the explicit `store` is required here. Omit to keep SpeechRecognition-related code out of your bundle entirely. */
1172
+ voice?: Record<string, unknown>;
1154
1173
  children?: ReactNode;
1155
1174
  }
1156
1175
 
@@ -1236,6 +1255,14 @@ export function removePerson(store: EditorStore | History, id: string): void;
1236
1255
  /** Reactive view of the document's `people` collection. */
1237
1256
  export function usePeople(): Person[];
1238
1257
 
1258
+ // ---------------------------------------------------------------------------
1259
+ // title/title.js, react/useTitle.js — a document's own title
1260
+ // ---------------------------------------------------------------------------
1261
+
1262
+ export function setTitle(store: EditorStore | History, title: string): void;
1263
+ /** Reactive view of the document's own title (see EditorStore.getTitle). */
1264
+ export function useTitle(): string;
1265
+
1239
1266
  // ---------------------------------------------------------------------------
1240
1267
  // react/useSmartQuotes.js, react/useAutoPairBrackets.js — optional typing behaviors
1241
1268
  // ---------------------------------------------------------------------------