noteloom 0.5.0 → 0.7.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 (74) 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 +2 -1
  11. package/dist/index.cjs.map +1 -1
  12. package/dist/index.d.ts +33 -0
  13. package/dist/index.js +1691 -1592
  14. package/dist/index.js.map +1 -1
  15. package/dist/shared/{CommentThreadCard-YziIa8My.cjs → CommentThreadCard-CIB6nZEA.cjs} +2 -2
  16. package/dist/shared/{CommentThreadCard-YziIa8My.cjs.map → CommentThreadCard-CIB6nZEA.cjs.map} +1 -1
  17. package/dist/shared/{CommentThreadCard-CwKd6fp3.js → CommentThreadCard-lW_lbI74.js} +2 -2
  18. package/dist/shared/{CommentThreadCard-CwKd6fp3.js.map → CommentThreadCard-lW_lbI74.js.map} +1 -1
  19. package/dist/shared/{CommentsPanel-DezejDdE.cjs → CommentsPanel-CRxb3RWi.cjs} +2 -2
  20. package/dist/shared/{CommentsPanel-DezejDdE.cjs.map → CommentsPanel-CRxb3RWi.cjs.map} +1 -1
  21. package/dist/shared/{CommentsPanel-dx7IaoqS.js → CommentsPanel-Dg0k_XNU.js} +3 -3
  22. package/dist/shared/{CommentsPanel-dx7IaoqS.js.map → CommentsPanel-Dg0k_XNU.js.map} +1 -1
  23. package/dist/shared/VersionHistory-BsSwOq_k.cjs +12 -0
  24. package/dist/shared/VersionHistory-BsSwOq_k.cjs.map +1 -0
  25. package/dist/shared/{VersionHistory-DhYb8C2e.js → VersionHistory-BzMnJpbc.js} +221 -206
  26. package/dist/shared/VersionHistory-BzMnJpbc.js.map +1 -0
  27. package/dist/shared/VoiceListeningIndicator-B_7-6Mq4.cjs +2 -0
  28. package/dist/shared/VoiceListeningIndicator-B_7-6Mq4.cjs.map +1 -0
  29. package/dist/shared/VoiceListeningIndicator-DeA3hb33.js +342 -0
  30. package/dist/shared/VoiceListeningIndicator-DeA3hb33.js.map +1 -0
  31. package/dist/shared/{icons-D5Ctow8R.js → icons-CmfXmn13.js} +350 -282
  32. package/dist/shared/icons-CmfXmn13.js.map +1 -0
  33. package/dist/shared/{icons-BCseh2pt.cjs → icons-DQ7j_-ZK.cjs} +44 -3
  34. package/dist/shared/icons-DQ7j_-ZK.cjs.map +1 -0
  35. package/dist/shared/{index-D_8hJpI7.js → index-DUigqWQn.js} +52 -52
  36. package/dist/shared/{index-D_8hJpI7.js.map → index-DUigqWQn.js.map} +1 -1
  37. package/dist/shared/{index-CbIBsFmI.cjs → index-vWtS1iyt.cjs} +2 -2
  38. package/dist/shared/{index-CbIBsFmI.cjs.map → index-vWtS1iyt.cjs.map} +1 -1
  39. package/dist/shared/{leafBlockFactory-CaLWUcfa.cjs → leafBlockFactory-6GFBveaC.cjs} +2 -2
  40. package/dist/shared/{leafBlockFactory-CaLWUcfa.cjs.map → leafBlockFactory-6GFBveaC.cjs.map} +1 -1
  41. package/dist/shared/{leafBlockFactory-DSa1XCox.js → leafBlockFactory-Dm6cd2NY.js} +5 -5
  42. package/dist/shared/{leafBlockFactory-DSa1XCox.js.map → leafBlockFactory-Dm6cd2NY.js.map} +1 -1
  43. package/dist/shared/{serialize-BqKU9EZy.js → serialize-R4V4gmHs.js} +2 -2
  44. package/dist/shared/{serialize-BqKU9EZy.js.map → serialize-R4V4gmHs.js.map} +1 -1
  45. package/dist/shared/{serialize-CqwX55uK.cjs → serialize-vLXz0cze.cjs} +2 -2
  46. package/dist/shared/{serialize-CqwX55uK.cjs.map → serialize-vLXz0cze.cjs.map} +1 -1
  47. package/dist/shared/starter-kit-BQUaaql0.cjs +29 -0
  48. package/dist/shared/starter-kit-BQUaaql0.cjs.map +1 -0
  49. package/dist/shared/{starter-kit-mfeNxqFn.js → starter-kit-Bp30PiE4.js} +1545 -1477
  50. package/dist/shared/starter-kit-Bp30PiE4.js.map +1 -0
  51. package/dist/shared/{usePopoverEdgeClamp-CPRWQtZV.cjs → usePopoverEdgeClamp-BJLbbANB.cjs} +2 -2
  52. package/dist/shared/{usePopoverEdgeClamp-CPRWQtZV.cjs.map → usePopoverEdgeClamp-BJLbbANB.cjs.map} +1 -1
  53. package/dist/shared/{usePopoverEdgeClamp-D_hB5t60.js → usePopoverEdgeClamp-DSpz-6xR.js} +2 -2
  54. package/dist/shared/{usePopoverEdgeClamp-D_hB5t60.js.map → usePopoverEdgeClamp-DSpz-6xR.js.map} +1 -1
  55. package/dist/starter-kit.cjs +1 -1
  56. package/dist/starter-kit.js +2 -2
  57. package/dist/style.css +41 -0
  58. package/dist/versions.cjs +1 -1
  59. package/dist/versions.js +1 -1
  60. package/dist/voice.cjs +1 -1
  61. package/dist/voice.js +1 -1
  62. package/package.json +2 -2
  63. package/dist/shared/VersionHistory-DhYb8C2e.js.map +0 -1
  64. package/dist/shared/VersionHistory-DuSxis_7.cjs +0 -12
  65. package/dist/shared/VersionHistory-DuSxis_7.cjs.map +0 -1
  66. package/dist/shared/VoiceListeningIndicator-BXByLZwO.cjs +0 -2
  67. package/dist/shared/VoiceListeningIndicator-BXByLZwO.cjs.map +0 -1
  68. package/dist/shared/VoiceListeningIndicator-bv285FSY.js +0 -338
  69. package/dist/shared/VoiceListeningIndicator-bv285FSY.js.map +0 -1
  70. package/dist/shared/icons-BCseh2pt.cjs.map +0 -1
  71. package/dist/shared/icons-D5Ctow8R.js.map +0 -1
  72. package/dist/shared/starter-kit-DyX1U84W.cjs +0 -27
  73. package/dist/shared/starter-kit-DyX1U84W.cjs.map +0 -1
  74. package/dist/shared/starter-kit-mfeNxqFn.js.map +0 -1
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,12 @@ 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;
793
+ /** Syntax-colors CodeBlock's text -- returns trusted HTML, rendered via dangerouslySetInnerHTML in a read-only overlay behind the real editable text. No highlighter ships with this package (zero-runtime-dependency); wire in Prism/Shiki/highlight.js/etc. here. Plain monochrome text when not configured. See useHighlightCode's own doc comment. */
794
+ highlightCode?: (code: string, language: string) => string;
785
795
  children?: ReactNode;
