@ixo/editor 3.0.0-beta.3 → 3.0.0-beta.31

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.
@@ -0,0 +1,452 @@
1
+ import { v as FlowNode, F as FlowNodeAuthzExtension, t as FlowNodeRuntimeState, J as IxoEditorType, f as UcanService, I as InvocationStore, E as EvaluationStatus } from './index-7ptWHYA8.mjs';
2
+ import { Doc } from 'yjs';
3
+ import { MatrixClient } from 'matrix-js-sdk';
4
+
5
+ /** Condition that gates when a capability activates. */
6
+ interface ConditionRef {
7
+ /** ID of the upstream capability whose output is checked. */
8
+ sourceId: string;
9
+ /** Output field path to inspect, e.g., "decision". */
10
+ field: string;
11
+ /** Comparison operator. */
12
+ operator: 'eq' | 'neq' | 'gt' | 'lt' | 'in' | 'exists';
13
+ /** Value to compare against (omit for 'exists'). */
14
+ value?: unknown;
15
+ /** What happens when the condition is (not) met. */
16
+ effect?: {
17
+ action: 'enable' | 'disable' | 'hide' | 'show';
18
+ message?: string;
19
+ };
20
+ }
21
+ /** Authorization constraint for a capability. */
22
+ interface ActorConstraint {
23
+ /** Whitelisted actor DIDs. */
24
+ authorisedActors?: string[];
25
+ /** Parent capability URI for delegation chain. */
26
+ parentCapability?: string;
27
+ }
28
+ /** Time-to-live constraint for a capability. */
29
+ interface TTLConstraint {
30
+ /** Hard deadline (ISO 8601 date string). */
31
+ absoluteDueDate?: string;
32
+ /** Duration from when the block becomes enabled (ISO 8601 duration, e.g., "P7D"). */
33
+ fromEnablement?: string;
34
+ /** Duration from when an actor commits (ISO 8601 duration, e.g., "PT2H"). */
35
+ fromCommitment?: string;
36
+ }
37
+ /**
38
+ * A single capability in a Base UCAN flow plan.
39
+ *
40
+ * UCAN semantics:
41
+ * can = the action
42
+ * with = the resource or scope
43
+ * nb = typed caveats, inputs, parameters
44
+ *
45
+ * Workflow semantics (kept separate from nb):
46
+ * dependsOn, condition, parallelGroup, phase
47
+ */
48
+ interface FlowCapability {
49
+ /** Stable node identifier for this step. */
50
+ id: string;
51
+ /** UCAN-style ability string, e.g., "bid/submit", "email/send". */
52
+ can: string;
53
+ /** Resource URI, e.g., "ixo:flow:{flowId}" or "ixo:flow:{flowId}:{nodeId}". */
54
+ with: string;
55
+ /** Typed caveats / input parameters. Shape is dictated by the action registry. */
56
+ nb?: Record<string, unknown>;
57
+ /** IDs of upstream capabilities this depends on. */
58
+ dependsOn?: string[];
59
+ /** Condition that must be met for this capability to activate. */
60
+ condition?: ConditionRef;
61
+ /** Capabilities sharing a parallelGroup run concurrently. */
62
+ parallelGroup?: string;
63
+ /** Semantic grouping for layout lanes. */
64
+ phase?: string;
65
+ /** Who can execute this step. */
66
+ actor?: ActorConstraint;
67
+ /** Time-to-live constraints. */
68
+ ttl?: TTLConstraint;
69
+ /** Display title (falls back to can statement). */
70
+ title?: string;
71
+ /** Description of what this step does. */
72
+ description?: string;
73
+ /** Icon identifier. */
74
+ icon?: string;
75
+ }
76
+ /**
77
+ * The Base UCAN flow plan — the intermediate representation between
78
+ * user intent and the compiled flow graph.
79
+ *
80
+ * capabilities is an ordered list. Each capability carries its own stable `id`.
81
+ */
82
+ interface BaseUcanFlow {
83
+ kind: 'qi.flow.base-ucan';
84
+ version: '1.0';
85
+ flowId: string;
86
+ title: string;
87
+ goal?: string;
88
+ meta?: {
89
+ entityDid?: string;
90
+ flowUri?: string;
91
+ rootIssuer?: string;
92
+ };
93
+ /** Ordered capabilities, each with its own stable node ID. */
94
+ capabilities: FlowCapability[];
95
+ }
96
+ /** A reference to an upstream node's output field. Format: "nodeId.output.fieldPath" */
97
+ interface RuntimeRef {
98
+ $ref: string;
99
+ }
100
+ declare function isRuntimeRef(value: unknown): value is RuntimeRef;
101
+ /** A single block ready for insertion into BlockNote. */
102
+ interface CompiledBlock {
103
+ /** Pre-generated stable block ID. */
104
+ id: string;
105
+ /** BlockNote block type (e.g., "action"). */
106
+ type: string;
107
+ /** Block props — all values are strings per BlockNote convention. */
108
+ props: Record<string, string>;
109
+ }
110
+ /** A dependency edge in the flow graph. */
111
+ interface CompiledEdge {
112
+ id: string;
113
+ source: string;
114
+ target: string;
115
+ kind: 'dependency';
116
+ condition?: ConditionRef;
117
+ }
118
+ /** A compiled flow node stored in qi.flow.nodes. */
119
+ interface CompiledFlowNode {
120
+ id: string;
121
+ blockId: string;
122
+ can: string;
123
+ with: string;
124
+ registryType: string;
125
+ title: string;
126
+ description: string;
127
+ props: Record<string, string>;
128
+ dependsOn: string[];
129
+ phase?: string;
130
+ parallelGroup?: string;
131
+ actor?: ActorConstraint;
132
+ }
133
+ /** The complete compiled output from the Base UCAN compiler. */
134
+ interface CompiledFlow {
135
+ /** Flow metadata for qi.flow.meta and Y.Map('root'). */
136
+ meta: {
137
+ flowId: string;
138
+ title: string;
139
+ goal?: string;
140
+ version: string;
141
+ flowOwnerDid: string;
142
+ flowUri?: string;
143
+ compiledAt: string;
144
+ compiledFrom: 'BaseUcanFlow';
145
+ };
146
+ /** Blocks to insert into BlockNote, in topological order. */
147
+ blocks: CompiledBlock[];
148
+ /** Flow graph nodes, keyed by node ID. */
149
+ nodes: Record<string, CompiledFlowNode>;
150
+ /** Dependency edges. */
151
+ edges: CompiledEdge[];
152
+ /** Topological order of node IDs. */
153
+ order: string[];
154
+ /** nodeId → blockId mapping. */
155
+ blockIndex: Record<string, string>;
156
+ }
157
+
158
+ declare const buildAuthzFromProps: (props: Record<string, any>) => FlowNodeAuthzExtension;
159
+ declare const buildFlowNodeFromBlock: (block: any) => FlowNode;
160
+
161
+ interface FlowRuntimeStateManager {
162
+ get: (nodeId: string) => FlowNodeRuntimeState;
163
+ update: (nodeId: string, updates: Partial<FlowNodeRuntimeState>) => void;
164
+ }
165
+ declare const createRuntimeStateManager: (editor?: IxoEditorType | null) => FlowRuntimeStateManager;
166
+ /**
167
+ * Clears runtime and invocations from a Y.Doc.
168
+ * Used when cloning a flow as a template — the new document should
169
+ * carry only configuration (intent), not execution history.
170
+ */
171
+ declare function clearRuntimeForTemplateClone(yDoc: Doc): void;
172
+
173
+ interface NodeActionResult {
174
+ claimId?: string;
175
+ evaluationStatus?: EvaluationStatus;
176
+ submittedByDid?: string;
177
+ payload?: any;
178
+ }
179
+ interface ExecutionContext {
180
+ runtime: FlowRuntimeStateManager;
181
+ ucanService: UcanService;
182
+ invocationStore: InvocationStore;
183
+ flowUri: string;
184
+ flowId: string;
185
+ flowOwnerDid: string;
186
+ now?: () => number;
187
+ }
188
+ interface ExecutionOutcome {
189
+ success: boolean;
190
+ stage: 'activation' | 'authorization' | 'claim' | 'action' | 'complete';
191
+ error?: string;
192
+ result?: NodeActionResult;
193
+ capabilityId?: string;
194
+ invocationCid?: string;
195
+ }
196
+ interface ExecuteNodeParams {
197
+ node: FlowNode;
198
+ actorDid: string;
199
+ actorType: 'entity' | 'user';
200
+ entityRoomId?: string;
201
+ context: ExecutionContext;
202
+ action: () => Promise<NodeActionResult>;
203
+ pin: string;
204
+ }
205
+ /**
206
+ * Execute a node with UCAN invocation-based authorization.
207
+ *
208
+ * Pipeline:
209
+ * 1. Check activation (upstream conditions)
210
+ * 2. Check authorization (UCAN delegation chain)
211
+ * 3. Create invocation (signed proof of execution)
212
+ * 4. Execute action
213
+ * 5. Store invocation result
214
+ * 6. Update runtime state
215
+ */
216
+ declare const executeNode: ({ node, actorDid, actorType, entityRoomId, context, action, pin }: ExecuteNodeParams) => Promise<ExecutionOutcome>;
217
+
218
+ interface AuthorizationResult {
219
+ authorized: boolean;
220
+ reason?: string;
221
+ capabilityId?: string;
222
+ proofCids?: string[];
223
+ }
224
+ /**
225
+ * Check if an actor is authorized to execute a block via UCAN delegation chain.
226
+ *
227
+ * Every execution requires a valid delegation chain from the flow owner to the actor.
228
+ * There is no default-allow or whitelist bypass.
229
+ */
230
+ declare const isAuthorized: (blockId: string, actorDid: string, ucanService: UcanService, flowUri: string) => Promise<AuthorizationResult>;
231
+
232
+ interface ActivationResult {
233
+ active: boolean;
234
+ reason?: string;
235
+ }
236
+ declare const isNodeActive: (node: FlowNode, runtime: FlowRuntimeStateManager) => ActivationResult;
237
+
238
+ interface ActionContext {
239
+ actorDid: string;
240
+ flowId: string;
241
+ nodeId: string;
242
+ services: ActionServices;
243
+ flowNode?: any;
244
+ runtime?: any;
245
+ flowUri?: string;
246
+ handlers?: any;
247
+ editor?: any;
248
+ }
249
+ interface ActionServices {
250
+ http?: {
251
+ request: (params: {
252
+ url: string;
253
+ method: string;
254
+ headers?: Record<string, string>;
255
+ body?: any;
256
+ }) => Promise<{
257
+ status: number;
258
+ headers: Record<string, string>;
259
+ data: any;
260
+ }>;
261
+ };
262
+ email?: {
263
+ send: (params: {
264
+ to: string;
265
+ subject: string;
266
+ template: string;
267
+ templateVersion?: string;
268
+ variables?: Record<string, any>;
269
+ cc?: string;
270
+ bcc?: string;
271
+ replyTo?: string;
272
+ }) => Promise<{
273
+ messageId: string;
274
+ sentAt: string;
275
+ }>;
276
+ };
277
+ notify?: {
278
+ send: (params: {
279
+ channel: string;
280
+ to: string[];
281
+ cc?: string[];
282
+ bcc?: string[];
283
+ subject?: string;
284
+ body?: string;
285
+ bodyType?: 'text' | 'html';
286
+ from?: string;
287
+ replyTo?: string;
288
+ }) => Promise<{
289
+ messageId: string;
290
+ sentAt: string;
291
+ }>;
292
+ };
293
+ bid?: {
294
+ submitBid: (params: {
295
+ collectionId: string;
296
+ role: string;
297
+ surveyAnswers: Record<string, any>;
298
+ }) => Promise<any>;
299
+ approveBid: (params: {
300
+ bidId: string;
301
+ collectionId: string;
302
+ did: string;
303
+ }) => Promise<any>;
304
+ rejectBid: (params: {
305
+ bidId: string;
306
+ collectionId: string;
307
+ did: string;
308
+ reason: string;
309
+ }) => Promise<any>;
310
+ approveServiceAgentApplication: (params: {
311
+ adminAddress: string;
312
+ collectionId: string;
313
+ agentQuota: number;
314
+ deedDid: string;
315
+ currentUserAddress: string;
316
+ }) => Promise<void>;
317
+ approveEvaluatorApplication: (params: {
318
+ adminAddress: string;
319
+ collectionId: string;
320
+ deedDid: string;
321
+ evaluatorAddress: string;
322
+ agentQuota?: number;
323
+ claimIds?: string[];
324
+ maxAmounts?: Array<{
325
+ denom: string;
326
+ amount: string;
327
+ }>;
328
+ }) => Promise<void>;
329
+ };
330
+ claim?: {
331
+ requestPin: (config?: {
332
+ title?: string;
333
+ description?: string;
334
+ submitText?: string;
335
+ }) => Promise<string>;
336
+ submitClaim: (params: {
337
+ surveyData: any;
338
+ deedDid: string;
339
+ collectionId: string;
340
+ adminAddress: string;
341
+ pin: string;
342
+ }) => Promise<{
343
+ transactionHash: string;
344
+ claimId: string;
345
+ }>;
346
+ evaluateClaim: (granteeAddress: string, did: string, payload: {
347
+ claimId: string;
348
+ collectionId: string;
349
+ adminAddress: string;
350
+ status?: number;
351
+ verificationProof: string;
352
+ amount?: {
353
+ denom: string;
354
+ amount: string;
355
+ } | Array<{
356
+ denom: string;
357
+ amount: string;
358
+ }>;
359
+ }) => Promise<void>;
360
+ getCurrentUser: () => {
361
+ address: string;
362
+ };
363
+ createUdid?: (params: any) => Promise<any>;
364
+ };
365
+ matrix?: {
366
+ storeCredential: (params: {
367
+ roomId: string;
368
+ credentialKey: string;
369
+ credential: Record<string, any>;
370
+ cid: string;
371
+ }) => Promise<{
372
+ storedAt: string;
373
+ duplicate: boolean;
374
+ }>;
375
+ };
376
+ }
377
+ interface OutputSchemaField {
378
+ path: string;
379
+ displayName: string;
380
+ type: 'string' | 'number' | 'boolean' | 'object' | 'array';
381
+ description?: string;
382
+ }
383
+ interface ActionDefinition<TInputs extends Record<string, any> = Record<string, any>> {
384
+ type: string;
385
+ /** UCAN-style ability string used by the flow compiler, e.g., "bid/submit". */
386
+ can?: string;
387
+ sideEffect: boolean;
388
+ defaultRequiresConfirmation: boolean;
389
+ requiredCapability?: string;
390
+ inputSchema?: object;
391
+ /** Static output schema for action types with predictable output (e.g. email.send).
392
+ * For action types with dynamic output (e.g. http.request), the schema is user-defined in inputs. */
393
+ outputSchema?: OutputSchemaField[];
394
+ run: (inputs: TInputs, ctx: ActionContext) => Promise<ActionResult>;
395
+ }
396
+ interface ActionResult {
397
+ output: Record<string, any>;
398
+ }
399
+
400
+ /** Registry interface expected by the compiler (keeps it pure / testable). */
401
+ interface CompilerRegistry {
402
+ getActionByCan(can: string): ActionDefinition | undefined;
403
+ }
404
+ /**
405
+ * Compile a Base UCAN flow plan into blocks, graph state, and metadata.
406
+ *
407
+ * This is a **pure function** — no React, no Yjs, no side effects.
408
+ * The output is consumed by `hydrateFlowFromPlan()`.
409
+ */
410
+ declare function compileBaseUcanFlow(plan: BaseUcanFlow, registry: CompilerRegistry): CompiledFlow;
411
+
412
+ interface SetupFlowOptions {
413
+ /** The Base UCAN flow plan to compile. */
414
+ plan: BaseUcanFlow;
415
+ /** Matrix room ID to hydrate the flow into. */
416
+ roomId: string;
417
+ /** Authenticated Matrix client. */
418
+ matrixClient: MatrixClient;
419
+ /** DID of the user setting up the flow. */
420
+ creatorDid: string;
421
+ /** Optional doc ID override (defaults to plan.flowId). */
422
+ docId?: string;
423
+ }
424
+ interface SetupFlowResult {
425
+ /** The compiled flow artifacts. */
426
+ compiled: CompiledFlow;
427
+ /** The room ID (same as input, for convenience). */
428
+ roomId: string;
429
+ /** The flow ID from the plan. */
430
+ flowId: string;
431
+ }
432
+ /**
433
+ * One-shot function that compiles a Base UCAN flow plan and writes it
434
+ * into a Matrix room's Y.Doc. After this completes, the room is a
435
+ * normal flow that anyone can open via `useCreateCollaborativeIxoEditor`.
436
+ *
437
+ * Usage:
438
+ * ```ts
439
+ * const result = await setupFlowFromBaseUcan({
440
+ * plan: myBaseUcanFlow,
441
+ * roomId: '!abc:matrix.org',
442
+ * matrixClient,
443
+ * creatorDid: 'did:ixo:abc123',
444
+ * });
445
+ *
446
+ * // Now open the flow through normal channels:
447
+ * // useCreateCollaborativeIxoEditor({ roomId: result.roomId, ... })
448
+ * ```
449
+ */
450
+ declare function setupFlowFromBaseUcan(options: SetupFlowOptions): Promise<SetupFlowResult>;
451
+
452
+ export { type AuthorizationResult as A, type BaseUcanFlow as B, type CompilerRegistry as C, type ExecuteNodeParams as E, type FlowRuntimeStateManager as F, type NodeActionResult as N, type OutputSchemaField as O, type RuntimeRef as R, type SetupFlowOptions as S, type TTLConstraint as T, isNodeActive as a, buildFlowNodeFromBlock as b, createRuntimeStateManager as c, buildAuthzFromProps as d, executeNode as e, type ExecutionOutcome as f, type ExecutionContext as g, type ActivationResult as h, isAuthorized as i, compileBaseUcanFlow as j, type SetupFlowResult as k, type FlowCapability as l, type CompiledFlow as m, type ActionDefinition as n, type ActionServices as o, clearRuntimeForTemplateClone as p, type ActionContext as q, type ActionResult as r, setupFlowFromBaseUcan as s, type ConditionRef as t, type ActorConstraint as u, type CompiledBlock as v, type CompiledEdge as w, type CompiledFlowNode as x, isRuntimeRef as y };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ixo/editor",
3
- "version": "3.0.0-beta.3",
3
+ "version": "3.0.0-beta.31",
4
4
  "description": "A custom BlockNote editor wrapper for IXO team",
