edytor 0.1.0-next.21 → 0.1.0-next.22

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.
@@ -323,9 +323,9 @@ export class Edytor {
323
323
  // ANYTHING is applied, so a failed view cannot half-seed semantics.
324
324
  const blocks = Array.from(this.blocks);
325
325
  this.document.adoptSemantics({
326
- roles: Object.fromEntries(blocks.map(([type, { void: v, island, lines, layout }]) => [
326
+ roles: Object.fromEntries(blocks.map(([type, { void: v, island, lines, layout, atomic }]) => [
327
327
  type,
328
- { void: v, island, lines, layout }
328
+ { void: v, island, lines, layout, atomic }
329
329
  ])),
330
330
  rendersContent: Object.fromEntries(blocks.map(([type, definition]) => [type, definition.rendersContent !== false])),
331
331
  defaultChild
package/dist/index.d.ts CHANGED
@@ -41,4 +41,4 @@ export type { Suggestion, Suggestions, SuggestionAt, SuggestionContent, Suggesti
41
41
  export { textToBlocks, type TextToBlocksOptions } from './clipboard/textBlocks.js';
42
42
  export * from './plugins/index.js';
43
43
  export * from './crdt/index.js';
44
- export { createIndexeddbSync, createWebsocketSync, clearDocument, storeState, IndexeddbPersistence, WebsocketProvider, PresenceWriter, type PresenceOptions, type PresenceShare } from './collaboration/index.js';
44
+ export { createIndexeddbSync, createWebsocketSync, clearDocument, storeState, IndexeddbPersistence, WebsocketProvider, PresenceWriter, DEFAULT_PRESENCE_THROTTLE, type PresenceOptions, type PresenceShare } from './collaboration/index.js';
package/dist/index.js CHANGED
@@ -39,4 +39,4 @@ export * from './crdt/index.js';
39
39
  // needs no `edytor/crdt` import for the common IndexedDB/websocket cases.
40
40
  // The `EdytorSync*`/`IndexeddbSyncOptions`/`WebsocketSyncOptions` types are
41
41
  // already re-exported through `./crdt/index.js` above.
42
- export { createIndexeddbSync, createWebsocketSync, clearDocument, storeState, IndexeddbPersistence, WebsocketProvider, PresenceWriter } from './collaboration/index.js';
42
+ export { createIndexeddbSync, createWebsocketSync, clearDocument, storeState, IndexeddbPersistence, WebsocketProvider, PresenceWriter, DEFAULT_PRESENCE_THROTTLE } from './collaboration/index.js';
package/dist/plugins.d.ts CHANGED
@@ -246,6 +246,17 @@ export type BlockDefinition = {
246
246
  * in the delete contract). Adopted by the document as a role.
247
247
  */
248
248
  layout?: boolean;
249
+ /**
250
+ * Data paths written as one value (`data.atomic`): a top-level key, or an
251
+ * array of keys for a nested one. Setting `block.data.link`, or a key
252
+ * inside it, writes the whole `link` as one property, so two people
253
+ * setting it at once never merge into a value neither wrote (one wins
254
+ * whole); elsewhere each key merges on its own. Adopted by the document as
255
+ * part of the kind's role: every view of a document, a headless one and
256
+ * the room must declare the same paths (`semanticsOf({ embed: { atomic:
257
+ * ['link'] } })`).
258
+ */
259
+ atomic?: readonly (string | readonly string[])[];
249
260
  /**
250
261
  * Whether the snippet renders the block's own content (`content()`).
251
262
  * Defaults to `true`; containers that render only their children
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edytor",
3
- "version": "0.1.0-next.21",
3
+ "version": "0.1.0-next.22",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/beynar/edytor.git"