@juo/blocks 1.5.0 → 1.5.1

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.
@@ -4,7 +4,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
4
4
  import { signal, effect, createBlockInstance } from "@juo/blocks";
5
5
  import { reportBlockWarning, reportBlockError } from "./observability.js";
6
6
  import { d, v as subscribeContext, T as ThemeStateContext, E, y as withWrapper, x as n, b as backfillInstanceDefaults, p as isStubDefinition, q as onRegisterBlock } from "./theme-state-D3w_B6gQ.js";
7
- import "./juo-workflow-BcW9QouV.js";
7
+ import "./juo-workflow-CEJOM_bA.js";
8
8
  class Block extends HTMLElement {
9
9
  constructor() {
10
10
  super();
@@ -276,14 +276,15 @@ function createEditorBridge() {
276
276
  }
277
277
  }
278
278
  const clickedBlockId = (blockWrapper == null ? void 0 : blockWrapper.getAttribute("data-block-id")) || null;
279
+ const newBlockId = clickedBlockId || null;
280
+ const isNewSelection = newBlockId !== selectedBlockId.value;
279
281
  if (isWorkflowPreview && !clickedBlockId) {
280
282
  return;
281
283
  }
282
284
  if (clickedBlockId && clickedBlockId === selectedBlockId.value) {
283
285
  return;
284
286
  }
285
- const newBlockId = clickedBlockId || null;
286
- if (newBlockId !== selectedBlockId.value) {
287
+ if (isNewSelection) {
287
288
  const message = createSelectBlockMessage(
288
289
  { blockId: newBlockId },
289
290
  newBlockId || void 0
package/dist/core.js CHANGED
@@ -3,7 +3,7 @@ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { en
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
4
  import { c as createContext, d, w, r as registerBlock, E, u } from "./theme-state-D3w_B6gQ.js";
5
5
  import { B, C, a, D, S, T, b, e, f, g, h, i, j, k, l, m, n, o, p, q, s, t, v, x, y } from "./theme-state-D3w_B6gQ.js";
6
- import { T as T2, W, c, a as a2, b as b2, g as g2, h as h2 } from "./juo-workflow-BcW9QouV.js";
6
+ import { T as T2, W, c, a as a2, b as b2, g as g2, h as h2 } from "./juo-workflow-CEJOM_bA.js";
7
7
  import { reportBlockWarning, reportBlockError } from "./observability.js";
8
8
  function createState() {
9
9
  const discountCode = d(null);
@@ -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;AA6O9C,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;IAEzE,MAAM,KAAK,kBAAkB,aAE5B;;IASD,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,aAAa;IAiFrB,iBAAiB;IA+BjB,oBAAoB;IAUpB,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;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;IAEzE,MAAM,KAAK,kBAAkB,aAE5B;;IASD,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,aAAa;IAiFrB,iBAAiB;IA+BjB,oBAAoB;IAUpB,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"}
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-BUMnj_Y5.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-BUMnj_Y5.js";
5
+ import { a as createEditorBridge, f as createRemoveBlockMessage, g as createRegisterBlocksMessage, h as createRegisterRoutesMessage } from "./bridge-BbG-fSU2.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-BbG-fSU2.js";
7
7
  import { g as createBlockInstanceFromObject, n as indexOverrides } from "./theme-state-D3w_B6gQ.js";
8
8
  function createEditorHandler(options) {
9
9
  const { themeState, onBlockSelection } = options;
@@ -296,6 +296,11 @@ const styles = `
296
296
  :host {
297
297
  display: block;
298
298
  position: relative;
299
+ /* Re-enable hit-testing on every wrapper so that an inactive ancestor
300
+ * wrapper's slot-host (pointer-events: none) doesn't make this nested
301
+ * wrapper unselectable. pointer-events: auto on a descendant overrides
302
+ * an ancestor's pointer-events: none for that descendant. */
303
+ pointer-events: auto;
299
304
  }
300
305
 
301
306
  .block-wrapper {
@@ -367,6 +372,20 @@ const styles = `
367
372
  z-index: 100;
368
373
  }
369
374
 
375
+ /*
376
+ * Inactive blocks: disable hit-testing on the slotted block content so that
377
+ * 1. clicks on interactive elements inside the block don't trigger their
378
+ * default behavior (the click falls through to the wrapper, which the
379
+ * global click handler in bridge.ts uses to drive selection), and
380
+ * 2. the cursor / hover styles / focus rings inside the block don't
381
+ * advertise interactivity that isn't actually available.
382
+ * The wrapper itself, the chrome, and the title bar stay interactive
383
+ * because they're siblings of the slot-host, not descendants.
384
+ */
385
+ :host(:not(.active)) .block-wrapper__slot-host {
386
+ pointer-events: none;
387
+ }
388
+
370
389
  /*
371
390
  * Wraps the slotted block content. Stays as a plain in-flow div when
372
391
  * inactive (no stacking context). Only when the host is .active do we
@@ -377,6 +396,7 @@ const styles = `
377
396
  :host(.active) .block-wrapper__slot-host {
378
397
  position: relative;
379
398
  z-index: 101;
399
+ pointer-events: auto;
380
400
  }
381
401
 
382
402
  /*
@@ -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, 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-BUMnj_Y5.js";
5
+ import { a as createEditorBridge, e as createSelectBlockMessage } from "./bridge-BbG-fSU2.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-BUMnj_Y5.js";
9
+ import { a as createEditorBridge } from "./bridge-BbG-fSU2.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-BUMnj_Y5.js";
9
+ import { a as createEditorBridge } from "./bridge-BbG-fSU2.js";
10
10
  function toState(signal) {
11
11
  const subscribe = (callback) => {
12
12
  const dispose = effect(() => {
package/dist/vue.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { customRef, toValue, watchEffect, defineComponent, ref, getCurrentInstance, onMounted, provide, h, renderSlot, inject, computed, useHost, defineCustomElement, triggerRef, render, shallowRef } from "vue";
2
2
  import { effect, signal, injectContext, provideContext, createCeRenderer } from "@juo/blocks";
3
- import { c as createRegisterBlockTranslationKeysMessage, a as createEditorBridge } from "./bridge-BUMnj_Y5.js";
3
+ import { c as createRegisterBlockTranslationKeysMessage, a as createEditorBridge } from "./bridge-BbG-fSU2.js";
4
4
  const signalsMap = /* @__PURE__ */ new WeakMap();
5
5
  function toSignal(ref2) {
6
6
  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 "./theme-state-D3w_B6gQ.js";
5
- import { E as ExtensionRoot, B as Block } from "./ExtensionRoot-BjAZAQ-b.js";
6
- import { a as createEditorBridge, b as createFocusInlineTextMessage, d as createUpdateBlockTranslationMessage } from "./bridge-BUMnj_Y5.js";
7
- import { T as TranslationContext } from "./juo-workflow-BcW9QouV.js";
5
+ import { E as ExtensionRoot, B as Block } from "./ExtensionRoot--ykEAINN.js";
6
+ import { a as createEditorBridge, b as createFocusInlineTextMessage, d as createUpdateBlockTranslationMessage } from "./bridge-BbG-fSU2.js";
7
+ import { T as TranslationContext } from "./juo-workflow-CEJOM_bA.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 "./theme-state-D3w_B6gQ.js";
5
- import { E as ExtensionRoot, B as Block } from "./ExtensionRoot-BjAZAQ-b.js";
6
- import { T as TranslationContext } from "./juo-workflow-BcW9QouV.js";
5
+ import { E as ExtensionRoot, B as Block } from "./ExtensionRoot--ykEAINN.js";
6
+ import { T as TranslationContext } from "./juo-workflow-CEJOM_bA.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.5.0",
4
+ "version": "1.5.1",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"