@blokkli/editor 2.0.0-alpha.56 → 2.0.0-alpha.58

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 (53) hide show
  1. package/dist/module.d.mts +2 -2
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +2 -2
  4. package/dist/modules/agent/index.d.mts +1 -1
  5. package/dist/modules/agent/index.mjs +19 -19
  6. package/dist/modules/agent/runtime/app/composables/index.d.ts +3 -1
  7. package/dist/modules/agent/runtime/app/composables/index.js +1 -0
  8. package/dist/modules/agent/runtime/app/composables/useAgent.d.ts +6 -0
  9. package/dist/modules/agent/runtime/app/composables/useAgent.js +11 -0
  10. package/dist/modules/agent/runtime/app/features/agent/Container.vue +83 -88
  11. package/dist/modules/agent/runtime/app/helpers/buildPageContext.d.ts +7 -0
  12. package/dist/modules/agent/runtime/app/helpers/buildPageContext.js +81 -0
  13. package/dist/modules/agent/runtime/app/helpers/index.d.ts +15 -1
  14. package/dist/modules/agent/runtime/app/helpers/index.js +16 -0
  15. package/dist/modules/agent/runtime/app/helpers/injections.d.ts +3 -0
  16. package/dist/modules/agent/runtime/app/helpers/injections.js +3 -0
  17. package/dist/modules/agent/runtime/app/providers/agentProvider.d.ts +33 -0
  18. package/dist/modules/agent/runtime/app/providers/agentProvider.js +315 -0
  19. package/dist/modules/agent/runtime/app/providers/conversationProvider.d.ts +50 -0
  20. package/dist/modules/agent/runtime/app/providers/conversationProvider.js +263 -0
  21. package/dist/modules/agent/runtime/app/providers/planProvider.d.ts +15 -0
  22. package/dist/modules/agent/runtime/app/providers/planProvider.js +34 -0
  23. package/dist/modules/agent/runtime/app/providers/socketProvider.d.ts +17 -0
  24. package/dist/modules/agent/runtime/app/providers/socketProvider.js +110 -0
  25. package/dist/modules/agent/runtime/app/providers/toolsProvider.d.ts +44 -0
  26. package/dist/modules/agent/runtime/app/providers/toolsProvider.js +298 -0
  27. package/dist/modules/agent/runtime/app/types/index.d.ts +47 -0
  28. package/dist/modules/agent/runtime/app/types/index.js +3 -1
  29. package/dist/modules/agent/runtime/server/helpers.js +2 -1
  30. package/dist/modules/charts/index.d.mts +1 -1
  31. package/dist/modules/drupal/index.d.mts +2 -2
  32. package/dist/modules/iframes/index.d.mts +1 -1
  33. package/dist/modules/index.d.mts +1 -1
  34. package/dist/modules/readability/index.d.mts +2 -2
  35. package/dist/modules/table-of-contents/index.d.mts +2 -2
  36. package/dist/runtime/editor/components/DiffViewer/State.vue +51 -67
  37. package/dist/runtime/editor/components/EditProvider.vue +30 -10
  38. package/dist/runtime/editor/components/PreviewProvider.vue +14 -8
  39. package/dist/runtime/editor/css/output.css +1 -1
  40. package/dist/runtime/editor/events/index.d.ts +4 -3
  41. package/dist/runtime/editor/features/add-list/index.vue +2 -1
  42. package/dist/runtime/editor/features/changelog/changelog.json +8 -0
  43. package/dist/runtime/editor/features/dev-mode/index.vue +1 -10
  44. package/dist/runtime/editor/features/responsive-preview/Frame/index.vue +2 -2
  45. package/dist/runtime/editor/features/translations/index.vue +1 -0
  46. package/dist/runtime/editor/plugins/Sidebar/index.vue +9 -2
  47. package/dist/runtime/editor/providers/state.js +4 -1
  48. package/dist/shared/{editor.BTOBvmaz.d.mts → editor.Bpw1EP57.d.mts} +3 -3
  49. package/dist/shared/{editor.9vf8ZnOp.mjs → editor.FygP6XeF.mjs} +2 -2
  50. package/dist/types.d.mts +1 -1
  51. package/package.json +30 -7
  52. package/dist/modules/agent/runtime/app/composables/agentProvider.d.ts +0 -62
  53. package/dist/modules/agent/runtime/app/composables/agentProvider.js +0 -1048
