@bloklabs/angular 1.10.1 → 1.12.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.
@@ -2247,6 +2247,9 @@ const DATA_ATTR = {
2247
2247
  * inserting blocks into the DOM; removed while a re-render is in flight.
2248
2248
  * Acts as a stable render-readiness gate for consumers (e.g. E2E waits). */
2249
2249
  rendered: 'data-blok-rendered',
2250
+ /** Blok version number stamped on the editor wrapper (e.g. '1.10.0', 'dev').
2251
+ * Consumed by browser extensions to identify the running version. */
2252
+ version: 'data-blok-version',
2250
2253
  // ============================================
2251
2254
  // Block Identifiers
2252
2255
  // ============================================
@@ -2293,6 +2296,11 @@ const DATA_ATTR = {
2293
2296
  * Public styling hook — drives the gutter auto-collapse (the gutter
2294
2297
  * exists solely to house the toolbar's +/⠿ controls). */
2295
2298
  toolbarHidden: 'data-blok-toolbar-hidden',
2299
+ /** Which gutter the floating block controls occupy: 'left' (default,
2300
+ * inline-start) or 'right' (inline-end). Written on the editor wrapper from
2301
+ * config.toolbarPosition and kept in sync by `toolbar.setPosition()`.
2302
+ * Public styling hook — drives the gutter swap and the actions-bar side. */
2303
+ toolbarPosition: 'data-blok-toolbar-position',
2296
2304
  // ============================================
2297
2305
  // Editor Modes
2298
2306
  // ============================================
@@ -2307,6 +2315,11 @@ const DATA_ATTR = {
2307
2315
  * and re-points the fake-background highlight at the UA Highlight color
2308
2316
  * (colors.css), so selection falls back to native/host-defined colors. */
2309
2317
  nativeSelection: 'data-blok-native-selection',
2318
+ /** Present on the editor wrapper while a cross-block TEXT selection is painted.
2319
+ * Suppresses the engine's own ::selection paint (main.css) so the
2320
+ * ::highlight() sub-ranges are the only thing drawn — Chromium and Firefox
2321
+ * paint such a range natively too and would otherwise double it up. */
2322
+ crossSelection: 'data-blok-cross-selection',
2310
2323
  // ============================================
2311
2324
  // Drag and Drop
2312
2325
  // ============================================
@@ -2323,6 +2336,10 @@ const DATA_ATTR = {
2323
2336
  // ============================================
2324
2337
  /** Toolbar element */
2325
2338
  toolbar: 'data-blok-toolbar',
2339
+ /** The floating block-controls bar (plus button + drag/settings handle)
2340
+ * inside the toolbar. Public styling hook — the side it docks to is driven
2341
+ * from the wrapper's `data-blok-toolbar-position`. */
2342
+ toolbarActions: 'data-blok-toolbar-actions',
2326
2343
  /** Settings toggler button */
2327
2344
  settingsToggler: 'data-blok-settings-toggler',
2328
2345
  /** Toolbox is open */
@@ -2924,10 +2941,11 @@ const BlockChildrenMounted = 'block:childrenMounted';
2924
2941
  * `BlokEditor`). Delegates instance lifecycle to an internal `BlokContentDirective`
2925
2942
  * and layers the typed reactive input/output API on top.
2926
2943
  *
2927
- * Reactive inputs (`readOnly`, `hideToolbar`, `inlineToolbar`, `theme`,
2928
- * `width`, `placeholder`, `autofocus`, `styleTokens`, `i18n`, `data`) are
2929
- * synced in place after mount via effects — `hideToolbar` through
2930
- * `editor.toolbar.setHidden()`, `inlineToolbar` through
2944
+ * Reactive inputs (`readOnly`, `hideToolbar`, `toolbarPosition`,
2945
+ * `inlineToolbar`, `theme`, `width`, `placeholder`, `autofocus`, `styleTokens`,
2946
+ * `i18n`, `data`) are synced in place after mount via effects — `hideToolbar`
2947
+ * through `editor.toolbar.setHidden()`, `toolbarPosition` through
2948
+ * `editor.toolbar.setPosition()`, `inlineToolbar` through
2931
2949
  * `editor.tools.setInlineToolbar()` (content-compared),
2932
2950
  * `styleTokens` through `editor.tokens.set()` (replace semantics),
2933
2951
  * `i18n` through `editor.i18n.update()` (deep-equal–deduped; seeded at
@@ -3000,6 +3018,11 @@ class BlokEditorComponent {
3000
3018
  set hideToolbar(value) {
3001
3019
  this.hideToolbar$.set(value);
3002
3020
  }
3021
+ toolbarPosition$ = signal(undefined, /* @ts-ignore */
3022
+ ...(ngDevMode ? [{ debugName: "toolbarPosition$" }] : /* istanbul ignore next */ []));
3023
+ set toolbarPosition(value) {
3024
+ this.toolbarPosition$.set(value);
3025
+ }
3003
3026
  inlineToolbar$ = signal(undefined, /* @ts-ignore */
3004
3027
  ...(ngDevMode ? [{ debugName: "inlineToolbar$" }] : /* istanbul ignore next */ []));
3005
3028
  set inlineToolbar(value) {
@@ -3198,6 +3221,10 @@ class BlokEditorComponent {
3198
3221
  if (hideToolbar !== undefined) {
3199
3222
  cfg.hideToolbar = hideToolbar;
3200
3223
  }
3224
+ const toolbarPosition = this.toolbarPosition$();
3225
+ if (toolbarPosition !== undefined) {
3226
+ cfg.toolbarPosition = toolbarPosition;
3227
+ }
3201
3228
  const inlineToolbar = this.inlineToolbar$();
3202
3229
  if (inlineToolbar !== undefined) {
3203
3230
  cfg.inlineToolbar = inlineToolbar;
@@ -3378,6 +3405,13 @@ class BlokEditorComponent {
3378
3405
  editor.toolbar.setHidden(hideToolbar);
3379
3406
  }
3380
3407
  });
3408
+ effect(() => {
3409
+ const editor = this.instance();
3410
+ const toolbarPosition = this.toolbarPosition$();
3411
+ if (editor && toolbarPosition !== undefined) {
3412
+ editor.toolbar.setPosition(toolbarPosition);
3413
+ }
3414
+ });
3381
3415
  // Content-compared (not identity): a new array with the same tool names is
3382
3416
  // a no-op, so template-inline array literals don't thrash the assignment.
3383
3417
  effect(() => {
@@ -3538,7 +3572,7 @@ class BlokEditorComponent {
3538
3572
  this.readOnly$.set(isDisabled);
3539
3573
  }
3540
3574
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: BlokEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
3541
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.7", type: BlokEditorComponent, isStandalone: true, selector: "blok-editor", inputs: { onBeforeRender: "onBeforeRender", onBeforePaste: "onBeforePaste", onError: "onError", readOnly: "readOnly", hideToolbar: "hideToolbar", inlineToolbar: "inlineToolbar", theme: "theme", width: "width", placeholder: "placeholder", styleTokens: "styleTokens", i18n: "i18n", autofocus: "autofocus", data: "data", tools: "tools", migrations: "migrations", config: "config", recreateKey: "recreateKey" }, outputs: { ready: "ready", dataChange: "dataChange", save: "save", change: "change", afterRender: "afterRender", themeChange: "themeChange", blocksRendered: "blocksRendered", blockRendered: "blockRendered" }, providers: [
3575
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.7", type: BlokEditorComponent, isStandalone: true, selector: "blok-editor", inputs: { onBeforeRender: "onBeforeRender", onBeforePaste: "onBeforePaste", onError: "onError", readOnly: "readOnly", hideToolbar: "hideToolbar", toolbarPosition: "toolbarPosition", inlineToolbar: "inlineToolbar", theme: "theme", width: "width", placeholder: "placeholder", styleTokens: "styleTokens", i18n: "i18n", autofocus: "autofocus", data: "data", tools: "tools", migrations: "migrations", config: "config", recreateKey: "recreateKey" }, outputs: { ready: "ready", dataChange: "dataChange", save: "save", change: "change", afterRender: "afterRender", themeChange: "themeChange", blocksRendered: "blocksRendered", blockRendered: "blockRendered" }, providers: [
3542
3576
  {
3543
3577
  provide: NG_VALUE_ACCESSOR,
3544
3578
  useExisting: forwardRef(() => BlokEditorComponent),
@@ -3592,6 +3626,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
3592
3626
  type: Input
3593
3627
  }], hideToolbar: [{
3594
3628
  type: Input
3629
+ }], toolbarPosition: [{
3630
+ type: Input
3595
3631
  }], inlineToolbar: [{
3596
3632
  type: Input
3597
3633
  }], theme: [{