5
5
  "main": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",
@@ -22,6 +22,11 @@
22
22
  "types": "./dist/mantine/index.d.ts",
23
23
  "import": "./dist/mantine/index.mjs"
24
24
  },
25
+ "./core": {
26
+ "types": "./dist/core/index.d.ts",
27
+ "import": "./dist/core/index.mjs",
28
+ "default": "./dist/core/index.mjs"
29
+ },
25
30
  "./style.css": "./style.css",
26
31
  "./style-mantine.css": "./style-mantine.css",
27
32
  "./style-core.css": "./style-core.css"
@@ -32,7 +37,8 @@
32
37
  "clean": "rimraf dist style.css",
33
38
  "prepare": "husky install && npm run clean && npm run build",
34
39
  "type-check": "tsc --noEmit",
35
- "test": "echo \"Error: no test specified\" && exit 1",
40
+ "test": "vitest run --passWithNoTests",
41
+ "test:watch": "vitest",
36
42
  "format": "prettier --write \"src/**/*.{ts,tsx}\"",
37
43
  "format:check": "prettier --check \"src/**/*.{ts,tsx}\"",
38
44
  "lint-staged": "lint-staged"
@@ -64,6 +70,9 @@
64
70
  "@dnd-kit/core": "^6.3.1",
65
71
  "@ixo/ucan": "^1.0.1",
