@juo/blocks 2.0.0-alpha.5 → 2.0.0-alpha.6

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 (54) hide show
  1. package/dist/{ExtensionRoot-DRpD5EcC.js → ExtensionRoot-CG9dH98z.js} +1 -1
  2. package/dist/core.js +172 -11
  3. package/dist/{css-runtime-B7tZrBIp.js → css-runtime-CjZl0K48.js} +23 -17
  4. package/dist/editor/handler.d.ts.map +1 -1
  5. package/dist/editor.js +4 -1
  6. package/dist/{gridstack-adapter-BGKGC-eO.js → gridstack-adapter-C1Q8gbsH.js} +2 -2
  7. package/dist/languages.d.ts +51 -0
  8. package/dist/languages.d.ts.map +1 -0
  9. package/dist/main.d.ts +1 -0
  10. package/dist/main.d.ts.map +1 -1
  11. package/dist/{project-gridstack-PxN_DIfP.js → project-gridstack-CRZ_7HoT.js} +1 -1
  12. package/dist/services/customer/adapter.d.ts +12 -0
  13. package/dist/services/customer/adapter.d.ts.map +1 -1
  14. package/dist/services/customer/adapter.test.d.ts +2 -0
  15. package/dist/services/customer/adapter.test.d.ts.map +1 -0
  16. package/dist/services/customer/customerService.d.ts.map +1 -1
  17. package/dist/services/customer/index.d.ts +1 -1
  18. package/dist/services/customer/index.d.ts.map +1 -1
  19. package/dist/services/customer/types.d.ts +13 -0
  20. package/dist/services/customer/types.d.ts.map +1 -1
  21. package/dist/services/login/adapter.d.ts.map +1 -1
  22. package/dist/services/login/loginService.d.ts +1 -0
  23. package/dist/services/login/loginService.d.ts.map +1 -1
  24. package/dist/services/login/loginService.test.d.ts +2 -0
  25. package/dist/services/login/loginService.test.d.ts.map +1 -0
  26. package/dist/services/subscription/adapter.d.ts +10 -1
  27. package/dist/services/subscription/adapter.d.ts.map +1 -1
  28. package/dist/services/subscription/index.d.ts +2 -0
  29. package/dist/services/subscription/index.d.ts.map +1 -1
  30. package/dist/services/subscription/instantOrderErrors.d.ts +66 -0
  31. package/dist/services/subscription/instantOrderErrors.d.ts.map +1 -0
  32. package/dist/services/subscription/lineRemoval.d.ts +56 -0
  33. package/dist/services/subscription/lineRemoval.d.ts.map +1 -0
  34. package/dist/services/subscription/lineRemoval.test.d.ts +2 -0
  35. package/dist/services/subscription/lineRemoval.test.d.ts.map +1 -0
  36. package/dist/services/subscription/paymentInstrument.d.ts +8 -1
  37. package/dist/services/subscription/paymentInstrument.d.ts.map +1 -1
  38. package/dist/services/subscription/subscriptionService.d.ts.map +1 -1
  39. package/dist/services/subscription/types.d.ts +87 -1
  40. package/dist/services/subscription/types.d.ts.map +1 -1
  41. package/dist/theme-state.d.ts +10 -1
  42. package/dist/theme-state.d.ts.map +1 -1
  43. package/dist/utils/index.d.ts +7 -0
  44. package/dist/utils/index.d.ts.map +1 -1
  45. package/dist/vue/context.d.ts +25 -1
  46. package/dist/vue/context.d.ts.map +1 -1
  47. package/dist/vue/useTranslatedProp.test.d.ts +2 -0
  48. package/dist/vue/useTranslatedProp.test.d.ts.map +1 -0
  49. package/dist/vue.js +36 -2
  50. package/dist/web-components/editor/InlineText.d.ts +1 -0
  51. package/dist/web-components/editor/InlineText.d.ts.map +1 -1
  52. package/dist/web-components-editor.js +13 -5
  53. package/dist/web-components-runtime.js +2 -2
  54. package/package.json +1 -1
@@ -2,11 +2,11 @@ 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 { i as injectContext, C as ContextRoot } from "./block-BjJztStr.js";
5
- import { V as ViewLayoutController, E as ExtensionRoot, B as Block } from "./ExtensionRoot-DRpD5EcC.js";
5
+ import { V as ViewLayoutController, E as ExtensionRoot, B as Block } from "./ExtensionRoot-CG9dH98z.js";
6
6
  import { canvasMode, getActiveSurfaceContext, emitLayoutSetRects, effect } from "@juo/blocks";