786
796
  }
787
797
 
@@ -797,6 +807,8 @@ export function usePreviewMode(): [boolean, (value: boolean) => void];
797
807
  export function useCommentAuthorId(): string | undefined;
798
808
  /** Whether CodeBlock should render its line-number gutter -- see EditorProviderProps.showLineNumbers. */
799
809
  export function useShowLineNumbers(): boolean;
810
+ /** `highlightCode` from EditorProvider, or undefined if not configured -- see EditorProviderProps.highlightCode. */
811
+ export function useHighlightCode(): ((code: string, language: string) => string) | undefined;
800
812
  /** `{ uploadFile, maxFileSize }` from EditorProvider -- see EditorProviderProps and useFileUpload's own doc comment for the full contract. */
801
813
  export function useFileUpload(): {
802
814
  uploadFile?: (
@@ -804,6 +816,8 @@ export function useFileUpload(): {
804
816
  ctx: { kind: 'image' | 'video' | 'audio' | 'file' },
805
817
  ) => Promise<{ src: string; name?: string; mimeType?: string }>;
806
818
  maxFileSize?: number;
819
+ resolveEmbedSrc: (src: string) => string;
820
+ onEmbedError?: (src: string) => void;
807
821
  };
808
822
  export function useFieldTypeEditor(): {
809
823
  editingFieldTypeId: string | null;
@@ -873,6 +887,7 @@ export const BlockGutterRow: ComponentType<Record<string, unknown>>;
873
887
  export const BlockRangeActionMenu: ComponentType<Record<string, unknown>>;
874
888
  export function useBlockRangeDrag(containerRef: RefObject<HTMLElement | null>): void;
875
889
  export function useCoarsePointer(): boolean;
890
+ export function useTouchOnlyDevice(): boolean;
876
891
  export function useVirtualKeyboardInset(): number;
877
892
  export const MobileActionBar: ComponentType<{ containerRef: RefObject<HTMLElement | null> }>;
878
893
  export const MobileBlockPickerSheet: ComponentType<Record<string, unknown>>;
@@ -1008,6 +1023,8 @@ export interface FloatingToolbarProps {
1008
1023
  onComment?: (range: CommentRange) => void;
1009
1024
  /** Adds a Comment button using a built-in inline composer (addComment(store, range, {authorId: commentAuthorId, text})) instead of onComment -- see NoteloomEditorProps.commentAuthorId. */
1010
1025
  commentAuthorId?: string;
1026
+ /** 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. */
1027
+ voice?: Record<string, unknown>;
1011
1028
  }
1012
1029
 
1013
1030
  export const FloatingToolbar: ComponentType<FloatingToolbarProps>;
@@ -1151,6 +1168,14 @@ export interface NoteloomEditorProps {
1151
1168
  ) => Promise<{ src: string; name?: string; mimeType?: string }>;
1152
1169
  /** Byte cap for the in-document data: URL fallback ONLY (no effect once uploadFile is configured). */
1153
1170
  maxFileSize?: number;
1171
+ /** Turns block.props.src into whatever's actually loadable on this device right now -- see EditorProviderProps.resolveEmbedSrc / useFileUpload's own doc comment. */
1172
+ resolveEmbedSrc?: (src: string) => string;
1173
+ /** Called once if the resolved src actually fails to load -- see EditorProviderProps.onEmbedError. */
1174
+ onEmbedError?: (src: string) => void;
1175
+ /** Syntax-colors CodeBlock's text -- see EditorProviderProps.highlightCode / useHighlightCode's own doc comment. */
1176
+ highlightCode?: (code: string, language: string) => string;
1177
+ /** 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. */
1178
+ voice?: Record<string, unknown>;
1154
1179
  children?: ReactNode;
1155
1180
  }
1156
1181
 
@@ -1236,6 +1261,14 @@ export function removePerson(store: EditorStore | History, id: string): void;
1236
1261
  /** Reactive view of the document's `people` collection. */
1237
1262
  export function usePeople(): Person[];
1238
1263
 
1264
+ // ---------------------------------------------------------------------------
1265
+ // title/title.js, react/useTitle.js — a document's own title
1266
+ // ---------------------------------------------------------------------------
1267
+
1268
+ export function setTitle(store: EditorStore | History, title: string): void;
1269
+ /** Reactive view of the document's own title (see EditorStore.getTitle). */
1270
+ export function useTitle(): string;
1271
+
1239
1272
  // ---------------------------------------------------------------------------
1240
1273
  // react/useSmartQuotes.js, react/useAutoPairBrackets.js — optional typing behaviors
1241
1274
  // ---------------------------------------------------------------------------