66
72
  "@tabler/icons-react": "3.35.0",
73
+ "blockstore-core": "^6.1.2",
74
+ "ipfs-unixfs-importer": "^16.1.1",
75
+ "multiformats": "^13.4.2",
67
76
  "yjs": "13.6.27",
68
77
  "zustand": "5.0.8"
69
78
  },
@@ -82,6 +91,9 @@
82
91
  "@semantic-release/git": "^10.0.1",
83
92
  "@semantic-release/npm": "^11.0.2",
84
93
  "@semantic-release/release-notes-generator": "^12.1.0",
94
+ "@testing-library/jest-dom": "^6.6.3",
95
+ "@testing-library/react": "^16.3.2",
96
+ "@testing-library/react-hooks": "^8.0.1",
85
97
  "@types/react": "^18.2.0",
86
98
  "@types/react-dom": "^18.2.0",
87
99
  "@typescript-eslint/eslint-plugin": "^8.44.1",
@@ -91,7 +103,9 @@
91
103
  "eslint-plugin-jsx-a11y": "^6.10.2",
92
104
  "eslint-plugin-react": "^7.37.5",
93
105
  "eslint-plugin-react-hooks": "^5.2.0",
106
+ "happy-dom": "^18.0.1",
94
107
  "husky": "^8.0.3",
