@juo/blocks 1.7.0 → 1.8.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 (44) hide show
  1. package/dist/{ExtensionRoot-sq31lwIQ.js → ExtensionRoot-BmfKKpcU.js} +3 -2
  2. package/dist/{theme-state-D3w_B6gQ.js → block-C8lPBCF8.js} +46 -209
  3. package/dist/block.d.ts +43 -1
  4. package/dist/block.d.ts.map +1 -1
  5. package/dist/{bridge-DAUIcGuq.js → bridge-BOcO9toS.js} +48 -25
  6. package/dist/core.js +96 -25
  7. package/dist/editor/bridge.d.ts.map +1 -1
  8. package/dist/editor/components.d.ts +12 -0
  9. package/dist/editor/components.d.ts.map +1 -1
  10. package/dist/editor/messages.d.ts +35 -3
  11. package/dist/editor/messages.d.ts.map +1 -1
  12. package/dist/editor.js +424 -36
  13. package/dist/flows/WorkflowService.d.ts.map +1 -1
  14. package/dist/{juo-workflow-BVrh5lpE.js → juo-workflow-B3OHYsp-.js} +7 -5
  15. package/dist/main.d.ts +1 -1
  16. package/dist/main.d.ts.map +1 -1
  17. package/dist/preact/block.d.ts.map +1 -1
  18. package/dist/preact.js +4 -2
  19. package/dist/react/block.d.ts.map +1 -1
  20. package/dist/react.js +4 -2
  21. package/dist/services/subscription/adapter.d.ts +21 -3
  22. package/dist/services/subscription/adapter.d.ts.map +1 -1
  23. package/dist/services/subscription/discountErrors.d.ts +27 -0
  24. package/dist/services/subscription/discountErrors.d.ts.map +1 -0
  25. package/dist/services/subscription/index.d.ts +2 -1
  26. package/dist/services/subscription/index.d.ts.map +1 -1
  27. package/dist/services/subscription/subscriptionService.d.ts.map +1 -1
  28. package/dist/services/subscription/subscriptionService.test.d.ts +2 -0
  29. package/dist/services/subscription/subscriptionService.test.d.ts.map +1 -0
  30. package/dist/services/subscription/types.d.ts +11 -3
  31. package/dist/services/subscription/types.d.ts.map +1 -1
  32. package/dist/theme-state-LZS5T-Xb.js +202 -0
  33. package/dist/vue/block.d.ts +2 -1
  34. package/dist/vue/block.d.ts.map +1 -1
  35. package/dist/vue/setupTests.d.ts +2 -0
  36. package/dist/vue/setupTests.d.ts.map +1 -0
  37. package/dist/vue.js +7 -2
  38. package/dist/web-components/editor/InlineText.d.ts +2 -0
  39. package/dist/web-components/editor/InlineText.d.ts.map +1 -1
  40. package/dist/web-components/editor/InlineText.test.d.ts +2 -0
  41. package/dist/web-components/editor/InlineText.test.d.ts.map +1 -0
  42. package/dist/web-components-editor.js +16 -5
  43. package/dist/web-components-runtime.js +3 -3
  44. package/package.json +1 -1
package/dist/editor.js CHANGED
@@ -2,9 +2,10 @@ var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
4
  import { onRegisterBlock, getDefinedBlocks } from "@juo/blocks";