@@ -249,22 +249,6 @@ function scrollToBlock(uuid) {
249
249
  </script>
250
250
 
251
251
  <style>
252
- /* Diff display in the artboard (page content), outside the .bk editor scope. */
253
- [data-bk-diff-active] del {
254
- color: rgb(var(--bk-theme-red-normal) / 0.5);
255
- text-decoration-line: line-through;
256
- text-decoration-color: rgb(var(--bk-theme-red-normal) / 1);
257
- }
258
- [data-bk-diff-active] ins {
259
- border-radius: 4px;
260
- border-width: 1px;
261
- border-color: rgb(var(--bk-theme-lime-normal) / 0.3);
262
- --bk-tw-bg-opacity: 1;
263
- background-color: rgb(var(--bk-theme-lime-light) / var(--bk-tw-bg-opacity, 1));
264
- --bk-tw-text-opacity: 1;
265
- color: rgb(var(--bk-theme-lime-dark) / var(--bk-tw-text-opacity, 1));
266
- text-decoration-line: none;
267
- }
268
252
  .bk.bk-diff-sidebar-pane {
269
253
  position: absolute;
270
254
  top: 0px;
@@ -274,30 +258,30 @@ function scrollToBlock(uuid) {
274
258
  overflow: auto;
275
259
  overscroll-behavior: contain;
276
260
  }
277
- .bk.bk-diff-view {
261
+ .bk.bk-diff-view {
278
262
  user-select: text;
279
263
  container-type: inline-size;
280
264
  }
281
- .bk.bk-diff-view .bk-blokkli-item-label {
265
+ .bk.bk-diff-view .bk-blokkli-item-label {
282
266
  flex: 1 1 0%;
283
267
  font-weight: 600;
284
268
  }
285
- .bk.bk-diff-view .bk-blokkli-item-label span {
269
+ .bk.bk-diff-view .bk-blokkli-item-label span {
286
270
  line-height: 1;
287
271
  }
288
- .bk.bk-diff-view .bk-blokkli-item-label[disabled] {
272
+ .bk.bk-diff-view .bk-blokkli-item-label[disabled] {
289
273
  pointer-events: none;
290
274
  }
291
- .bk .bk-diff-mode-selector {
275
+ .bk .bk-diff-mode-selector {
292
276
  border-bottom-width: 1px;
293
277
  --bk-tw-border-opacity: 1;
294
278
  border-color: rgb(var(--bk-theme-mono-300) / var(--bk-tw-border-opacity, 1));
295
279
  padding: 20px;
296
280
  }
297
- .bk .bk-diff-table {
281
+ .bk .bk-diff-table {
298
282
  width: 100%;
299
283
  }
300
- .bk .bk-diff-item {
284
+ .bk .bk-diff-item {
301
285
  width: 100%;
302
286
  border-top-width: 1px;
303
287
  --bk-tw-border-opacity: 1;
@@ -305,50 +289,50 @@ function scrollToBlock(uuid) {
305
289
  --bk-tw-text-opacity: 1;
306
290
  color: rgb(var(--bk-theme-mono-900) / var(--bk-tw-text-opacity, 1));
307
291
  }
308
- .bk .bk-diff-item:hover {
292
+ .bk .bk-diff-item:hover {
309
293
  --bk-tw-bg-opacity: 1;
310
294
  background-color: rgb(var(--bk-theme-mono-100) / var(--bk-tw-bg-opacity, 1));
311
295
  }
312
- .bk .bk-diff-item.bk-is-muted .bk-diff-item-diffs,
296
+ .bk .bk-diff-item.bk-is-muted .bk-diff-item-diffs,
313
297
  .bk .bk-diff-item.bk-is-muted .bk-diff-status {
314
298
  opacity: 0.5;
315
299
  }
316
- .bk .bk-diff-item.bk-is-muted .bk-blokkli-item-label span {
300
+ .bk .bk-diff-item.bk-is-muted .bk-blokkli-item-label span {
317
301
  --bk-tw-text-opacity: 1;
318
302
  color: rgb(var(--bk-theme-mono-400) / var(--bk-tw-text-opacity, 1));
319
303
  }
320
- .bk .bk-diff-item-diffs {
304
+ .bk .bk-diff-item-diffs {
321
305
  }
322
- .bk .bk-diff-item-header {
306
+ .bk .bk-diff-item-header {
323
307
  display: flex;
324
308
  width: 100%;
325
309
  align-items: center;
326
310
  padding: 20px;
327
311
  }
328
- .bk .bk-diff-item-header.bk-is-selected .bk-blokkli-item-label-icon {
312
+ .bk .bk-diff-item-header.bk-is-selected .bk-blokkli-item-label-icon {
329
313
  border-color: rgb(var(--bk-theme-orange-dark) / 0.3);
330
314
  --bk-tw-bg-opacity: 1;
331
315
  background-color: rgb(var(--bk-theme-orange-normal) / var(--bk-tw-bg-opacity, 1));
332
316
  --bk-tw-text-opacity: 1;
333
317
  color: rgb(var(--bk-theme-orange-dark) / var(--bk-tw-text-opacity, 1));
334
318
  }
335
- .bk .bk-diff-prop-row {
319
+ .bk .bk-diff-prop-row {
336
320
  padding-left: 20px;
337
321
  padding-right: 20px;
338
322
  margin-bottom: 20px;
339
323
  }
340
- .bk .bk-diff-prop-row h3 {
324
+ .bk .bk-diff-prop-row h3 {
341
325
  margin-bottom: 5px;
342
326
  font-size: 14px;
343
327
  line-height: 20px;
344
328
  font-weight: 600;
345
329
  }
346
- .bk .bk-diff-monospace {
330
+ .bk .bk-diff-monospace {
347
331
  font-family: monospace;
348
332
  font-size: 14px;
349
333
  line-height: 20px;
350
334
  }
351
- .bk .bk-diff-markup-style p,
335
+ .bk .bk-diff-markup-style p,
352
336
  .bk .bk-diff-markup-style ul,
353
337
  .bk .bk-diff-markup-style ol,
354
338
  .bk .bk-diff-markup-style h1,
@@ -360,7 +344,7 @@ function scrollToBlock(uuid) {
360
344
  margin-top: 20px;
361
345
  margin-bottom: 20px;
362
346
  }
363
- .bk .bk-diff-markup-style p:first-child,
347
+ .bk .bk-diff-markup-style p:first-child,
364
348
  .bk .bk-diff-markup-style ul:first-child,
365
349
  .bk .bk-diff-markup-style ol:first-child,
366
350
  .bk .bk-diff-markup-style h1:first-child,
@@ -371,7 +355,7 @@ function scrollToBlock(uuid) {
371
355
  .bk .bk-diff-markup-style h6:first-child {
372
356
  margin-top: 0px;
373
357
  }
374
- .bk .bk-diff-markup-style p:last-child,
358
+ .bk .bk-diff-markup-style p:last-child,
375
359
  .bk .bk-diff-markup-style ul:last-child,
376
360
  .bk .bk-diff-markup-style ol:last-child,
377
361
  .bk .bk-diff-markup-style h1:last-child,
@@ -382,7 +366,7 @@ function scrollToBlock(uuid) {
382
366
  .bk .bk-diff-markup-style h6:last-child {
383
367
  margin-bottom: 0px;
384
368
  }
385
- .bk .bk-diff-markup-style h1,
369
+ .bk .bk-diff-markup-style h1,
386
370
  .bk .bk-diff-markup-style h2,
387
371
  .bk .bk-diff-markup-style h3,
388
372
  .bk .bk-diff-markup-style h4,
@@ -390,65 +374,65 @@ function scrollToBlock(uuid) {
390
374
  .bk .bk-diff-markup-style h6 {
391
375
  line-height: 1.25;
392
376
  }
393
- .bk .bk-diff-markup-style p,
377
+ .bk .bk-diff-markup-style p,
394
378
  .bk .bk-diff-markup-style ul,
395
379
  .bk .bk-diff-markup-style ol {
396
380
  line-height: 1.5;
397
381
  }
398
- .bk .bk-diff-markup-style h2 {
382
+ .bk .bk-diff-markup-style h2 {
399
383
  font-size: 1.7em;
400
384
  font-weight: 700;
401
385
  }
402
- .bk .bk-diff-markup-style h3 {
386
+ .bk .bk-diff-markup-style h3 {
403
387
  font-size: 1.5em;
404
388
  font-weight: 700;
405
389
  }
406
- .bk .bk-diff-markup-style h4 {
390
+ .bk .bk-diff-markup-style h4 {
407
391
  font-size: 1.3em;
408
392
  font-weight: 700;
409
393
  }
410
- .bk .bk-diff-markup-style ul {
394
+ .bk .bk-diff-markup-style ul {
411
395
  margin-left: 18px;
412
396
  list-style-type: disc;
413
397
  }
414
- .bk .bk-diff-markup-style ol {
398
+ .bk .bk-diff-markup-style ol {
415
399
  margin-left: 30px;
416
400
  list-style-type: decimal;
417
401
  }
418
- .bk .bk-diff-markup-style a {
402
+ .bk .bk-diff-markup-style a {
419
403
  --bk-tw-text-opacity: 1;
420
404
  color: rgb(var(--bk-theme-accent-700) / var(--bk-tw-text-opacity, 1));
421
405
  text-decoration-line: underline;
422
406
  }
423
- .bk .bk-diff-markup-style blockquote {
407
+ .bk .bk-diff-markup-style blockquote {
424
408
  border-left-width: 6px;
425
409
  --bk-tw-border-opacity: 1;
426
410
  border-left-color: rgb(var(--bk-theme-mono-300) / var(--bk-tw-border-opacity, 1));
427
411
  padding-left: 20px;
428
412
  }
429
- .bk .bk-diff-markup-style pre {
413
+ .bk .bk-diff-markup-style pre {
430
414
  width: 100%;
431
415
  max-width: 100%;
432
416
  white-space: break-spaces;
433
417
  overflow-wrap: break-word;
434
418
  word-break: break-all;
435
419
  }
436
- .bk .bk-diff-value {
420
+ .bk .bk-diff-value {
437
421
  display: inline;
438
422
  word-break: break-word;
439
423
  }
440
- .bk .bk-diff-value .bk-is-clipped del {
424
+ .bk .bk-diff-value .bk-is-clipped del {
441
425
  overflow: hidden;
442
426
  display: -webkit-box;
443
427
  -webkit-box-orient: vertical;
444
428
  -webkit-line-clamp: 4;
445
429
  }
446
- .bk .bk-diff-value del {
430
+ .bk .bk-diff-value del {
447
431
  --bk-tw-text-opacity: 1;
448
432
  color: rgb(var(--bk-theme-mono-500) / var(--bk-tw-text-opacity, 1));
449
433
  text-decoration-line: line-through;
450
434
  }
451
- .bk .bk-diff-value del:has(img) {
435
+ .bk .bk-diff-value del:has(img) {
452
436
  display: block;
453
437
  max-width: 300px;
454
438
  overflow: hidden;
@@ -458,10 +442,10 @@ function scrollToBlock(uuid) {
458
442
  --bk-tw-border-opacity: 1;
459
443
  border-color: rgb(var(--bk-theme-red-normal) / var(--bk-tw-border-opacity, 1));
460
444
  }
461
- .bk .bk-diff-value del:has(img) img {
445
+ .bk .bk-diff-value del:has(img) img {
462
446
  opacity: 0.7;
463
447
  }
464
- .bk .bk-diff-value ins {
448
+ .bk .bk-diff-value ins {
465
449
  border-radius: 4px;
466
450
  border-width: 1px;
467
451
  border-color: rgb(var(--bk-theme-lime-normal) / 0.3);
@@ -471,7 +455,7 @@ function scrollToBlock(uuid) {
471
455
  color: rgb(var(--bk-theme-lime-dark) / var(--bk-tw-text-opacity, 1));
472
456
  text-decoration-line: none;
473
457
  }
474
- .bk .bk-diff-value ins:has(img) {
458
+ .bk .bk-diff-value ins:has(img) {
475
459
  border-width: 2px;
476
460
  --bk-tw-border-opacity: 1;
477
461
  border-color: rgb(var(--bk-theme-lime-normal) / var(--bk-tw-border-opacity, 1));
@@ -479,19 +463,19 @@ function scrollToBlock(uuid) {
479
463
  max-width: 300px;
480
464
  overflow: hidden;
481
465
  }
482
- .bk .bk-diff-value del:has(img) + ins:has(img) {
466
+ .bk .bk-diff-value del:has(img) + ins:has(img) {
483
467
  margin-top: 15px;
484
468
  }
485
- .bk .bk-diff-prop-side-by-side {
469
+ .bk .bk-diff-prop-side-by-side {
486
470
  display: grid;
487
471
  gap: 10px;
488
472
  }
489
- @container (min-width: 700px) {
490
- .bk .bk-diff-prop-side-by-side {
473
+ @container (min-width: 700px) {
474
+ .bk .bk-diff-prop-side-by-side {
491
475
  grid-template-columns: repeat(2, minmax(0, 1fr));
492
476
  }
493
477
  }
494
- .bk .bk-diff-prop-side-by-side .bk-diff-prop-before,
478
+ .bk .bk-diff-prop-side-by-side .bk-diff-prop-before,
495
479
  .bk .bk-diff-prop-side-by-side .bk-diff-prop-after {
496
480
  border-radius: 4px;
497
481
  border-width: 1px;
@@ -499,21 +483,21 @@ function scrollToBlock(uuid) {
499
483
  border-color: rgb(var(--bk-theme-mono-300) / var(--bk-tw-border-opacity, 1));
500
484
  padding: 10px;
501
485
  }
502
- .bk .bk-diff-prop-side-by-side .bk-diff-prop-before {
486
+ .bk .bk-diff-prop-side-by-side .bk-diff-prop-before {
503
487
  background-color: rgb(var(--bk-theme-red-light) / 0.2);
504
488
  }
505
- .bk .bk-diff-prop-side-by-side .bk-diff-prop-before .bk-diff-prop-label {
489
+ .bk .bk-diff-prop-side-by-side .bk-diff-prop-before .bk-diff-prop-label {
506
490
  --bk-tw-text-opacity: 1;
507
491
  color: rgb(var(--bk-theme-red-normal) / var(--bk-tw-text-opacity, 1));
508
492
  }
509
- .bk .bk-diff-prop-side-by-side .bk-diff-prop-after {
493
+ .bk .bk-diff-prop-side-by-side .bk-diff-prop-after {
510
494
  background-color: rgb(var(--bk-theme-lime-light) / 0.2);
511
495
  }
512
- .bk .bk-diff-prop-side-by-side .bk-diff-prop-after .bk-diff-prop-label {
496
+ .bk .bk-diff-prop-side-by-side .bk-diff-prop-after .bk-diff-prop-label {
513
497
  --bk-tw-text-opacity: 1;
514
498
  color: rgb(var(--bk-theme-lime-normal) / var(--bk-tw-text-opacity, 1));
515
499
  }
516
- .bk .bk-diff-prop-side-by-side .bk-diff-prop-label {
500
+ .bk .bk-diff-prop-side-by-side .bk-diff-prop-label {
517
501
  margin-bottom: 5px;
518
502
  font-size: 12px;
519
503
  line-height: 16px;
@@ -523,10 +507,10 @@ function scrollToBlock(uuid) {
523
507
  --bk-tw-text-opacity: 1;
524
508
  color: rgb(var(--bk-theme-mono-500) / var(--bk-tw-text-opacity, 1));
525
509
  }
526
- .bk .bk-diff-prop-side-by-side .bk-diff-prop-content {
510
+ .bk .bk-diff-prop-side-by-side .bk-diff-prop-content {
527
511
  word-break: break-word;
528
512
  }
529
- .bk .bk-diff-prop-after-only .bk-diff-prop-content {
513
+ .bk .bk-diff-prop-after-only .bk-diff-prop-content {
530
514
  border-radius: 4px;
531
515
  border-width: 1px;
532
516
  border-color: rgb(var(--bk-theme-lime-normal) / 0.3);
@@ -534,7 +518,7 @@ function scrollToBlock(uuid) {
534
518
  padding: 10px;
535
519
  word-break: break-word;
536
520
  }
537
- .bk .bk-diff-status-label {
521
+ .bk .bk-diff-status-label {
538
522
  display: inline-block;
539
523
  --bk-tw-translate-y: -3px;
540
524
  transform: translate(var(--bk-tw-translate-x), var(--bk-tw-translate-y)) rotate(var(--bk-tw-rotate)) skewX(var(--bk-tw-skew-x)) skewY(var(--bk-tw-skew-y)) scaleX(var(--bk-tw-scale-x)) scaleY(var(--bk-tw-scale-y));
@@ -553,13 +537,13 @@ function scrollToBlock(uuid) {
553
537
  --bk-tw-text-opacity: 1;
554
538
  color: rgb(var(--bk-theme-mono-500) / var(--bk-tw-text-opacity, 1));
555
539
  }
556
- .bk .bk-diff-status-label.bk-is-added {
540
+ .bk .bk-diff-status-label.bk-is-added {
557
541
  --bk-tw-bg-opacity: 1;
558
542
  background-color: rgb(var(--bk-theme-lime-normal) / var(--bk-tw-bg-opacity, 1));
559
543
  --bk-tw-text-opacity: 1;
560
544
  color: rgb(255 255 255 / var(--bk-tw-text-opacity, 1));
561
545
  }
562
- .bk .bk-diff-status-label.bk-is-removed {
546
+ .bk .bk-diff-status-label.bk-is-removed {
563
547
  --bk-tw-bg-opacity: 1;
564
548
  background-color: rgb(var(--bk-theme-red-normal) / var(--bk-tw-bg-opacity, 1));
565
549
  --bk-tw-text-opacity: 1;
@@ -453,7 +453,7 @@ onUnmounted(() => {
453
453
  <style>
454
454
  .bk.bk-viewport {
455
455
  position: relative;
456
- grid-area: viewport;
456
+ grid-area: viewport
457
457
  }
458
458
 
459
459
  .bk-vars.bk-main-layout {
@@ -466,15 +466,35 @@ onUnmounted(() => {
466
466
  height: 100vh;
467
467
  width: 100vw;
468
468
 
469
+ --bk-toolbar-height: 40px;
470
+
469
471
  grid-template-areas:
470
- 'toolbar toolbar toolbar toolbar toolbar right'
471
- 'left mode mode mode sidebar-right right'
472
- 'left sidebar-left viewport scrollbar-y sidebar-right right'
473
- 'left sidebar-left banner scrollbar-y sidebar-right right'
474
- 'left breadcrumbs breadcrumbs breadcrumbs sidebar-right right';
475
- grid-template-columns: auto auto 1fr 16px auto 50px;
476
- grid-template-rows: 50px auto 1fr auto auto;
472
+ 'toolbar toolbar toolbar toolbar '
473
+ 'left right right right '
474
+ 'left mode mode mode '
475
+ 'left sidebar-left viewport scrollbar-y '
476
+ 'left sidebar-left banner scrollbar-y '
477
+ 'left breadcrumbs breadcrumbs breadcrumbs ';
478
+ grid-template-columns: auto auto 1fr 16px;
479
+ grid-template-rows: var(--bk-toolbar-height) auto auto 1fr auto auto
480
+ }
481
+
482
+ @media (min-width: 768px) {
483
+
484
+ .bk-vars.bk-main-layout {
485
+ --bk-toolbar-height: 50px;
486
+
487
+ grid-template-areas:
488
+ 'toolbar toolbar toolbar toolbar toolbar right'
489
+ 'left mode mode mode sidebar-right right'
490
+ 'left sidebar-left viewport scrollbar-y sidebar-right right'
491
+ 'left sidebar-left banner scrollbar-y sidebar-right right'
492
+ 'left breadcrumbs breadcrumbs breadcrumbs sidebar-right right';
493
+
494
+ grid-template-columns: auto auto 1fr 16px auto minmax(0, 50px);
495
+ grid-template-rows: var(--bk-toolbar-height) auto 1fr auto auto
477
496
  }
497
+ }
478
498
 
479
499
  .bk.bk-canvas-overlay {
480
500
  position: fixed;
@@ -482,11 +502,11 @@ onUnmounted(() => {
482
502
  left: 0px;
483
503
  z-index: calc(var(--bk-z-index-base) + 10000) /* "canvas-overlay" */;
484
504
  width: 100%;
485
- height: 100%;
505
+ height: 100%
486
506
  }
487
507
 
488
508
  html.bk-isolate-provider [data-provider-uuid]:not([data-blokkli-provider-active='true']) {
489
- display: none !important;
509
+ display: none !important
490
510
  }
491
511
 
492
512
  html.bk-html-root:not(.bk-use-animations) *,
@@ -23,7 +23,10 @@ import {
23
23
  import broadcastProvider from "#blokkli/editor/providers/broadcast";
24
24
  import { getFieldKey } from "#blokkli/helpers";
25
25
  import { intersects } from "#blokkli/editor/helpers/geometry";
26
- import { eventBus, frameEventBus } from "#blokkli/editor/events";
26
+ import {
27
+ eventBus,
28
+ frameEventBus
29
+ } from "#blokkli/editor/events";
27
30
  import definitionProvider from "#blokkli/editor/providers/definition";
28
31
  import { addElementClasses } from "#blokkli/editor/composables";
29
32
  const props = defineProps({
@@ -59,11 +62,11 @@ const mutatedEntity = computed(
59
62
  const { data, refresh, error } = await useAsyncData(
60
63
  () => adapter.loadState().then((v) => adapter.mapState(v))
61
64
  );
62
- function updateMutatedFields(fields) {
65
+ function onUpdatePreviewState(e) {
63
66
  const existingKeys = Object.keys(mutatedFieldsMap);
64
67
  const newKeys = /* @__PURE__ */ new Set();
65
- for (let i = 0; i < fields.length; i++) {
66
- const field = fields[i];
68
+ for (let i = 0; i < e.fields.length; i++) {
69
+ const field = e.fields[i];
67
70
  const key = getFieldKey(field.entityUuid, field.name);
68
71
  mutatedFieldsMap[key] = field;
69
72
  newKeys.add(key);
@@ -74,11 +77,14 @@ function updateMutatedFields(fields) {
74
77
  mutatedFieldsMap[key] = void 0;
75
78
  }
76
79
  }
80
+ mutatedEntityFromState.value = e.mutatedEntity;
77
81
  }
78
82
  const updateState = () => {
79
83
  const fields = data.value?.mutatedState?.fields || [];
80
- updateMutatedFields(fields);
81
- mutatedEntityFromState.value = data.value?.mutatedEntity;
84
+ onUpdatePreviewState({
85
+ fields,
86
+ mutatedEntity: data.value?.mutatedEntity || {}
87
+ });
82
88
  const options = mutatedOptions.value || data.value?.mutatedState?.mutatedOptions || {};
83
89
  const optionKeys = Object.keys(options);
84
90
  for (let i = 0; i < optionKeys.length; i++) {
@@ -167,7 +173,7 @@ addElementClasses(document.body, "bk-body-preview");
167
173
  addElementClasses(document.documentElement, "bk-html-preview");
168
174
  onMounted(() => {
169
175
  if (isInIframe()) {
170
- frameEventBus.on("mutatedFields", updateMutatedFields);
176
+ frameEventBus.on("updatePreviewState", onUpdatePreviewState);
171
177
  frameEventBus.on("focus", onFocusItem);
172
178
  frameEventBus.on("updateOption", onUpdateOption);
173
179
  window.addEventListener("message", onMessage);
@@ -185,7 +191,7 @@ onBeforeUnmount(() => {
185
191
  window.removeEventListener("wheel", onWheel);
186
192
  window.removeEventListener("message", onMessage);
187
193
  document.documentElement.removeEventListener("mousedown", onMouseDown);
188
- frameEventBus.off("mutatedFields", updateMutatedFields);
194
+ frameEventBus.off("updatePreviewState", onUpdatePreviewState);
189
195
  frameEventBus.off("focus", onFocusItem);
190
196
  frameEventBus.off("updateOption", onUpdateOption);
191
197
  });