108
+ "jsdom": "^28.1.0",
95
109
  "lint-staged": "^16.2.0",
96
110
  "nodemon": "^3.1.11",
97
111
  "prettier": "^3.2.5",
@@ -101,7 +115,8 @@
101
115
  "rimraf": "^5.0.0",
102
116
  "semantic-release": "^22.0.12",
103
117
  "tsup": "^8.5.0",
104
- "typescript": "^5.0.0"
118
+ "typescript": "^5.0.0",
119
+ "vitest": "^4.0.18"
105
120
  },
106
121
  "repository": {
107
122
  "type": "git",
package/style-core.css CHANGED
@@ -45,7 +45,7 @@
45
45
  --bn-colors-tooltip-background: #f0f0f0;
46
46
  --bn-colors-tooltip-text: #1a1a1a;
47
47
  --bn-colors-hovered-background: #2a2a2a;
48
- --bn-colors-selected-background: #3a3a3a;
48
+ --bn-colors-selected-background: color-mix(in srgb, var(--mantine-color-neutralColor-7) 30%, transparent);
49
49
  --bn-colors-border: #3a3a3a;
50
50
  --bn-colors-side-menu: #999999;
51
51
  --bn-colors-highlight-colors-blue: #60a5fa;
@@ -76,6 +76,17 @@
76
76
  min-height: 1.5em;
77
77
  }