7
7
  import { getLayoutModeAdapter } from "./layout-mode-adapter-BBd4JRQd.js";
8
8
  import { a as createEditorBridge, n as createFocusInlineTextMessage, K as createUpdateBlockTranslationMessage } from "./bridge-Mz0CqG6E.js";
9
- import { T as TranslationContext } from "./css-runtime-B7tZrBIp.js";
9
+ import { T as TranslationContext } from "./css-runtime-CjZl0K48.js";
10
10
  import { i as initMorphController } from "./morph-CT5hc5Qp.js";
11
11
  class EditorLayoutController {
12
12
  constructor() {
@@ -111,6 +111,9 @@ const _InlineText = class _InlineText extends HTMLElement {
111
111
  __publicField(this, "boundHandlePointerDown", this.handlePointerDown.bind(this));
112
112
  __publicField(this, "boundHandleClick", this.handleClick.bind(this));
113
113
  __publicField(this, "lastValue", null);
114
+ // The text the block itself rendered (its prop value), used when the catalog
115
+ // has no translation for this key. Survives DOM moves — see initializeEditorMode.
116
+ __publicField(this, "fallbackText", null);
114
117
  __publicField(this, "dispose");
115
118
  // One-time DOM/style setup guard — see initializeEditorMode. Persists across
116
119
  // DOM moves so reconnecting (e.g. exiting layout mode) skips redundant,
@@ -178,17 +181,22 @@ const _InlineText = class _InlineText extends HTMLElement {
178
181
  this.addEventListener("blur", this.boundHandleBlur);
179
182
  this.addEventListener("pointerdown", this.boundHandlePointerDown);
180
183
  this.addEventListener("click", this.boundHandleClick);
181
- this.lastValue = this.textContent || "";
184
+ const rendered = this.textContent ?? "";
185
+ if (this.fallbackText == null || rendered !== this.lastValue) {
186
+ this.fallbackText = rendered;
187
+ }
188
+ this.lastValue = rendered;
182
189
  if (this.translationService && this.propName && this.blockType && this.blockId) {
183
190
  const key = this.propName;
184
- const fallbackText = this.textContent ?? "";
185
191
  this.dispose = effect(() => {
186
192
  const service = this.translationService;
187
193
  if (!service) return;
188
194
  void service.locale.value;
189
195
  const resolved = service.resolve(this.blockType, this.blockId, key);
190
196
  const isMissing = resolved === key || this.hasAttribute("fallback-on-empty") && resolved.trim() === "";
197
+ const fallbackText = this.fallbackText ?? "";
191
198
  const value = isMissing && fallbackText.trim().length > 0 ? fallbackText : resolved;
199
+ if (this.contentEditable === "plaintext-only") return;
192
200
  this.textContent = value;
193
201
  this.lastValue = value;
194
202
  });
@@ -299,7 +307,7 @@ initMorphController();
299
307
  void (async () => {
300
308
  try {
301
309
  const [{ createGridStackAdapter }, { registerLayoutModeAdapter }] = await Promise.all([
302
- import("./gridstack-adapter-BGKGC-eO.js"),
310
+ import("./gridstack-adapter-C1Q8gbsH.js"),
303
311
  import("./layout-mode-adapter-BBd4JRQd.js")
304
312
  ]);
305
313
  registerLayoutModeAdapter(createGridStackAdapter());
@@ -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 { i as injectContext, C as ContextRoot } from "./block-BjJztStr.js";
5
- import { E as ExtensionRoot, B as Block } from "./ExtensionRoot-DRpD5EcC.js";
5
+ import { E as ExtensionRoot, B as Block } from "./ExtensionRoot-CG9dH98z.js";
6
6
  import { effect } from "@juo/blocks";
7
- import { T as TranslationContext } from "./css-runtime-B7tZrBIp.js";
7
+ import { T as TranslationContext } from "./css-runtime-CjZl0K48.js";
8
8
  class InlineText extends HTMLElement {
9
9
  constructor() {
10
10
  super(...arguments);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@juo/blocks",
3
3
  "private": false,
4
- "version": "2.0.0-alpha.5",
4
+ "version": "2.0.0-alpha.6",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"