@juo/blocks 1.7.1 → 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.
@@ -5,7 +5,7 @@ import { signal, effect, createBlockInstance } from "@juo/blocks";
5
5
  import { reportBlockWarning, reportBlockError } from "./observability.js";
6
6
  import { d, v as subscribeContext, E, y as withWrapper, x as n, e as backfillInstanceDefaults, p as isStubDefinition, q as onRegisterBlock } from "./block-C8lPBCF8.js";
7
7
  import { T as ThemeStateContext } from "./theme-state-LZS5T-Xb.js";
8
- import "./juo-workflow-Dqr1lB1k.js";
8
+ import "./juo-workflow-B3OHYsp-.js";
9
9
  class Block extends HTMLElement {
10
10
  constructor() {
11
11
  super();
@@ -1,8 +1,8 @@
1
1
  function isEditorMessage(message) {
2
- return message.type === "PROVIDE_THEME_STATE" || message.type === "PROVIDE_TRANSLATION_OVERRIDES" || message.type === "SELECT_BLOCK" || message.type === "UPDATE_BLOCK_PROPS" || message.type === "ADD_BLOCK" || message.type === "REMOVE_BLOCK" || message.type === "MOVE_BLOCK" || message.type === "SET_BLOCK_PRESET" || message.type === "SET_LOCALE" || message.type === "SET_GLOBAL_STYLES" || message.type === "PROVIDE_GLOBAL_STYLES" || message.type === "SCROLL_SYNC" || message.type === "REQUEST_CONTENT_HEIGHT";
2
+ return message.type === "PROVIDE_THEME_STATE" || message.type === "PROVIDE_TRANSLATION_OVERRIDES" || message.type === "SELECT_BLOCK" || message.type === "UPDATE_BLOCK_PROPS" || message.type === "ADD_BLOCK" || message.type === "REMOVE_BLOCK" || message.type === "MOVE_BLOCK" || message.type === "SET_BLOCK_PRESET" || message.type === "SET_LOCALE" || message.type === "SET_GLOBAL_STYLES" || message.type === "PROVIDE_GLOBAL_STYLES" || message.type === "SCROLL_SYNC" || message.type === "REQUEST_CONTENT_HEIGHT" || message.type === "ADD_BLOCK_MENU_CLOSED";
3
3
  }
4
4
  function isIframeMessage(message) {
5
- return message.type === "SELECT_BLOCK" || message.type === "IFRAME_READY" || message.type === "REGISTER_BLOCKS" || message.type === "REGISTER_ROUTES" || message.type === "REMOVE_BLOCK" || message.type === "UPDATE_BLOCK_PROPS" || message.type === "REQUEST_THEME_STATE" || message.type === "UPSERT_THEME_STATE" || message.type === "REQUEST_TRANSLATION_OVERRIDES" || message.type === "UPDATE_BLOCK_TRANSLATION" || message.type === "REGISTER_BLOCK_TRANSLATION_KEYS" || message.type === "FOCUS_INLINE_TEXT" || message.type === "REQUEST_GLOBAL_STYLES" || message.type === "PROVIDE_INITIAL_GLOBAL_STYLES" || message.type === "REPORT_CONTENT_HEIGHT" || message.type === "SCROLL_SYNC";
5
+ return message.type === "SELECT_BLOCK" || message.type === "IFRAME_READY" || message.type === "REGISTER_BLOCKS" || message.type === "REGISTER_ROUTES" || message.type === "REMOVE_BLOCK" || message.type === "UPDATE_BLOCK_PROPS" || message.type === "REQUEST_THEME_STATE" || message.type === "UPSERT_THEME_STATE" || message.type === "REQUEST_TRANSLATION_OVERRIDES" || message.type === "UPDATE_BLOCK_TRANSLATION" || message.type === "REGISTER_BLOCK_TRANSLATION_KEYS" || message.type === "FOCUS_INLINE_TEXT" || message.type === "REQUEST_GLOBAL_STYLES" || message.type === "PROVIDE_INITIAL_GLOBAL_STYLES" || message.type === "REPORT_CONTENT_HEIGHT" || message.type === "SCROLL_SYNC" || message.type === "OPEN_ADD_BLOCK_MENU";
6
6
  }
7
7
  function createProvideThemeStateMessage(payload) {
8
8
  return {
@@ -182,6 +182,20 @@ function createReportContentHeightMessage(payload) {
182
182
  timestamp: Date.now()
183
183
  };
184
184
  }
185
+ function createOpenAddBlockMenuMessage(payload) {
186
+ return {
187
+ type: "OPEN_ADD_BLOCK_MENU",
188
+ payload,
189
+ timestamp: Date.now()
190
+ };
191
+ }
192
+ function createAddBlockMenuClosedMessage(payload) {
193
+ return {
194
+ type: "ADD_BLOCK_MENU_CLOSED",
195
+ payload,
196
+ timestamp: Date.now()
197
+ };
198
+ }
185
199
  let bridgeInstance = null;
186
200
  function getEditorBridge() {
187
201
  return bridgeInstance;
@@ -243,13 +257,20 @@ function createEditorBridge() {
243
257
  }
244
258
  return false;
245
259
  });
260
+ const isAddBlockButton = path.some((node) => {
261
+ if (!(node instanceof HTMLElement)) return false;
262
+ return node.classList.contains("block-wrapper__add-btn") || node.classList.contains("block-wrapper__add-btn-inner") || node.classList.contains("block-wrapper__add-btn-surface") || node.classList.contains("block-wrapper__add-btn-plus") || node.classList.contains("block-wrapper__add-btn-text");
263
+ });
264
+ if (isAddBlockButton) {
265
+ return;
266
+ }
246
267
  const isEditorUI = path.some((node) => {
247
268
  if (!(node instanceof HTMLElement)) return false;
248
269
  let current = node;
249
270
  const root = node.getRootNode();
250
271
  while (current && current !== root) {
251
272
  const classList = current.classList;
252
- if (classList.contains("block-wrapper__name") || classList.contains("block-wrapper__actions") || classList.contains("block-wrapper__icon") || classList.contains("block-wrapper__remove-icon") || current.hasAttribute("data-block-editor")) {
273
+ if (classList.contains("block-wrapper__name") || classList.contains("block-wrapper__actions") || classList.contains("block-wrapper__icon") || classList.contains("block-wrapper__remove-icon") || classList.contains("block-wrapper__add-btn") || current.hasAttribute("data-block-editor")) {
253
274
  return true;
254
275
  }
255
276
  current = current.parentElement;
@@ -501,31 +522,33 @@ function createEditorBridge() {
501
522
  return bridgeInstance;
502
523
  }
503
524
  export {
504
- isIframeMessage as A,
525
+ getEditorBridge as A,
526
+ isEditorMessage as B,
527
+ isIframeMessage as C,
505
528
  createEditorBridge as a,
506
529
  createFocusInlineTextMessage as b,
507
530
  createRegisterBlockTranslationKeysMessage as c,
508
531
  createUpdateBlockTranslationMessage as d,
509
532
  createSelectBlockMessage as e,
510
- createRemoveBlockMessage as f,
511
- createRegisterBlocksMessage as g,
512
- createRegisterRoutesMessage as h,
513
- createAddBlockMessage as i,
514
- createMoveBlockMessage as j,
515
- createProvideGlobalStylesMessage as k,
516
- createProvideInitialGlobalStylesMessage as l,
517
- createProvideThemeStateMessage as m,
518
- createProvideTranslationOverridesMessage as n,
519
- createReportContentHeightMessage as o,
520
- createRequestGlobalStylesMessage as p,
521
- createRequestThemeStateMessage as q,
522
- createRequestTranslationOverridesMessage as r,
523
- createScrollSyncMessage as s,
524
- createSetBlockPresetMessage as t,
525
- createSetGlobalStylesMessage as u,
526
- createSetLocaleMessage as v,
527
- createUpdateBlockPropsMessage as w,
528
- createUpsertThemeStateMessage as x,
529
- getEditorBridge as y,
530
- isEditorMessage as z
533
+ createOpenAddBlockMenuMessage as f,
534
+ createRemoveBlockMessage as g,
535
+ createRegisterBlocksMessage as h,
536
+ createRegisterRoutesMessage as i,
537
+ createAddBlockMenuClosedMessage as j,
538
+ createAddBlockMessage as k,
539
+ createMoveBlockMessage as l,
540
+ createProvideGlobalStylesMessage as m,
541
+ createProvideInitialGlobalStylesMessage as n,
542
+ createProvideThemeStateMessage as o,
543
+ createProvideTranslationOverridesMessage as p,
544
+ createReportContentHeightMessage as q,
545
+ createRequestGlobalStylesMessage as r,
546
+ createRequestThemeStateMessage as s,
547
+ createRequestTranslationOverridesMessage as t,
548
+ createScrollSyncMessage as u,
549
+ createSetBlockPresetMessage as v,
550
+ createSetGlobalStylesMessage as w,
551
+ createSetLocaleMessage as x,
552
+ createUpdateBlockPropsMessage as y,
553
+ createUpsertThemeStateMessage as z
531
554
  };
package/dist/core.js CHANGED
@@ -4,7 +4,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
4
4
  import { c as createContext, d, w, r as registerBlock, E, u } from "./block-C8lPBCF8.js";
5
5
  import { B, C, a, S, b, e, f, g, h, i, j, k, l, m, n, o, p, q, s, t, v, x, y } from "./block-C8lPBCF8.js";
6
6
  import { D, T, c, i as i2 } from "./theme-state-LZS5T-Xb.js";
7
- import { T as T2, W, c as c2, a as a2, b as b2, g as g2, h as h2 } from "./juo-workflow-Dqr1lB1k.js";
7
+ import { T as T2, W, c as c2, a as a2, b as b2, g as g2, h as h2 } from "./juo-workflow-B3OHYsp-.js";
8
8
  import { reportBlockWarning, reportBlockError } from "./observability.js";
9
9
  function createState() {
10
10
  const discountCode = d(null);
@@ -758,7 +758,7 @@ function createMockRouterService() {
758
758
  }
759
759
  }).routerService;
760
760
  }
761
- function createMockSubscriptionAdapter() {
761
+ function createMockSubscriptionAdapter(options = {}) {
762
762
  const mockSubscriptions = [
763
763
  {
764
764
  id: "sub_1",
@@ -815,19 +815,19 @@ function createMockSubscriptionAdapter() {
815
815
  const subscription = mockSubscriptions.find((sub) => sub.id === id) || null;
816
816
  return { _tag: "Success", data: subscription };
817
817
  },
818
- async search(options = {}) {
818
+ async search(options2 = {}) {
819
819
  await new Promise((resolve) => setTimeout(resolve, 300));
820
820
  const pageSize = 1;
821
821
  const allItems = mockSubscriptions;
822
822
  let startIndex = 0;
823
823
  let endIndex = pageSize;
824
- if (options.pagination) {
825
- if ("after" in options.pagination) {
826
- const cursorIndex = parseInt(options.pagination.after, 10);
824
+ if (options2.pagination) {
825
+ if ("after" in options2.pagination) {
826
+ const cursorIndex = parseInt(options2.pagination.after, 10);
827
827
  startIndex = cursorIndex + 1;
828
828
  endIndex = startIndex + pageSize;
829
- } else if ("before" in options.pagination) {
830
- const cursorIndex = parseInt(options.pagination.before, 10);
829
+ } else if ("before" in options2.pagination) {
830
+ const cursorIndex = parseInt(options2.pagination.before, 10);
831
831
  endIndex = cursorIndex;
832
832
  startIndex = Math.max(0, endIndex - pageSize);
833
833
  }
@@ -858,11 +858,25 @@ function createMockSubscriptionAdapter() {
858
858
  },
859
859
  async addDiscount() {
860
860
  await new Promise((resolve) => setTimeout(resolve, 300));
861
- return { _tag: "Success", data: void 0 };
861
+ const behavior = options.addDiscountBehavior ?? { kind: "success" };
862
+ if (behavior.kind === "success") {
863
+ return { _tag: "Success", data: void 0 };
864
+ }
865
+ if (behavior.kind === "rejected") {
866
+ return {
867
+ _tag: "Failure",
868
+ error: { kind: "REJECTED", reason: behavior.reason }
869
+ };
870
+ }
871
+ return { _tag: "Failure", error: { kind: behavior.error } };
862
872
  },
863
873
  async removeDiscount() {
864
874
  await new Promise((resolve) => setTimeout(resolve, 300));
865
- return { _tag: "Success", data: void 0 };
875
+ const behavior = options.removeDiscountBehavior ?? { kind: "success" };
876
+ if (behavior.kind === "success") {
877
+ return { _tag: "Success", data: void 0 };
878
+ }
879
+ return { _tag: "Failure", error: { kind: behavior.error } };
866
880
  },
867
881
  async reschedule(params) {
868
882
  await new Promise((resolve) => setTimeout(resolve, 300));
@@ -1032,14 +1046,55 @@ function getCurrentSubscriptionId() {
1032
1046
  }
1033
1047
  function createSubscriptionService(adapter) {
1034
1048
  const current = d(null);
1049
+ const discountsChangedAtSignal = d(0);
1050
+ async function refreshAfterDiscountChange(subscriptionId) {
1051
+ const result = await adapter.getById(subscriptionId);
1052
+ if (result._tag === "Success" && result.data != null) {
1053
+ current.value = result.data;
1054
+ }
1055
+ discountsChangedAtSignal.value = discountsChangedAtSignal.value + 1;
1056
+ }
1057
+ function subscriptionIdFromCurrent() {
1058
+ var _a;
1059
+ return ((_a = current.value) == null ? void 0 : _a.id) ?? null;
1060
+ }
1035
1061
  const service = {
1036
1062
  search: adapter.search,
1037
1063
  getById: adapter.getById,
1038
1064
  getCurrentSubscriptionId,
1039
1065
  addItem: (subscriptionId, item) => adapter.addItem({ subscriptionId, item }),
1040
1066
  removeItem: (subscriptionId, itemId) => adapter.removeItem({ subscriptionId, itemId }),
1041
- addDiscount: (subscriptionId, code) => adapter.addDiscount({ subscriptionId, code }),
1042
- removeDiscount: (subscriptionId, discountId) => adapter.removeDiscount({ subscriptionId, discountId }),
1067
+ addDiscount: async (code, subscriptionId) => {
1068
+ const id = subscriptionId ?? subscriptionIdFromCurrent();
1069
+ if (id == null) {
1070
+ return {
1071
+ _tag: "Failure",
1072
+ error: { kind: "SUBSCRIPTION_NOT_FOUND" }
1073
+ };
1074
+ }
1075
+ const result = await adapter.addDiscount({ subscriptionId: id, code });
1076
+ if (result._tag === "Success") {
1077
+ await refreshAfterDiscountChange(id);
1078
+ }
1079
+ return result;
1080
+ },
1081
+ removeDiscount: async (discountId, subscriptionId) => {
1082
+ const id = subscriptionId ?? subscriptionIdFromCurrent();
1083
+ if (id == null) {
1084
+ return {
1085
+ _tag: "Failure",
1086
+ error: { kind: "SUBSCRIPTION_NOT_FOUND" }
1087
+ };
1088
+ }
1089
+ const result = await adapter.removeDiscount({
1090
+ subscriptionId: id,
1091
+ discountId
1092
+ });
1093
+ if (result._tag === "Success") {
1094
+ await refreshAfterDiscountChange(id);
1095
+ }
1096
+ return result;
1097
+ },
1043
1098
  reschedule: (subscriptionId, newDate) => adapter.reschedule({ subscriptionId, newDate }),
1044
1099
  resume: (subscriptionId) => adapter.resume({ subscriptionId }),
1045
1100
  pause: (subscriptionId) => adapter.pause({ subscriptionId }),
@@ -1047,10 +1102,22 @@ function createSubscriptionService(adapter) {
1047
1102
  cancel: (subscriptionId, reason) => adapter.cancel({ subscriptionId, reason }),
1048
1103
  getAvailablePlans: (subscriptionId) => adapter.getAvailablePlans({ subscriptionId }),
1049
1104
  getDefaultSubscriptionId: () => adapter.getDefaultSubscriptionId(),
1050
- current
1105
+ current,
1106
+ discountsChangedAt: discountsChangedAtSignal
1051
1107
  };
1052
1108
  return service;
1053
1109
  }
1110
+ const DISCOUNT_REJECTION_REASONS = [
1111
+ "INVALID_CODE",
1112
+ "INACTIVE",
1113
+ "NOT_APPLICABLE_TO_CUSTOMER",
1114
+ "ALREADY_ADDED",
1115
+ "ALREADY_USED",
1116
+ "NOT_APPLICABLE_TO_PRODUCTS",
1117
+ "NOT_APPLICABLE_TO_SUBSCRIPTION",
1118
+ "INVALID_COMBINATION",
1119
+ "QUANTITY_REQUIREMENT_NOT_MET"
1120
+ ];
1054
1121
  const MOCK_FLOWS = {
1055
1122
  cancellation: [
1056
1123
  {
@@ -1309,6 +1376,7 @@ export {
1309
1376
  a as ContextRequestEvent,
1310
1377
  CustomerServiceContext,
1311
1378
  D as DEFAULT_GLOBAL_STYLES,
1379
+ DISCOUNT_REJECTION_REASONS,
1312
1380
  LoginServiceContext,
1313
1381
  ProductServiceContext,
1314
1382
  RouterServiceContext,
@@ -1 +1 @@
1
- {"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../../src/editor/bridge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EAGd,MAAM,YAAY,CAAC;AAWpB,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,mBAAmB,EACpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,UAAU,CAAC;AAEtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,MAAM,WAAW,UAAU,CACzB,MAAM,GAAG,OAAO,EAChB,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAElC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,QAAQ,CAAC;CACnB;AAED,MAAM,MAAM,kBAAkB,CAAC,QAAQ,IAAI,QAAQ,CAAC,MAAM,QAAQ,CAAC,SAAS;IAC1E,KAAK,EAAE,MAAM,CAAC,CAAC;CAChB,GACG,CAAC,GACD,KAAK,CAAC;AAEV,MAAM,MAAM,oBAAoB,CAAC,QAAQ,IAAI,QAAQ,CAAC,MAAM,QAAQ,CAAC,SAAS;IAC5E,OAAO,EAAE,MAAM,CAAC,CAAC;CAClB,GACG,CAAC,GACD,KAAK,CAAC;AAEV,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,WAAW,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;IAC9C,SAAS,EAAE,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,KAAK;QACxD,WAAW,EAAE,MAAM,IAAI,CAAC;KACzB,CAAC;IACF,mBAAmB,CAAC,QAAQ,GAAG,OAAO,EACpC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,CACR,MAAM,EA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AAC;IACjD;;;OAGG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAID;;;GAGG;AACH,wBAAgB,eAAe,IAAI,YAAY,GAAG,IAAI,CAErD;AAED,wBAAgB,kBAAkB,IAAI,YAAY,CAmejD"}
@@ -7,10 +7,15 @@ export declare class BlockWrapper extends HTMLElement {
7
7
  private isMenuOpen;
8
8
  private closeMenuOnOutsideClick;
9
9
  private emptyObserver;
10
+ private addButtons;
11
+ private addRail;
10
12
  static get observedAttributes(): string[];
11
13
  constructor();
12
14
  private setupStyles;
13
15
  private setupTemplate;
16
+ private createAddButton;
17
+ private handleAddBlock;
18
+ private clearAddButtonMenuState;
14
19
  connectedCallback(): void;
15
20
  /**
16
21
  * Mirror `data-empty` from the slotted block wrapper onto this editor
@@ -1 +1 @@
1
- {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/editor/components.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAiQ9C,qBAAa,YAAa,SAAQ,WAAW;IAC3C,OAAO,CAAC,KAAK,CAA8B;IAC3C,OAAO,CAAC,YAAY,CAAwB;IAC5C,OAAO,CAAC,WAAW,CAA4B;IAC/C,OAAO,CAAC,WAAW,CAA4B;IAC/C,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,uBAAuB,CAA0C;IACzE,OAAO,CAAC,aAAa,CAAiC;IAEtD,MAAM,KAAK,kBAAkB,aAE5B;;IASD,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,aAAa;IAiFrB,iBAAiB;IAiCjB;;;;OAIG;IACH,OAAO,CAAC,qBAAqB;IAqC7B,oBAAoB;IAYpB,OAAO,CAAC,UAAU;IAQlB,OAAO,CAAC,QAAQ;IAahB,OAAO,CAAC,SAAS;IAWjB,QAAQ,CAAC,KAAK,EAAE,aAAa;IAQ7B,OAAO,CAAC,iBAAiB;IASzB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAaxB,OAAO,CAAC,iBAAiB;CAmD1B;AAMD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,0BAA0B,EAAE,YAAY,CAAC;KAC1C;CACF"}
1
+ {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/editor/components.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AA2gB9C,qBAAa,YAAa,SAAQ,WAAW;IAC3C,OAAO,CAAC,KAAK,CAA8B;IAC3C,OAAO,CAAC,YAAY,CAAwB;IAC5C,OAAO,CAAC,WAAW,CAA4B;IAC/C,OAAO,CAAC,WAAW,CAA4B;IAC/C,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,uBAAuB,CAA0C;IACzE,OAAO,CAAC,aAAa,CAAiC;IACtD,OAAO,CAAC,UAAU,CAA2B;IAC7C,OAAO,CAAC,OAAO,CAA4B;IAE3C,MAAM,KAAK,kBAAkB,aAE5B;;IASD,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,aAAa;IA8GrB,OAAO,CAAC,eAAe;IAsCvB,OAAO,CAAC,cAAc;IAgCtB,OAAO,CAAC,uBAAuB;IAO/B,iBAAiB;IAsCjB;;;;OAIG;IACH,OAAO,CAAC,qBAAqB;IAqC7B,oBAAoB;IAYpB,OAAO,CAAC,UAAU;IAQlB,OAAO,CAAC,QAAQ;IAahB,OAAO,CAAC,SAAS;IAWjB,QAAQ,CAAC,KAAK,EAAE,aAAa;IAQ7B,OAAO,CAAC,iBAAiB;IASzB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAaxB,OAAO,CAAC,iBAAiB;CAmD1B;AAMD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,0BAA0B,EAAE,YAAY,CAAC;KAC1C;CACF"}
@@ -1,6 +1,6 @@
1
1
  import { Block, BlockPresets } from '../block';
2
2
  import { GlobalStyles, ThemeSurface, TranslationOverride } from '../theme-state';
3
- export type MessageType = "PROVIDE_THEME_STATE" | "SELECT_BLOCK" | "UPDATE_BLOCK_PROPS" | "ADD_BLOCK" | "REMOVE_BLOCK" | "MOVE_BLOCK" | "IFRAME_READY" | "REGISTER_BLOCKS" | "REGISTER_ROUTES" | "SET_BLOCK_PRESET" | "SET_LOCALE" | "REQUEST_THEME_STATE" | "UPSERT_THEME_STATE" | "REQUEST_TRANSLATION_OVERRIDES" | "PROVIDE_TRANSLATION_OVERRIDES" | "UPDATE_BLOCK_TRANSLATION" | "REGISTER_BLOCK_TRANSLATION_KEYS" | "FOCUS_INLINE_TEXT" | "SET_GLOBAL_STYLES" | "REQUEST_GLOBAL_STYLES" | "PROVIDE_GLOBAL_STYLES" | "PROVIDE_INITIAL_GLOBAL_STYLES" | "SCROLL_SYNC" | "REPORT_CONTENT_HEIGHT" | "REQUEST_CONTENT_HEIGHT";
3
+ export type MessageType = "PROVIDE_THEME_STATE" | "SELECT_BLOCK" | "UPDATE_BLOCK_PROPS" | "ADD_BLOCK" | "REMOVE_BLOCK" | "MOVE_BLOCK" | "IFRAME_READY" | "REGISTER_BLOCKS" | "REGISTER_ROUTES" | "SET_BLOCK_PRESET" | "SET_LOCALE" | "REQUEST_THEME_STATE" | "UPSERT_THEME_STATE" | "REQUEST_TRANSLATION_OVERRIDES" | "PROVIDE_TRANSLATION_OVERRIDES" | "UPDATE_BLOCK_TRANSLATION" | "REGISTER_BLOCK_TRANSLATION_KEYS" | "FOCUS_INLINE_TEXT" | "SET_GLOBAL_STYLES" | "REQUEST_GLOBAL_STYLES" | "PROVIDE_GLOBAL_STYLES" | "PROVIDE_INITIAL_GLOBAL_STYLES" | "SCROLL_SYNC" | "REPORT_CONTENT_HEIGHT" | "REQUEST_CONTENT_HEIGHT" | "OPEN_ADD_BLOCK_MENU" | "ADD_BLOCK_MENU_CLOSED";
4
4
  export interface BaseMessage {
5
5
  type: MessageType;
6
6
  timestamp: number;
@@ -194,8 +194,8 @@ export interface ProvideInitialGlobalStylesMessage extends BaseMessage {
194
194
  styles: GlobalStyles;
195
195
  };
196
196
  }
197
- export type EditorMessage = ProvideThemeStateMessage | ProvideTranslationOverridesMessage | SelectBlockMessage | UpdateBlockPropsMessage | AddBlockMessage | RemoveBlockMessage | MoveBlockMessage | SetBlockPresetMessage | SetLocaleMessage | SetGlobalStylesMessage | ProvideGlobalStylesMessage | ScrollSyncMessage | RequestContentHeightMessage;
198
- export type IframeMessage = SelectBlockMessage | IframeReadyMessage | RegisterBlocksMessage | RegisterRoutesMessage | RemoveBlockMessage | UpdateBlockPropsMessage | RequestThemeStateMessage | UpsertThemeStateMessage | RequestTranslationOverridesMessage | UpdateBlockTranslationMessage | RegisterBlockTranslationKeysMessage | FocusInlineTextMessage | RequestGlobalStylesMessage | ProvideInitialGlobalStylesMessage | ReportContentHeightMessage | ScrollSyncMessage;
197
+ export type EditorMessage = ProvideThemeStateMessage | ProvideTranslationOverridesMessage | SelectBlockMessage | UpdateBlockPropsMessage | AddBlockMessage | RemoveBlockMessage | MoveBlockMessage | SetBlockPresetMessage | SetLocaleMessage | SetGlobalStylesMessage | ProvideGlobalStylesMessage | ScrollSyncMessage | RequestContentHeightMessage | AddBlockMenuClosedMessage;
198
+ export type IframeMessage = SelectBlockMessage | IframeReadyMessage | RegisterBlocksMessage | RegisterRoutesMessage | RemoveBlockMessage | UpdateBlockPropsMessage | RequestThemeStateMessage | UpsertThemeStateMessage | RequestTranslationOverridesMessage | UpdateBlockTranslationMessage | RegisterBlockTranslationKeysMessage | FocusInlineTextMessage | RequestGlobalStylesMessage | ProvideInitialGlobalStylesMessage | ReportContentHeightMessage | ScrollSyncMessage | OpenAddBlockMenuMessage;
199
199
  export type AnyMessage = EditorMessage | IframeMessage;
200
200
  export declare function isEditorMessage(message: AnyMessage): message is EditorMessage;
201
201
  export declare function isIframeMessage(message: AnyMessage): message is IframeMessage;
@@ -234,8 +234,40 @@ export interface RequestContentHeightMessage extends BaseMessage {
234
234
  type: "REQUEST_CONTENT_HEIGHT";
235
235
  payload: Record<string, never>;
236
236
  }
237
+ export interface OpenAddBlockMenuMessage extends BaseMessage {
238
+ type: "OPEN_ADD_BLOCK_MENU";
239
+ payload: {
240
+ targetBlockId: string;
241
+ position: "before" | "after";
242
+ /**
243
+ * Anchor point in iframe-local viewport coordinates (the iframe's own
244
+ * `getBoundingClientRect()` reference frame). The parent translates this
245
+ * into parent-window coordinates by adding the iframe element's own
246
+ * bounding rect offset.
247
+ */
248
+ anchor: {
249
+ x: number;
250
+ y: number;
251
+ };
252
+ };
253
+ }
254
+ /**
255
+ * Sent from the editor (parent) back to the iframe when the floating
256
+ * AddMenu opened by OPEN_ADD_BLOCK_MENU is dismissed. The originating
257
+ * BlockWrapper uses this to reset its add-button visual state (it kept
258
+ * the "Add block" pill visible while the menu was open).
259
+ */
260
+ export interface AddBlockMenuClosedMessage extends BaseMessage {
261
+ type: "ADD_BLOCK_MENU_CLOSED";
262
+ payload: {
263
+ targetBlockId: string;
264
+ position: "before" | "after";
265
+ };
266
+ }
237
267
  export declare function createProvideGlobalStylesMessage(payload: ProvideGlobalStylesMessage["payload"]): ProvideGlobalStylesMessage;
238
268
  export declare function createProvideInitialGlobalStylesMessage(payload: ProvideInitialGlobalStylesMessage["payload"]): ProvideInitialGlobalStylesMessage;
239
269
  export declare function createScrollSyncMessage(payload: ScrollSyncMessage["payload"]): ScrollSyncMessage;
240
270
  export declare function createReportContentHeightMessage(payload: ReportContentHeightMessage["payload"]): ReportContentHeightMessage;
271
+ export declare function createOpenAddBlockMenuMessage(payload: OpenAddBlockMenuMessage["payload"]): OpenAddBlockMenuMessage;
272
+ export declare function createAddBlockMenuClosedMessage(payload: AddBlockMenuClosedMessage["payload"]): AddBlockMenuClosedMessage;
241
273
  //# sourceMappingURL=messages.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/editor/messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,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,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;KAClC,CAAC;CACH;AAED;;;;;GAKG;AACH,MAAM,WAAW,yBAA0B,SAAQ,WAAW;IAC5D,IAAI,EAAE,uBAAuB,CAAC;IAC9B,OAAO,EAAE;QACP,aAAa,EAAE,MAAM,CAAC;QACtB,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC;KAC9B,CAAC;CACH;AAED,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,0BAA0B,CAAC,SAAS,CAAC,GAC7C,0BAA0B,CAM5B;AAED,wBAAgB,uCAAuC,CACrD,OAAO,EAAE,iCAAiC,CAAC,SAAS,CAAC,GACpD,iCAAiC,CAMnC;AAED,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,iBAAiB,CAAC,SAAS,CAAC,GACpC,iBAAiB,CAMnB;AAED,wBAAgB,gCAAgC,CAC9C,OAAO,EAAE,0BAA0B,CAAC,SAAS,CAAC,GAC7C,0BAA0B,CAM5B;AAED,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,uBAAuB,CAAC,SAAS,CAAC,GAC1C,uBAAuB,CAMzB;AAED,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,yBAAyB,CAAC,SAAS,CAAC,GAC5C,yBAAyB,CAM3B"}
package/dist/editor.js CHANGED
@@ -2,8 +2,8 @@ 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";
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
7
  import { h as createBlockInstanceFromObject } from "./block-C8lPBCF8.js";
8
8
  import { i as indexOverrides } from "./theme-state-LZS5T-Xb.js";
9
9
  function createEditorHandler(options) {
@@ -128,17 +128,17 @@ function createEditorHandler(options) {
128
128
  if (location.type === "before" || location.type === "after") {
129
129
  let findAndInsertBlock = function(blocks, targetId, newBlock2, position) {
130
130
  var _a2;
131
- for (let i2 = 0; i2 < blocks.length; i2++) {
132
- if (blocks[i2].id === targetId) {
131
+ for (let i = 0; i < blocks.length; i++) {
132
+ if (blocks[i].id === targetId) {
133
133
  if (position === "before") {
134
- blocks.splice(i2, 0, newBlock2);
134
+ blocks.splice(i, 0, newBlock2);
135
135
  } else {
136
- blocks.splice(i2 + 1, 0, newBlock2);
136
+ blocks.splice(i + 1, 0, newBlock2);
137
137
  }
138
138
  return true;
139
139
  }
140
- for (const slotKey of Object.keys(blocks[i2].slots || {})) {
141
- const slotBlocks = blocks[i2].slots[slotKey];
140
+ for (const slotKey of Object.keys(blocks[i].slots || {})) {
141
+ const slotBlocks = blocks[i].slots[slotKey];
142
142
  const slotArray = Array.isArray(slotBlocks) ? slotBlocks : [slotBlocks];
143
143
  for (let j2 = 0; j2 < slotArray.length; j2++) {
144
144
  if (typeof slotArray[j2] !== "string" && ((_a2 = slotArray[j2]) == null ? void 0 : _a2.id) === targetId) {
@@ -147,7 +147,7 @@ function createEditorHandler(options) {
147
147
  } else {
148
148
  slotArray.splice(j2 + 1, 0, newBlock2);
149
149
  }
150
- blocks[i2].slots[slotKey] = slotArray;
150
+ blocks[i].slots[slotKey] = slotArray;
151
151
  return true;
152
152
  }
153
153
  }
@@ -201,21 +201,21 @@ function createEditorHandler(options) {
201
201
  } else if (message.type === "REMOVE_BLOCK") {
202
202
  let findAndRemoveBlock = function(blocks, blockId, slot, parentId) {
203
203
  var _a2;
204
- for (let i2 = 0; i2 < blocks.length; i2++) {
205
- if (blocks[i2].id === parentId && ((_a2 = blocks[i2].slots) == null ? void 0 : _a2[slot])) {
206
- 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];
207
207
  const slotArray = Array.isArray(slotBlocks) ? slotBlocks : [slotBlocks];
208
208
  const index = slotArray.findIndex(
209
209
  (b2) => typeof b2 !== "string" && (b2 == null ? void 0 : b2.id) === blockId
210
210
  );
211
211
  if (index !== -1) {
212
212
  slotArray.splice(index, 1);
213
- blocks[i2].slots[slot] = slotArray;
213
+ blocks[i].slots[slot] = slotArray;
214
214
  return true;
215
215
  }
216
216
  }
217
- for (const slotKey of Object.keys(blocks[i2].slots || {})) {
218
- const slotBlocks = blocks[i2].slots[slotKey];
217
+ for (const slotKey of Object.keys(blocks[i].slots || {})) {
218
+ const slotBlocks = blocks[i].slots[slotKey];
219
219
  const slotArray = Array.isArray(slotBlocks) ? slotBlocks : [slotBlocks];
220
220
  for (const child of slotArray) {
221
221
  if (typeof child !== "string" && (child == null ? void 0 : child.id)) {
@@ -518,6 +518,262 @@ const styles = `
518
518
  background: #e9e9e9;
519
519
  flex-shrink: 0;
520
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
+ }
521
777
  </style>
522
778
  `;
523
779
  const blockIconSvg = `
@@ -531,6 +787,12 @@ const moreIconSvg = `
531
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"/>
532
788
  </svg>
533
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
+ `;
534
796
  const trashIconSvg = `
535
797
  <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
536
798
  <path d="M2 4H12" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/>
@@ -551,6 +813,8 @@ class BlockWrapper extends HTMLElement {
551
813
  __publicField(this, "isMenuOpen", false);
552
814
  __publicField(this, "closeMenuOnOutsideClick", null);
553
815
  __publicField(this, "emptyObserver", null);
816
+ __publicField(this, "addButtons", []);
817
+ __publicField(this, "addRail", null);
554
818
  this.attachShadow({ mode: "open" });
555
819
  this.setupStyles();
556
820
  this.setupTemplate();
@@ -617,16 +881,91 @@ class BlockWrapper extends HTMLElement {
617
881
  const slot = document.createElement("slot");
618
882
  slotHost.appendChild(slot);
619
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];
620
901
  this.shadowRoot.appendChild(wrapper);
621
902
  this.nameElement = nameSpan;
622
903
  this.menuElement = menuEl;
623
904
  this.editorBridge.onMessage((message) => {
624
- var _a;
905
+ var _a, _b;
625
906
  if (message.type === "SELECT_BLOCK") {
626
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);
627
910
  }
628
911
  });
629
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
+ }
630
969
  connectedCallback() {
631
970
  const isInOverlay = this.closest('juo-extension-root[surface="overlay"]') !== null;
632
971
  if (isInOverlay) {
@@ -638,6 +977,9 @@ class BlockWrapper extends HTMLElement {
638
977
  ".block-wrapper__menu-item--danger"
639
978
  );
640
979
  if (deleteBtn) deleteBtn.style.display = "none";
980
+ if (this.addRail) {
981
+ this.addRail.style.display = "none";
982
+ }
641
983
  }
642
984
  const isWorkflowPreview = (() => {
643
985
  try {
@@ -863,33 +1205,35 @@ async function setupEditorMode(deps) {
863
1205
  }
864
1206
  export {
865
1207
  BlockWrapper,
866
- i as createAddBlockMessage,
1208
+ j as createAddBlockMenuClosedMessage,
1209
+ k as createAddBlockMessage,
867
1210
  createEditorBridge,
868
1211
  createEditorHandler,
869
1212
  b as createFocusInlineTextMessage,
870
- j as createMoveBlockMessage,
871
- k as createProvideGlobalStylesMessage,
872
- l as createProvideInitialGlobalStylesMessage,
873
- m as createProvideThemeStateMessage,
874
- 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,
875
1219
  c as createRegisterBlockTranslationKeysMessage,
876
1220
  createRegisterBlocksMessage,
877
1221
  createRegisterRoutesMessage,
878
1222
  createRemoveBlockMessage,
879
- o as createReportContentHeightMessage,
880
- p as createRequestGlobalStylesMessage,
881
- q as createRequestThemeStateMessage,
882
- r as createRequestTranslationOverridesMessage,
883
- s as createScrollSyncMessage,
1223
+ q as createReportContentHeightMessage,
1224
+ r as createRequestGlobalStylesMessage,
1225
+ s as createRequestThemeStateMessage,
1226
+ t as createRequestTranslationOverridesMessage,
1227
+ u as createScrollSyncMessage,
884
1228
  e as createSelectBlockMessage,
885
- t as createSetBlockPresetMessage,
886
- u as createSetGlobalStylesMessage,
887
- v as createSetLocaleMessage,
888
- w as createUpdateBlockPropsMessage,
1229
+ v as createSetBlockPresetMessage,
1230
+ w as createSetGlobalStylesMessage,
1231
+ x as createSetLocaleMessage,
1232
+ y as createUpdateBlockPropsMessage,
889
1233
  d as createUpdateBlockTranslationMessage,
890
- x as createUpsertThemeStateMessage,
891
- y as getEditorBridge,
892
- z as isEditorMessage,
893
- A as isIframeMessage,
1234
+ z as createUpsertThemeStateMessage,
1235
+ A as getEditorBridge,
1236
+ B as isEditorMessage,
1237
+ C as isIframeMessage,
894
1238
  setupEditorMode
895
1239
  };
@@ -2,7 +2,7 @@ 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 { 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-DAUIcGuq.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 {};
package/dist/preact.js CHANGED
@@ -6,7 +6,7 @@ import { useState, useRef, useEffect, useContext as useContext$1, useMemo } from
6
6
  import { g as getSignalValue, s as setSignalValue, w as wrapContext, c as createSlotChildren } from "./block-VhmfGB3N.js";
7
7
  import { t } from "./block-VhmfGB3N.js";
8
8
  import { createContext, h, render } from "preact";
9
- import { a as createEditorBridge } from "./bridge-DAUIcGuq.js";
9
+ import { a as createEditorBridge } from "./bridge-BOcO9toS.js";
10
10
  function toState(signal) {
11
11
  const [value, setValue] = useState(() => getSignalValue(signal));
12
12
  const disposeRef = useRef(null);
package/dist/react.js CHANGED
@@ -6,7 +6,7 @@ import React, { useSyncExternalStore, createContext, useState, useContext as use
6
6
  import { g as getSignalValue, s as setSignalValue, w as wrapContext, c as createSlotChildren } from "./block-VhmfGB3N.js";
7
7
  import { t } from "./block-VhmfGB3N.js";
8
8
  import { createRoot } from "react-dom/client";
9
- import { a as createEditorBridge } from "./bridge-DAUIcGuq.js";
9
+ import { a as createEditorBridge } from "./bridge-BOcO9toS.js";
10
10
  function toState(signal) {
11
11
  const subscribe = (callback) => {
12
12
  const dispose = effect(() => {
@@ -1,4 +1,5 @@
1
1
  import { Subscription, SellingPlan, SearchOptions, PostableSubscriptionItem } from './types';
2
+ import { ApplyDiscountError, DiscountRejectionReason, RemoveDiscountError } from './discountErrors';
2
3
  import { Result, PaginatedList } from '../../utils';
3
4
  /**
4
5
  * Adapter interface for subscription.
@@ -18,11 +19,11 @@ export interface SubscriptionAdapter {
18
19
  addDiscount(params: {
19
20
  subscriptionId: string;
20
21
  code: string;
21
- }): Promise<Result>;
22
+ }): Promise<Result<void, ApplyDiscountError>>;
22
23
  removeDiscount(params: {
23
24
  subscriptionId: string;
24
25
  discountId: string;
25
- }): Promise<Result>;
26
+ }): Promise<Result<void, RemoveDiscountError>>;
26
27
  reschedule(params: {
27
28
  subscriptionId: string;
28
29
  newDate: string;
@@ -45,5 +46,22 @@ export interface SubscriptionAdapter {
45
46
  }): Promise<Result<SellingPlan[]>>;
46
47
  getDefaultSubscriptionId(): Promise<Result<string | null>>;
47
48
  }
48
- export declare function createMockSubscriptionAdapter(): SubscriptionAdapter;
49
+ export interface MockSubscriptionAdapterOptions {
50
+ addDiscountBehavior?: {
51
+ kind: "success";
52
+ } | {
53
+ kind: "rejected";
54
+ reason: DiscountRejectionReason;
55
+ } | {
56
+ kind: "error";
57
+ error: "NETWORK" | "UNKNOWN" | "SUBSCRIPTION_NOT_FOUND";
58
+ };
59
+ removeDiscountBehavior?: {
60
+ kind: "success";
61
+ } | {
62
+ kind: "error";
63
+ error: "NETWORK" | "UNKNOWN" | "SUBSCRIPTION_NOT_FOUND" | "DISCOUNT_NOT_FOUND";
64
+ };
65
+ }
66
+ export declare function createMockSubscriptionAdapter(options?: MockSubscriptionAdapterOptions): SubscriptionAdapter;
49
67
  //# sourceMappingURL=adapter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../src/services/subscription/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,WAAW,EACX,aAAa,EACb,wBAAwB,EACzB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEzD;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAE9E,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC,CAAC;IAE1D,OAAO,CAAC,MAAM,EAAE;QACd,cAAc,EAAE,MAAM,CAAC;QACvB,IAAI,EAAE,wBAAwB,CAAC;KAChC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEpB,UAAU,CAAC,MAAM,EAAE;QACjB,cAAc,EAAE,MAAM,CAAC;QACvB,MAAM,EAAE,MAAM,CAAC;KAChB,GAAG,OAAO,CAAC,MAAM,CAAC,CA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AAoB,CAAC;KAC1B,CAAC;CACP;AAED,wBAAgB,6BAA6B,CAC3C,OAAO,GAAE,8BAAmC,GAC3C,mBAAmB,CAuSrB"}
@@ -0,0 +1,27 @@
1
+ export declare const DISCOUNT_REJECTION_REASONS: readonly ["INVALID_CODE", "INACTIVE", "NOT_APPLICABLE_TO_CUSTOMER", "ALREADY_ADDED", "ALREADY_USED", "NOT_APPLICABLE_TO_PRODUCTS", "NOT_APPLICABLE_TO_SUBSCRIPTION", "INVALID_COMBINATION", "QUANTITY_REQUIREMENT_NOT_MET"];
2
+ export type DiscountRejectionReason = (typeof DISCOUNT_REJECTION_REASONS)[number];
3
+ export type ApplyDiscountError = {
4
+ kind: "REJECTED";
5
+ reason: DiscountRejectionReason;
6
+ message?: string;
7
+ } | {
8
+ kind: "SUBSCRIPTION_NOT_FOUND";
9
+ } | {
10
+ kind: "NETWORK";
11
+ message?: string;
12
+ } | {
13
+ kind: "UNKNOWN";
14
+ message?: string;
15
+ };
16
+ export type RemoveDiscountError = {
17
+ kind: "DISCOUNT_NOT_FOUND";
18
+ } | {
19
+ kind: "SUBSCRIPTION_NOT_FOUND";
20
+ } | {
21
+ kind: "NETWORK";
22
+ message?: string;
23
+ } | {
24
+ kind: "UNKNOWN";
25
+ message?: string;
26
+ };
27
+ //# sourceMappingURL=discountErrors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discountErrors.d.ts","sourceRoot":"","sources":["../../../src/services/subscription/discountErrors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,0BAA0B,6NAU7B,CAAC;AAEX,MAAM,MAAM,uBAAuB,GACjC,CAAC,OAAO,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9C,MAAM,MAAM,kBAAkB,GAC1B;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,uBAAuB,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GACvE;IAAE,IAAI,EAAE,wBAAwB,CAAA;CAAE,GAClC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GACrC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1C,MAAM,MAAM,mBAAmB,GAC3B;IAAE,IAAI,EAAE,oBAAoB,CAAA;CAAE,GAC9B;IAAE,IAAI,EAAE,wBAAwB,CAAA;CAAE,GAClC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GACrC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC"}
@@ -1,5 +1,6 @@
1
- export type { SubscriptionAdapter } from './adapter';
1
+ export type { SubscriptionAdapter, MockSubscriptionAdapterOptions } from './adapter';
2
2
  export { createMockSubscriptionAdapter } from './adapter';
3
3
  export { createSubscriptionService, SubscriptionServiceContext } from './subscriptionService';
4
4
  export * from './types';
5
+ export * from './discountErrors';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/subscription/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,6BAA6B,EAAE,MAAM,WAAW,CAAC;AAE1D,OAAO,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAE9F,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/subscription/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,mBAAmB,EAAE,8BAA8B,EAAE,MAAM,WAAW,CAAC;AACrF,OAAO,EAAE,6BAA6B,EAAE,MAAM,WAAW,CAAC;AAE1D,OAAO,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAE9F,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"subscriptionService.d.ts","sourceRoot":"","sources":["../../../src/services/subscription/subscriptionService.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAiB,MAAM,eAAe,CAAC;AAC3D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,KAAK,EAGV,mBAAmB,EACpB,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,0BAA0B;;CACsB,CAAC;AAqC9D;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,mBAAmB,GAC3B,WAAW,CAAC,OAAO,0BAA0B,CAAC,CA8BhD"}
1
+ {"version":3,"file":"subscriptionService.d.ts","sourceRoot":"","sources":["../../../src/services/subscription/subscriptionService.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAiB,MAAM,eAAe,CAAC;AAC3D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,KAAK,EAGV,mBAAmB,EACpB,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,0BAA0B;;CACsB,CAAC;AAqC9D;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,mBAAmB,GAC3B,WAAW,CAAC,OAAO,0BAA0B,CAAC,CAyEhD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=subscriptionService.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscriptionService.test.d.ts","sourceRoot":"","sources":["../../../src/services/subscription/subscriptionService.test.ts"],"names":[],"mappings":""}
@@ -1,5 +1,6 @@
1
- import { Signal } from '@preact/signals-core';
1
+ import { ReadonlySignal, Signal } from '@preact/signals-core';
2
2
  import { PaginatedList, PriceWithCurrency, Result } from '../../utils';
3
+ import { ApplyDiscountError, RemoveDiscountError } from './discountErrors';
3
4
  export interface SubscriptionItem {
4
5
  id: string;
5
6
  productId: string;
@@ -67,10 +68,17 @@ export type SubscriptionService = {
67
68
  * the service factory creates it; hosts sync route or other context by assigning `current.value`.
68
69
  */
69
70
  current: Signal<Subscription | null>;
71
+ /**
72
+ * Monotonically-increasing counter that bumps after every successful
73
+ * `addDiscount`/`removeDiscount`. Consumers (e.g. the customer portal page)
74
+ * can watch this signal to re-fetch any non-blocks state that depends on the
75
+ * subscription's discounts.
76
+ */
77
+ discountsChangedAt: ReadonlySignal<number>;
70
78
  addItem(subscriptionId: string, item: PostableSubscriptionItem): Promise<Result>;
71
79
  removeItem(subscriptionId: string, itemId: string): Promise<Result>;
72
- addDiscount(subscriptionId: string, code: string): Promise<Result>;
73
- removeDiscount(subscriptionId: string, discountId: string): Promise<Result>;
80
+ addDiscount(code: string, subscriptionId?: string): Promise<Result<void, ApplyDiscountError>>;
81
+ removeDiscount(discountId: string, subscriptionId?: string): Promise<Result<void, RemoveDiscountError>>;
74
82
  reschedule(subscriptionId: string, newDate: string): Promise<Result<Subscription>>;
75
83
  resume(subscriptionId: string): Promise<Result<Subscription>>;
76
84
  pause(subscriptionId: string): Promise<Result<Subscription>>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/services/subscription/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE5E,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,iBAAiB,CAAC;IACzB,gBAAgB,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;CAChC;AAED,MAAM,WAAW,wBAAwB;IACvC,SAAS,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E,MAAM,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC;IAC/E,iBAAiB,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;IAC1E,wBAAwB,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;CAC5D,CAAC"}
package/dist/vue.js CHANGED
@@ -2,7 +2,7 @@ import { customRef, toValue, watchEffect, defineComponent, ref, getCurrentInstan
2
2
  import { effect, signal, injectContext, provideContext, createCeRenderer } from "@juo/blocks";
3
3
  import { b as attachEmptyTracking } from "./block-C8lPBCF8.js";
4
4
  import { n } from "./block-C8lPBCF8.js";
5
- import { c as createRegisterBlockTranslationKeysMessage, a as createEditorBridge } from "./bridge-DAUIcGuq.js";
5
+ import { c as createRegisterBlockTranslationKeysMessage, a as createEditorBridge } from "./bridge-BOcO9toS.js";
6
6
  const signalsMap = /* @__PURE__ */ new WeakMap();
7
7
  function toSignal(ref2) {
8
8
  if (!signalsMap.has(ref2)) {
@@ -2,9 +2,9 @@ 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 { o as injectContext, E, z as ContextRoot } from "./block-C8lPBCF8.js";
5
- import { E as ExtensionRoot, B as Block } from "./ExtensionRoot-CY2JksJh.js";
6
- import { a as createEditorBridge, b as createFocusInlineTextMessage, d as createUpdateBlockTranslationMessage } from "./bridge-DAUIcGuq.js";
7
- import { T as TranslationContext } from "./juo-workflow-Dqr1lB1k.js";
5
+ import { E as ExtensionRoot, B as Block } from "./ExtensionRoot-BmfKKpcU.js";
6
+ import { a as createEditorBridge, b as createFocusInlineTextMessage, d as createUpdateBlockTranslationMessage } from "./bridge-BOcO9toS.js";
7
+ import { T as TranslationContext } from "./juo-workflow-B3OHYsp-.js";
8
8
  const _InlineText = class _InlineText extends HTMLElement {
9
9
  constructor() {
10
10
  super();
@@ -2,8 +2,8 @@ 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 { o as injectContext, E, z as ContextRoot } from "./block-C8lPBCF8.js";
5
- import { E as ExtensionRoot, B as Block } from "./ExtensionRoot-CY2JksJh.js";
6
- import { T as TranslationContext } from "./juo-workflow-Dqr1lB1k.js";
5
+ import { E as ExtensionRoot, B as Block } from "./ExtensionRoot-BmfKKpcU.js";
6
+ import { T as TranslationContext } from "./juo-workflow-B3OHYsp-.js";
7
7
  class InlineText extends HTMLElement {
8
8
  constructor() {
9
9
  super(...arguments);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@juo/blocks",
3
3
  "private": false,
4
- "version": "1.7.1",
4
+ "version": "1.8.0",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"