78
78
 
79
+ /* Disable text selection on custom (non-editable) blocks.
80
+ Standard text blocks re-enable it via .bn-inline-content below. */
81
+ .ixo-editor div.bn-block-content {
82
+ user-select: none;
83
+ }
84
+
85
+ /* Re-enable text selection inside standard editable block content */
86
+ .ixo-editor .bn-inline-content {
87
+ user-select: text;
88
+ }
89
+
79
90
  /* Heading styles */
80
91
  .ixo-editor h1.bn-inline-content {
81
92
  font-size: 2em;
@@ -208,6 +219,11 @@
208
219
  /* Selection styles */
209
220
  .ixo-editor ::selection {
210
221
  background-color: var(--bn-colors-selected-background);
222
+ color: var(--bn-colors-editor-text);
223
+ }
224
+
225
+ .ixo-editor--theme-dark ::selection {
226
+ background-color: color-mix(in srgb, var(--mantine-color-neutralColor-7) 30%, transparent) !important;
211
227
  }
212
228
 
213
229
  /* Scrollbar styles */
@@ -261,6 +277,36 @@
261
277
  }
262
278
  }
263
279
 
280
+ /* Block presence awareness */
281
+ .ixo-block-presence-border {
282
+ transition: border-left-color 200ms ease;
283
+ }
284
+
285
+ .ixo-block-presence-badges {
286
+ position: absolute;
287
+ top: -8px;
288
+ right: 12px;
289
+ display: flex;
290
+ gap: 4px;
291
+ z-index: 10;
292
+ pointer-events: none;
293
+ }
294
+
295
+ .ixo-block-presence-badge {
296
+ width: 20px;
297
+ height: 20px;
298
+ border-radius: 50%;
299
+ display: flex;
300
+ align-items: center;
301
+ justify-content: center;
302
+ font-size: 11px;
303
+ font-weight: 600;
304
+ color: #fff;
305
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
306
+ pointer-events: none;
307
+ overflow: hidden;
308
+ }
309
+
264
310
  /* Hide ProseMirror drop cursor ONLY when dragging external artifacts */
