feat(writekit): rename @robonen/editor to @robonen/writekit
Rename the rich-text editor package and all Editor* exports to Writekit*; remove the old vue/editor tree.
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
/**
|
||||
* Stable, collision-resistant identifier for blocks. Block ids survive
|
||||
* split/merge/move and are how positions, selections, and the CRDT address a
|
||||
* block — so they must be unique and never reused.
|
||||
*/
|
||||
export function createId(): string {
|
||||
if (typeof crypto !== 'undefined' && typeof crypto.randomUUID === 'function')
|
||||
return crypto.randomUUID();
|
||||
|
||||
// Fallback for exotic runtimes without WebCrypto (Node >= 19 and all target
|
||||
// browsers provide `crypto.randomUUID`, so this is effectively dead code).
|
||||
return `b-${Math.random().toString(36).slice(2)}-${Date.now().toString(36)}`;
|
||||
}
|
||||
Reference in New Issue
Block a user