5
- import { a as createEditorBridge, f as createRemoveBlockMessage, g as createRegisterBlocksMessage, h as createRegisterRoutesMessage } from "./bridge-DAUIcGuq.js";
6
- import { i, b, j, k, l, m, n, c, o, p, q, r, s, e, t, u, v, w, d, x, y, z, A } from "./bridge-DAUIcGuq.js";
7
- import { g as createBlockInstanceFromObject, n as indexOverrides } from "./theme-state-D3w_B6gQ.js";
5
+ import { a as createEditorBridge, f as createOpenAddBlockMenuMessage, g as createRemoveBlockMessage, h as createRegisterBlocksMessage, i as createRegisterRoutesMessage } from "./bridge-BOcO9toS.js";
6
+ import { j, k, b, l, m, n, o, p, c, q, r, s, t, u, e, v, w, x, y, d, z, A, B, C } from "./bridge-BOcO9toS.js";
7
+ import { h as createBlockInstanceFromObject } from "./block-C8lPBCF8.js";
8
+ import { i as indexOverrides } from "./theme-state-LZS5T-Xb.js";
8
9
  function createEditorHandler(options) {
9
10
  const { themeState, onBlockSelection } = options;
10
11
  const blockSurfaceIndex = /* @__PURE__ */ new Map();
@@ -127,17 +128,17 @@ function createEditorHandler(options) {
127
128
  if (location.type === "before" || location.type === "after") {
128
129
  let findAndInsertBlock = function(blocks, targetId, newBlock2, position) {
129
130
  var _a2;
130
- for (let i2 = 0; i2 < blocks.length; i2++) {
131
- if (blocks[i2].id === targetId) {
131
+ for (let i = 0; i < blocks.length; i++) {
132
+ if (blocks[i].id === targetId) {
132
133
  if (position === "before") {
133
- blocks.splice(i2, 0, newBlock2);
134
+ blocks.splice(i, 0, newBlock2);
134
135
  } else {
135
- blocks.splice(i2 + 1, 0, newBlock2);
136
+ blocks.splice(i + 1, 0, newBlock2);
136
137
  }
137
138
  return true;
138
139
  }
139
- for (const slotKey of Object.keys(blocks[i2].slots || {})) {
140
- const slotBlocks = blocks[i2].slots[slotKey];
140
+ for (const slotKey of Object.keys(blocks[i].slots || {})) {
141
+ const slotBlocks = blocks[i].slots[slotKey];
141
142
  const slotArray = Array.isArray(slotBlocks) ? slotBlocks : [slotBlocks];
142
143
  for (let j2 = 0; j2 < slotArray.length; j2++) {
143
144
  if (typeof slotArray[j2] !== "string" && ((_a2 = slotArray[j2]) == null ? void 0 : _a2.id) === targetId) {
@@ -146,7 +147,7 @@ function createEditorHandler(options) {
146
147
  } else {
147
148
  slotArray.splice(j2 + 1, 0, newBlock2);
148
149
  }
149
- blocks[i2].slots[slotKey] = slotArray;
150
+ blocks[i].slots[slotKey] = slotArray;
150
151
  return true;
151
152
  }
152
153
  }
@@ -200,21 +201,21 @@ function createEditorHandler(options) {
200
201
  } else if (message.type === "REMOVE_BLOCK") {
201
202
  let findAndRemoveBlock = function(blocks, blockId, slot, parentId) {
202
203
  var _a2;
203
- for (let i2 = 0; i2 < blocks.length; i2++) {
204
- if (blocks[i2].id === parentId && ((_a2 = blocks[i2].slots) == null ? void 0 : _a2[slot])) {
205
- const slotBlocks = blocks[i2].slots[slot];
204
+ for (let i = 0; i < blocks.length; i++) {
205
+ if (blocks[i].id === parentId && ((_a2 = blocks[i].slots) == null ? void 0 : _a2[slot])) {
206
+ const slotBlocks = blocks[i].slots[slot];
206
207
  const slotArray = Array.isArray(slotBlocks) ? slotBlocks : [slotBlocks];
207
208
  const index = slotArray.findIndex(
208
209
  (b2) => typeof b2 !== "string" && (b2 == null ? void 0 : b2.id) === blockId
209
210
  );
210
211
  if (index !== -1) {
211
212
  slotArray.splice(index, 1);
212
- blocks[i2].slots[slot] = slotArray;
213
+ blocks[i].slots[slot] = slotArray;
213
214
  return true;
214
215
  }
215
216
  }
216
- for (const slotKey of Object.keys(blocks[i2].slots || {})) {
217
- const slotBlocks = blocks[i2].slots[slotKey];
217
+ for (const slotKey of Object.keys(blocks[i].slots || {})) {
218
+ const slotBlocks = blocks[i].slots[slotKey];
218
219
  const slotArray = Array.isArray(slotBlocks) ? slotBlocks : [slotBlocks];
219
220
  for (const child of slotArray) {
220
221
  if (typeof child !== "string" && (child == null ? void 0 : child.id)) {
@@ -517,6 +518,262 @@ const styles = `
517
518
  background: #e9e9e9;
518
519
  flex-shrink: 0;
519
520
  }
521
+
522
+ /*
523
+ * Add-block UI — full-width rail (absolute, inset of .block-wrapper) so
524
+ * spill line widths use 50% of the block without container-type / cqw
525
+ * (which breaks flex layout in workflow overlays). Each chrome edge is an
526
+ * .add-edge row; the button and ::before/::after spills live on that edge.
527
+ *
528
+ * Chrome extends 44px above and 12px below the block content:
529
+ * .add-edge--top → top: -44px
530
+ * .add-edge--bottom → bottom: -12px
531
+ */
532
+ .block-wrapper__add-rail {
533
+ position: absolute;
534
+ left: 0;
535
+ right: 0;
536
+ top: 0;
537
+ bottom: 0;
538
+ pointer-events: none;
539
+ z-index: 103;
540
+ }
541
+
542
+ .block-wrapper__add-edge {
543
+ position: absolute;
544
+ left: 0;
545
+ right: 0;
546
+ height: 0;
547
+ pointer-events: none;
548
+ }
549
+
550
+ .block-wrapper__add-edge--top {
551
+ top: -44px;
552
+ }
553
+
554
+ .block-wrapper__add-edge--bottom {
555
+ bottom: -12px;
556
+ }
557
+
558
+ .block-wrapper__add-btn {
559
+ position: absolute;
560
+ left: 50%;
561
+ display: inline-flex;
562
+ align-items: center;
563
+ justify-content: center;
564
+ /* Above ::before/::after spills on the same .add-edge */
565
+ z-index: 1;
566
+ pointer-events: none;
567
+ appearance: none;
568
+ border: none;
569
+ background: none;
570
+ padding: 0;
571
+ margin: 0;
572
+ cursor: pointer;
573
+ /* Larger hit target than the 14×14 icon (lines are pointer-events: none). */
574
+ min-width: 28px;
575
+ min-height: 28px;
576
+ overflow: visible;
577
+ line-height: 1;
578
+ font-family: inherit;
579
+ opacity: 0;
580
+ transition: opacity 180ms ease;
581
+ }
582
+
583
+ .block-wrapper__add-btn--top {
584
+ top: 0;
585
+ transform: translate(-50%, -50%);
586
+ }
587
+
588
+ .block-wrapper__add-btn--bottom {
589
+ bottom: 0;
590
+ top: auto;
591
+ transform: translate(-50%, 50%);
592
+ }
593
+
594
+ /* B — active chrome hovered: fade buttons in (opacity only). */
595
+ :host(.active:hover) .block-wrapper__add-btn {
596
+ opacity: 1;
597
+ pointer-events: auto;
598
+ }
599
+
600
+ /*
601
+ * Entering the chrome from outside often lands on the button at once — skip
602
+ * the fade so only the + → pill morph runs (avoids end-of-animation snap).
603
+ */
604
+ :host(.active:hover)
605
+ .block-wrapper__add-edge:has(.block-wrapper__add-btn:hover)
606
+ .block-wrapper__add-btn,
607
+ :host(.active)
608
+ .block-wrapper__add-edge:has(.block-wrapper__add-btn--menu-open)
609
+ .block-wrapper__add-btn {
610
+ transition: opacity 0s;
611
+ }
612
+
613
+ .block-wrapper__add-btn-inner {
614
+ position: relative;
615
+ z-index: 1;
616
+ display: inline-flex;
617
+ align-items: center;
618
+ justify-content: center;
619
+ height: 14px;
620
+ overflow: visible;
621
+ }
622
+
623
+ /*
624
+ * Single surface morphs 14×14 circle → 60×14 pill (plus scales away, text
625
+ * fades in). No overlapping icon + label layers.
626
+ */
627
+ .block-wrapper__add-btn-surface {
628
+ position: relative;
629
+ display: inline-flex;
630
+ align-items: center;
631
+ justify-content: center;
632
+ box-sizing: border-box;
633
+ width: 14px;
634
+ height: 14px;
635
+ padding: 0;
636
+ background: #121212;
637
+ border: 0.5px solid #121212;
638
+ border-radius: 50%;
639
+ overflow: visible;
640
+ isolation: isolate;
641
+ transition:
642
+ width 200ms cubic-bezier(0.34, 1.12, 0.64, 1),
643
+ border-radius 200ms cubic-bezier(0.34, 1.12, 0.64, 1),
644
+ padding 200ms cubic-bezier(0.34, 1.12, 0.64, 1);
645
+ }
646
+
647
+ .block-wrapper__add-btn-plus {
648
+ display: inline-flex;
649
+ flex-shrink: 0;
650
+ align-items: center;
651
+ justify-content: center;
652
+ width: 14px;
653
+ height: 14px;
654
+ transition:
655
+ opacity 160ms ease,
656
+ transform 200ms cubic-bezier(0.34, 1.12, 0.64, 1),
657
+ width 200ms cubic-bezier(0.34, 1.12, 0.64, 1);
658
+ }
659
+
660
+ .block-wrapper__add-btn-plus svg {
661
+ display: block;
662
+ filter: drop-shadow(0 0 7px rgba(0, 0, 0, 0.1));
663
+ }
664
+
665
+ .block-wrapper__add-btn-text {
666
+ max-width: 0;
667
+ opacity: 0;
668
+ overflow: hidden;
669
+ color: #ffffff;
670
+ font-size: 9px;
671
+ font-weight: 600;
672
+ letter-spacing: -0.036px;
673
+ line-height: 1;
674
+ white-space: nowrap;
675
+ transition:
676
+ max-width 200ms cubic-bezier(0.34, 1.12, 0.64, 1) 35ms,
677
+ opacity 140ms ease 70ms;
678
+ }
679
+
680
+ /*
681
+ * 0.5px spill on the chrome border — ::before/::after meet at 50% (no gap
682
+ * for the pill) so the line stays continuous when the button fades out.
683
+ * The button paints above (z-index). Vertical: fixed translateY (never
684
+ * transitioned). Horizontal: width 0 → full (not scale — Safari thickens /
685
+ * shifts 0.5px lines when scale is composited with translateY on transform).
686
+ */
687
+ .block-wrapper__add-edge::before,
688
+ .block-wrapper__add-edge::after {
689
+ content: "";
690
+ position: absolute;
691
+ top: 50%;
692
+ width: 0;
693
+ min-width: 0;
694
+ height: 0.5px;
695
+ pointer-events: none;
696
+ z-index: 0;
697
+ overflow: hidden;
698
+ transition-property: width;
699
+ transition-duration: 260ms;
700
+ transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
701
+ transition-delay: 50ms;
702
+ }
703
+
704
+ .block-wrapper__add-edge::before {
705
+ right: 50%;
706
+ background: linear-gradient(to left, #121212 0%, #b5b5b5 100%);
707
+ }
708
+
709
+ .block-wrapper__add-edge::after {
710
+ left: 50%;
711
+ background: linear-gradient(to right, #121212 0%, #b5b5b5 100%);
712
+ }
713
+
714
+ .block-wrapper__add-edge--top::before,
715
+ .block-wrapper__add-edge--top::after {
716
+ transform: translateY(calc(-50% + 0.25px));
717
+ }
718
+
719
+ .block-wrapper__add-edge--bottom::before,
720
+ .block-wrapper__add-edge--bottom::after {
721
+ transform: translateY(calc(-50% - 0.25px));
722
+ }
723
+
724
+ /* C — hover / menu-open: morph + spill extend */
725
+ :host(.active:hover) .block-wrapper__add-btn:hover .block-wrapper__add-btn-surface,
726
+ :host(.active) .block-wrapper__add-btn--menu-open .block-wrapper__add-btn-surface {
727
+ width: 60px;
728
+ border-radius: 32px;
729
+ padding: 0 6px;
730
+ }
731
+
732
+ :host(.active:hover) .block-wrapper__add-btn:hover .block-wrapper__add-btn-plus,
733
+ :host(.active) .block-wrapper__add-btn--menu-open .block-wrapper__add-btn-plus {
734
+ width: 0;
735
+ opacity: 0;
736
+ transform: scale(0.35);
737
+ }
738
+
739
+ :host(.active:hover) .block-wrapper__add-btn:hover .block-wrapper__add-btn-text,
740
+ :host(.active) .block-wrapper__add-btn--menu-open .block-wrapper__add-btn-text {
741
+ max-width: 52px;
742
+ opacity: 1;
743
+ }
744
+
745
+ :host(.active:hover) .block-wrapper__add-edge:has(.block-wrapper__add-btn:hover)::before,
746
+ :host(.active:hover) .block-wrapper__add-edge:has(.block-wrapper__add-btn:hover)::after,
747
+ :host(.active) .block-wrapper__add-edge:has(.block-wrapper__add-btn--menu-open)::before,
748
+ :host(.active) .block-wrapper__add-edge:has(.block-wrapper__add-btn--menu-open)::after {
749
+ width: calc(50% - 24px);
750
+ min-width: 40px;
751
+ }
752
+
753
+ /*
754
+ * --menu-open keeps the button in pill state while the editor's AddMenu
755
+ * is open against this button — so the user has a visual anchor of
756
+ * where the menu was triggered from. Note: we explicitly do NOT require
757
+ * :host(:hover) here because the user's pointer is over the menu (which
758
+ * lives outside the iframe) once the menu opens, so :host(:hover) has
759
+ * dropped.
760
+ */
761
+ :host(.active) .block-wrapper__add-btn--menu-open {
762
+ opacity: 1;
763
+ pointer-events: auto;
764
+ }
765
+
766
+ @media (prefers-reduced-motion: reduce) {
767
+ .block-wrapper__add-btn,
768
+ .block-wrapper__add-btn-inner,
769
+ .block-wrapper__add-btn-surface,
770
+ .block-wrapper__add-edge::before,
771
+ .block-wrapper__add-edge::after,
772
+ .block-wrapper__add-btn-plus,
773
+ .block-wrapper__add-btn-text {
774
+ transition: none;
775
+ }
776
+ }
520
777
  </style>
521
778
  `;
522
779
  const blockIconSvg = `
@@ -530,6 +787,12 @@ const moreIconSvg = `
530
787
  <path d="M1.5 0C2.32843 2.0934e-07 3 0.671573 3 1.5C3 2.32843 2.32843 3 1.5 3C0.671573 3 3.62117e-08 2.32843 0 1.5C6.04266e-08 0.671573 0.671573 3.62117e-08 1.5 0ZM6.5 0C7.32843 2.0934e-07 8 0.671573 8 1.5C8 2.32843 7.32843 3 6.5 3C5.67157 3 5 2.32843 5 1.5C5 0.671573 5.67157 3.62117e-08 6.5 0ZM11.5 0C12.3284 2.0934e-07 13 0.671573 13 1.5C13 2.32843 12.3284 3 11.5 3C10.6716 3 10 2.32843 10 1.5C10 0.671573 10.6716 3.62117e-08 11.5 0Z" fill="currentColor"/>
531
788
  </svg>
532
789
  `;
790
+ const addBlockIconSvg = `
791
+ <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
792
+ <circle cx="7" cy="7" r="7" fill="#121212"/>
793
+ <path d="M7 4.77V9.23M4.77 7H9.23" stroke="white" stroke-width="1.14" stroke-linecap="round"/>
794
+ </svg>
795
+ `;
533
796
  const trashIconSvg = `
534
797
  <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
535
798
  <path d="M2 4H12" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/>
@@ -549,6 +812,9 @@ class BlockWrapper extends HTMLElement {
549
812
  __publicField(this, "menuElement", null);
550
813
  __publicField(this, "isMenuOpen", false);
551
814
  __publicField(this, "closeMenuOnOutsideClick", null);
815
+ __publicField(this, "emptyObserver", null);
816
+ __publicField(this, "addButtons", []);
817
+ __publicField(this, "addRail", null);
552
818
  this.attachShadow({ mode: "open" });
553
819
  this.setupStyles();
554
820
  this.setupTemplate();
@@ -615,16 +881,91 @@ class BlockWrapper extends HTMLElement {
615
881
  const slot = document.createElement("slot");
616
882
  slotHost.appendChild(slot);
617
883
  wrapper.appendChild(slotHost);
884
+ const addRail = document.createElement("div");
885
+ addRail.className = "block-wrapper__add-rail";
886
+ this.addRail = addRail;
887
+ const topEdge = document.createElement("div");
888
+ topEdge.className = "block-wrapper__add-edge block-wrapper__add-edge--top";
889
+ const topAddBtn = this.createAddButton("before");
890
+ topAddBtn.classList.add("block-wrapper__add-btn--top");
891
+ topEdge.appendChild(topAddBtn);
892
+ addRail.appendChild(topEdge);
893
+ const bottomEdge = document.createElement("div");
894
+ bottomEdge.className = "block-wrapper__add-edge block-wrapper__add-edge--bottom";
895
+ const bottomAddBtn = this.createAddButton("after");
896
+ bottomAddBtn.classList.add("block-wrapper__add-btn--bottom");
897
+ bottomEdge.appendChild(bottomAddBtn);
898
+ addRail.appendChild(bottomEdge);
899
+ wrapper.appendChild(addRail);
900
+ this.addButtons = [topAddBtn, bottomAddBtn];
618
901
  this.shadowRoot.appendChild(wrapper);
619
902
  this.nameElement = nameSpan;
620
903
  this.menuElement = menuEl;
621
904
  this.editorBridge.onMessage((message) => {
622
- var _a;
905
+ var _a, _b;
623
906
  if (message.type === "SELECT_BLOCK") {
624
907
  this.updateActiveState(message.payload.blockId === ((_a = this.block) == null ? void 0 : _a.id));
908
+ } else if (message.type === "ADD_BLOCK_MENU_CLOSED" && message.payload.targetBlockId === ((_b = this.block) == null ? void 0 : _b.id)) {
909
+ this.clearAddButtonMenuState(message.payload.position);
625
910
  }
626
911
  });
627
912
  }
913
+ createAddButton(position) {
914
+ const btn = document.createElement("button");
915
+ btn.type = "button";
916
+ btn.className = "block-wrapper__add-btn";
917
+ btn.setAttribute("aria-label", "Add block");
918
+ btn.dataset.position = position;
919
+ const inner = document.createElement("span");
920
+ inner.className = "block-wrapper__add-btn-inner";
921
+ const surface = document.createElement("span");
922
+ surface.className = "block-wrapper__add-btn-surface";
923
+ const plus = document.createElement("span");
924
+ plus.className = "block-wrapper__add-btn-plus";
925
+ plus.setAttribute("aria-hidden", "true");
926
+ plus.innerHTML = addBlockIconSvg;
927
+ const text = document.createElement("span");
928
+ text.className = "block-wrapper__add-btn-text";
929
+ text.textContent = "Add block";
930
+ surface.appendChild(plus);
931
+ surface.appendChild(text);
932
+ inner.appendChild(surface);
933
+ btn.appendChild(inner);
934
+ btn.addEventListener("click", (e2) => {
935
+ e2.stopPropagation();
936
+ e2.preventDefault();
937
+ this.handleAddBlock(position, btn);
938
+ });
939
+ return btn;
940
+ }
941
+ handleAddBlock(position, button) {
942
+ if (!this.block) return;
943
+ const rect = button.getBoundingClientRect();
944
+ const anchor = {
945
+ x: rect.right,
946
+ // Top edge of the button — menu opens to the right with align=start.
947
+ y: rect.top
948
+ };
949
+ for (const btn of this.addButtons) {
950
+ btn.classList.toggle(
951
+ "block-wrapper__add-btn--menu-open",
952
+ btn === button
953
+ );
954
+ }
955
+ this.editorBridge.sendMessage(
956
+ createOpenAddBlockMenuMessage({
957
+ targetBlockId: this.block.id,
958
+ position,
959
+ anchor
960
+ })
961
+ );
962
+ }
963
+ clearAddButtonMenuState(position) {
964
+ for (const btn of this.addButtons) {
965
+ if (position != null && btn.dataset.position !== position) continue;
966
+ btn.classList.remove("block-wrapper__add-btn--menu-open");
967
+ }
968
+ }
628
969
  connectedCallback() {
629
970
  const isInOverlay = this.closest('juo-extension-root[surface="overlay"]') !== null;
630
971
  if (isInOverlay) {
@@ -636,6 +977,9 @@ class BlockWrapper extends HTMLElement {
636
977
  ".block-wrapper__menu-item--danger"
637
978
  );
638
979
  if (deleteBtn) deleteBtn.style.display = "none";
980
+ if (this.addRail) {
981
+ this.addRail.style.display = "none";
982
+ }
639
983
  }
640
984
  const isWorkflowPreview = (() => {
641
985
  try {
@@ -648,8 +992,50 @@ class BlockWrapper extends HTMLElement {
648
992
  if (isWorkflowPreview && !isInOverlay) {
649
993
  this.style.pointerEvents = "none";
650
994
  }
995
+ this.observeSlotEmptyState();
996
+ }
997
+ /**
998
+ * Mirror `data-empty` from the slotted block wrapper onto this editor
999
+ * wrapper so page-level divider CSS (and live-data preview) treat empty
1000
+ * blocks the same as in view mode.
1001
+ */
1002
+ observeSlotEmptyState() {
1003
+ var _a;
1004
+ (_a = this.emptyObserver) == null ? void 0 : _a.disconnect();
1005
+ const sync = () => {
1006
+ const slotted = this.firstElementChild;
1007
+ const empty = slotted == null || slotted.hasAttribute("data-empty");
1008
+ this.toggleAttribute("data-empty", empty);
1009
+ };
1010
+ const bindObservers = () => {
1011
+ this.emptyObserver.observe(this, { childList: true });
1012
+ const slotted = this.firstElementChild;
1013
+ if (slotted) {
1014
+ this.emptyObserver.observe(slotted, {
1015
+ attributes: true,
1016
+ attributeFilter: ["data-empty"]
1017
+ });
1018
+ }
1019
+ };
1020
+ sync();
1021
+ this.emptyObserver = new MutationObserver((records) => {
1022
+ const slottedChildChanged = records.some(
1023
+ (record) => record.type === "childList" && record.target === this
1024
+ );
1025
+ if (slottedChildChanged) {
1026
+ this.emptyObserver.disconnect();
1027
+ sync();
1028
+ bindObservers();
1029
+ return;
1030
+ }
1031
+ sync();
1032
+ });
1033
+ bindObservers();
651
1034
  }
652
1035
  disconnectedCallback() {
1036
+ var _a;
1037
+ (_a = this.emptyObserver) == null ? void 0 : _a.disconnect();
1038
+ this.emptyObserver = null;
653
1039
  this.closeMenu();
654
1040
  }
655
1041
  toggleMenu() {
@@ -819,33 +1205,35 @@ async function setupEditorMode(deps) {
819
1205
  }
820
1206
  export {
821
1207
  BlockWrapper,
822
- i as createAddBlockMessage,
1208
+ j as createAddBlockMenuClosedMessage,
1209
+ k as createAddBlockMessage,
823
1210
  createEditorBridge,
824
1211
  createEditorHandler,
825
1212
  b as createFocusInlineTextMessage,
826
- j as createMoveBlockMessage,
827
- k as createProvideGlobalStylesMessage,
828
- l as createProvideInitialGlobalStylesMessage,
829
- m as createProvideThemeStateMessage,
830
- n as createProvideTranslationOverridesMessage,
1213
+ l as createMoveBlockMessage,
1214
+ createOpenAddBlockMenuMessage,
1215
+ m as createProvideGlobalStylesMessage,
1216
+ n as createProvideInitialGlobalStylesMessage,
1217
+ o as createProvideThemeStateMessage,
1218
+ p as createProvideTranslationOverridesMessage,
831
1219
  c as createRegisterBlockTranslationKeysMessage,
832
1220
  createRegisterBlocksMessage,
833
1221
  createRegisterRoutesMessage,
834
1222
  createRemoveBlockMessage,
835
- o as createReportContentHeightMessage,
836
- p as createRequestGlobalStylesMessage,
837
- q as createRequestThemeStateMessage,
838
- r as createRequestTranslationOverridesMessage,
839
- s as createScrollSyncMessage,
1223
+ q as createReportContentHeightMessage,
1224
+ r as createRequestGlobalStylesMessage,
1225
+ s as createRequestThemeStateMessage,
1226
+ t as createRequestTranslationOverridesMessage,
1227
+ u as createScrollSyncMessage,
840
1228
  e as createSelectBlockMessage,
841
- t as createSetBlockPresetMessage,
842
- u as createSetGlobalStylesMessage,
843
- v as createSetLocaleMessage,
844
- w as createUpdateBlockPropsMessage,
1229
+ v as createSetBlockPresetMessage,
1230
+ w as createSetGlobalStylesMessage,
1231
+ x as createSetLocaleMessage,
1232
+ y as createUpdateBlockPropsMessage,
845
1233
  d as createUpdateBlockTranslationMessage,
846
- x as createUpsertThemeStateMessage,
847
- y as getEditorBridge,
848
- z as isEditorMessage,
849
- A as isIframeMessage,
1234
+ z as createUpsertThemeStateMessage,
1235
+ A as getEditorBridge,
1236
+ B as isEditorMessage,
1237
+ C as isIframeMessage,
850
1238
  setupEditorMode
851
1239
  };
@@ -1 +1 @@
1
- {"version":3,"file":"WorkflowService.d.ts","sourceRoot":"","sources":["../../src/flows/WorkflowService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAG7E,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAS5C,eAAO,MAAM,sBAAsB;;eAojBd,cAAc,CAAC,aAAa,CAAC;QAE9C;qFAC6E;;;;;;;;;4BAcjE,MAAM,WACP,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,eACnB,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC;8BAyDA,MAAM,iBACL,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACrC,OAAO,CAAC,IAAI,CAAC;kBAgCA,OAAO,CAAC,IAAI,CAAC;iBA4CpB,IAAI;mBAqBI,OAAO,CAAC,IAAI,CAAC;;CAnuBmB,CAAC;AAMtD;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,8EAA8E;IAC9E,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,OAAO,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,kBAAkB,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC3D,WAAW,EAAE,IAAI,CAAC;IAClB,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC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AC5D,UAAU,EAAE,UAAU,CAAC;IACvB,kHAAkH;IAClH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAMD,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,2BAA2B;WA2VlD,cAAc,CAAC,aAAa,CAAC;IAE9C;iFAC6E;;;;;;;;;wBAcjE,MAAM,WACP,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,eACnB,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC;0BAyDA,MAAM,iBACL,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACrC,OAAO,CAAC,IAAI,CAAC;cAgCA,OAAO,CAAC,IAAI,CAAC;aA4CpB,IAAI;eAqBI,OAAO,CAAC,IAAI,CAAC;EAsBjC;AAED,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
@@ -1,8 +1,8 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- import { c as createContext, d, E, m as getDefinedBlocks, e as createBlockInstance, w, r as registerBlock, k as defineBlock, v as subscribeContext } from "./theme-state-D3w_B6gQ.js";
5
- import { a as createEditorBridge, e as createSelectBlockMessage } from "./bridge-DAUIcGuq.js";
4
+ import { c as createContext, d, E, m as getDefinedBlocks, f as createBlockInstance, w, r as registerBlock, k as defineBlock, v as subscribeContext } from "./block-C8lPBCF8.js";
5
+ import { a as createEditorBridge, e as createSelectBlockMessage } from "./bridge-BOcO9toS.js";
6
6
  const TranslationContext = createContext("translation");
7
7
  function toStringRecord(input) {
8
8
  if (input == null) return {};
@@ -179,7 +179,7 @@ function createWorkflowService(deps) {
179
179
  return `wf-${shortenId(workflowId)}-${shortenId(stepId)}`;
180
180
  }
181
181
  function handleFlowResponse(data) {
182
- var _a, _b, _c, _d, _e, _f;
182
+ var _a, _b, _c, _d, _e, _f, _g;
183
183
  const mergedInvalidated = [
184
184
  ..._state.value.invalidatedResources,
185
185
  ...data.invalidatedResources ?? []
@@ -187,6 +187,7 @@ function createWorkflowService(deps) {
187
187
  if (data.status === "waiting_interaction") {
188
188
  const currentStepId = ((_a = data.pendingInteraction) == null ? void 0 : _a.stepId) ?? (isEditorMode ? (_c = (_b = data.interactiveSteps) == null ? void 0 : _b[0]) == null ? void 0 : _c.stepId : null);
189
189
  _backendInteractionId.value = ((_d = data.pendingInteraction) == null ? void 0 : _d.interactionId) ?? null;
190
+ const isInitialResponse = _state.value.runId == null;
190
191
  updateState({
191
192
  status: "active",
192
193
  workflowId: data.workflowId,
@@ -199,9 +200,10 @@ function createWorkflowService(deps) {
199
200
  outcome: null
200
201
  });
201
202
  if (editor.isEditorMode) {
203
+ const displayStepId = isInitialResponse && previewStepId && ((_e = data.interactiveSteps) == null ? void 0 : _e.some((s) => s.stepId === previewStepId)) ? previewStepId : currentStepId;
202
204
  const overlayBlocks = deps.themeState.overlay.blocks.value;
203
205
  const rootBlock = overlayBlocks[0];
204
- const stepSlot = currentStepId ? (_e = rootBlock == null ? void 0 : rootBlock.slots) == null ? void 0 : _e[currentStepId] : null;
206
+ const stepSlot = displayStepId ? (_f = rootBlock == null ? void 0 : rootBlock.slots) == null ? void 0 : _f[displayStepId] : null;
205
207
  const stepBlock = Array.isArray(stepSlot) ? stepSlot[0] : null;
206
208
  const blockId = stepBlock && typeof stepBlock === "object" && "id" in stepBlock ? stepBlock.id : null;
207
209
  if (blockId) {
@@ -224,7 +226,7 @@ function createWorkflowService(deps) {
224
226
  });
225
227
  } else if (data.status === "failed") {
226
228
  _backendInteractionId.value = null;
227
- handleError(new Error(((_f = data.error) == null ? void 0 : _f.message) || "Flow failed"));
229
+ handleError(new Error(((_g = data.error) == null ? void 0 : _g.message) || "Flow failed"));
228
230
  } else if (data.status === "cancelled") {
229
231
  _backendInteractionId.value = null;
230
232
  updateState({
package/dist/main.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export type { Block, BlockInstance, BlockDefinition, BlockLocaleFile, BlockRenderer, BlockPreset, BlockPresets, } from './block';
2
- export { backfillInstanceDefaults, createBlockInstance, createBlockInstanceFromJSON, createBlockInstanceFromObject, createCeRenderer, defineBlock, defineBlockRuntime, getDefinedBlocks, isStubDefinition, withWrapper, registerBlock, SelectedBlockContext, createSelectedBlock, BlockWrapperEvent, serializeBlocks, onRegisterBlock, } from './block';
2
+ export { attachEmptyTracking, backfillInstanceDefaults, createBlockInstance, createBlockInstanceFromJSON, createBlockInstanceFromObject, createCeRenderer, defineBlock, defineBlockRuntime, getDefinedBlocks, hasRenderedContent, isStubDefinition, withWrapper, registerBlock, SelectedBlockContext, createSelectedBlock, BlockWrapperEvent, serializeBlocks, onRegisterBlock, } from './block';
3
3
  export { ThemeStateContext, createThemeState, indexOverrides, type TranslationCatalogs, type TranslationMode, type TranslationScope, type TranslationOverride, type ThemeLocaleState, type ThemeState, type ThemeSurface, type ThemeSurfaceState, type GlobalStyles, type GlobalStyleColors, type ThemeType, DEFAULT_GLOBAL_STYLES, } from './theme-state';
4
4
  export { TranslationContext, createTranslationService, type TranslationServiceOptions, type TranslationService, } from './translation';
5
5
  export { ContextRequestEvent, ContextProvideEvent, type ContextCallback, createContext, injectContext, provideContext, subscribeContext, type ContextType, type UnknownContext, } from './context';
@@ -1 +1 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,KAAK,EACL,aAAa,EACb,eAAe,EACf,eAAe,EACf,aAAa,EACb,WAAW,EACX,YAAY,GACb,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,wBAAwB,EACxB,mBAAmB,EACnB,2BAA2B,EAC3B,6BAA6B,EAC7B,gBAAgB,EAChB,WAAW,EACX,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,eAAe,GAChB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,qBAAqB,GACtB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,GACxB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,KAAK,eAAe,EACpB,aAAa,EACb,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,KAAK,WAAW,EAChB,KAAK,cAAc,GACpB,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEpD,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpE,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AAExB,OAAO,EACL,MAAM,EACN,MAAM,EACN,MAAM,EACN,QAAQ,EACR,SAAS,GACV,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,KAAK,EACL,aAAa,EACb,eAAe,EACf,eAAe,EACf,aAAa,EACb,WAAW,EACX,YAAY,GACb,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,EACnB,2BAA2B,EAC3B,6BAA6B,EAC7B,gBAAgB,EAChB,WAAW,EACX,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,WAAW,EACX,aAAa,EACb,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,eAAe,GAChB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,cAAc,EACd,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,qBAAqB,GACtB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,GACxB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,KAAK,eAAe,EACpB,aAAa,EACb,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,KAAK,WAAW,EAChB,KAAK,cAAc,GACpB,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEpD,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpE,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AAExB,OAAO,EACL,MAAM,EACN,MAAM,EACN,MAAM,EACN,QAAQ,EACR,SAAS,GACV,MAAM,sBAAsB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../src/preact/block.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAqC,KAAK,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE/E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAyBjD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,GAAG,GAAG,EAC1C,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,GAC1B,CAAC,KAAK,EAAE,aAAa,KAAK,WAAW,CAgCvC;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,GAAG,GAAG,EAC5C,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,EAC3B,EAAE,UAAiB,EAAE,GAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAO,GACnD,CAAC,KAAK,EAAE,aAAa,KAAK,WAAW,CAoEvC"}
1
+ {"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../src/preact/block.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAqC,KAAK,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE/E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAyBjD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,GAAG,GAAG,EAC1C,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,GAC1B,CAAC,KAAK,EAAE,aAAa,KAAK,WAAW,CAmCvC;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,GAAG,GAAG,EAC5C,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,aAAa,CAAC,CAAC,CAAC,EAC3B,EAAE,UAAiB,EAAE,GAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAO,GACnD,CAAC,KAAK,EAAE,aAAa,KAAK,WAAW,CAoEvC"}