265
311
  body.external-artifact-drag-active .prosemirror-dropcursor-block,
266
312
  body.external-artifact-drag-active .prosemirror-dropcursor-inline {
package/style-mantine.css CHANGED
@@ -142,7 +142,7 @@
142
142
  --bn-colors-tooltip-background: #f0f0f0;
143
143
  --bn-colors-tooltip-text: #1a1a1a;
144
144
  --bn-colors-hovered-background: #2a2a2a;
145
- --bn-colors-selected-background: #3a3a3a;
145
+ --bn-colors-selected-background: color-mix(in srgb, var(--mantine-color-neutralColor-7) 30%, transparent);
146
146
  --bn-colors-border: #3a3a3a;
147
147
  --bn-colors-side-menu: #999999;
148
148
  --bn-colors-highlight-colors-blue: #60a5fa;
@@ -173,6 +173,17 @@
173
173
  min-height: 1.5em;
174
174
  }
175
175
 
176
+ /* Disable text selection on custom (non-editable) blocks.
177
+ Standard text blocks re-enable it via .bn-inline-content below. */
178
+ .ixo-editor div.bn-block-content {
179
+ user-select: none;
180
+ }
181
+
182
+ /* Re-enable text selection inside standard editable block content */
183
+ .ixo-editor .bn-inline-content {
184
+ user-select: text;
185
+ }
186
+
176
187
  /* Heading styles */
177
188
  .ixo-editor h1.bn-inline-content {
178
189
  font-size: 2em;
@@ -305,6 +316,11 @@
305
316
  /* Selection styles */
306
317
  .ixo-editor ::selection {
307
318
  background-color: var(--bn-colors-selected-background);
319
+ color: var(--bn-colors-editor-text);
320
+ }
321
+
322
+ .ixo-editor--theme-dark ::selection {
323
+ background-color: color-mix(in srgb, var(--mantine-color-neutralColor-7) 30%, transparent) !important;
308
324
  }
309
325
 
310
326
  /* Scrollbar styles */
@@ -358,6 +374,36 @@
358
374
  }
359
375
  }
360
376
 
377
+ /* Block presence awareness */
378
+ .ixo-block-presence-border {
379
+ transition: border-left-color 200ms ease;
380
+ }
381
+
382
+ .ixo-block-presence-badges {
383
+ position: absolute;
384
+ top: -8px;
385
+ right: 12px;
386
+ display: flex;
387
+ gap: 4px;
388
+ z-index: 10;
389
+ pointer-events: none;
390
+ }
391
+
392
+ .ixo-block-presence-badge {
393
+ width: 20px;
394
+ height: 20px;
395
+ border-radius: 50%;
396
+ display: flex;
397
+ align-items: center;
398
+ justify-content: center;
399
+ font-size: 11px;
400
+ font-weight: 600;
401
+ color: #fff;
402
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
403
+ pointer-events: none;
404
+ overflow: hidden;
405
+ }
406
+
361
407
  /* Hide ProseMirror drop cursor ONLY when dragging external artifacts */
362
408
  body.external-artifact-drag-active .prosemirror-dropcursor-block,
363
409
  body.external-artifact-drag-active .prosemirror-dropcursor-inline {