@ngstarter-ui/components 22.2.3 → 22.2.4

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 (55) hide show
  1. package/ai/component-registry.json +22 -0
  2. package/content-editor/BLOCK_FORMAT.md +144 -0
  3. package/fesm2022/ngstarter-ui-components-content-editor-attachment-block-rzZKJ2JH.mjs +35 -0
  4. package/fesm2022/ngstarter-ui-components-content-editor-attachment-block-rzZKJ2JH.mjs.map +1 -0
  5. package/fesm2022/{ngstarter-ui-components-content-editor-callout-block-Jbf8h2yz.mjs → ngstarter-ui-components-content-editor-callout-block-DTdApN0r.mjs} +2 -3
  6. package/fesm2022/{ngstarter-ui-components-content-editor-callout-block-Jbf8h2yz.mjs.map → ngstarter-ui-components-content-editor-callout-block-DTdApN0r.mjs.map} +1 -1
  7. package/fesm2022/{ngstarter-ui-components-content-editor-code-block.component-BizHRPdC.mjs → ngstarter-ui-components-content-editor-code-block.component-DpONkTMU.mjs} +2 -2
  8. package/fesm2022/{ngstarter-ui-components-content-editor-code-block.component-BizHRPdC.mjs.map → ngstarter-ui-components-content-editor-code-block.component-DpONkTMU.mjs.map} +1 -1
  9. package/fesm2022/{ngstarter-ui-components-content-editor-embed-block-BzoaJvai.mjs → ngstarter-ui-components-content-editor-embed-block-CmhzpaRk.mjs} +2 -2
  10. package/fesm2022/{ngstarter-ui-components-content-editor-embed-block-BzoaJvai.mjs.map → ngstarter-ui-components-content-editor-embed-block-CmhzpaRk.mjs.map} +1 -1
  11. package/fesm2022/{ngstarter-ui-components-content-editor-gallery-block-C4p-S0Do.mjs → ngstarter-ui-components-content-editor-gallery-block-gtH7yWd5.mjs} +16 -39
  12. package/fesm2022/ngstarter-ui-components-content-editor-gallery-block-gtH7yWd5.mjs.map +1 -0
  13. package/fesm2022/{ngstarter-ui-components-content-editor-grid-block-Cdq_Dcv2.mjs → ngstarter-ui-components-content-editor-grid-block-Pb-xV7Pw.mjs} +3 -4
  14. package/fesm2022/{ngstarter-ui-components-content-editor-grid-block-Cdq_Dcv2.mjs.map → ngstarter-ui-components-content-editor-grid-block-Pb-xV7Pw.mjs.map} +1 -1
  15. package/fesm2022/{ngstarter-ui-components-content-editor-heading-block.component-CDSt4rXe.mjs → ngstarter-ui-components-content-editor-heading-block.component-BKe9Zy_x.mjs} +2 -2
  16. package/fesm2022/{ngstarter-ui-components-content-editor-heading-block.component-CDSt4rXe.mjs.map → ngstarter-ui-components-content-editor-heading-block.component-BKe9Zy_x.mjs.map} +1 -1
  17. package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-DSpBVTu-.mjs +113 -0
  18. package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-DSpBVTu-.mjs.map +1 -0
  19. package/fesm2022/{ngstarter-ui-components-content-editor-list-block.component-CdQ30RjA.mjs → ngstarter-ui-components-content-editor-list-block.component-BPKPE1uY.mjs} +2 -2
  20. package/fesm2022/{ngstarter-ui-components-content-editor-list-block.component-CdQ30RjA.mjs.map → ngstarter-ui-components-content-editor-list-block.component-BPKPE1uY.mjs.map} +1 -1
  21. package/fesm2022/{ngstarter-ui-components-content-editor-nested-blocks-CbZY0keH.mjs → ngstarter-ui-components-content-editor-nested-blocks-Dh-p3WMp.mjs} +4 -4
  22. package/fesm2022/ngstarter-ui-components-content-editor-nested-blocks-Dh-p3WMp.mjs.map +1 -0
  23. package/fesm2022/{ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CK4ssnlk.mjs → ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CR-NrarE.mjs} +2021 -1505
  24. package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CR-NrarE.mjs.map +1 -0
  25. package/fesm2022/{ngstarter-ui-components-content-editor-paragraph-block.component-Dd0pQquG.mjs → ngstarter-ui-components-content-editor-paragraph-block.component-D5wS3m6O.mjs} +2 -2
  26. package/fesm2022/{ngstarter-ui-components-content-editor-paragraph-block.component-Dd0pQquG.mjs.map → ngstarter-ui-components-content-editor-paragraph-block.component-D5wS3m6O.mjs.map} +1 -1
  27. package/fesm2022/{ngstarter-ui-components-content-editor-quote-block.component-CUxKoeb_.mjs → ngstarter-ui-components-content-editor-quote-block.component-C3GFAGKF.mjs} +2 -2
  28. package/fesm2022/{ngstarter-ui-components-content-editor-quote-block.component-CUxKoeb_.mjs.map → ngstarter-ui-components-content-editor-quote-block.component-C3GFAGKF.mjs.map} +1 -1
  29. package/fesm2022/{ngstarter-ui-components-content-editor-table-block.component-BTExrXy8.mjs → ngstarter-ui-components-content-editor-table-block.component-DQgs_kyN.mjs} +2 -2
  30. package/fesm2022/{ngstarter-ui-components-content-editor-table-block.component-BTExrXy8.mjs.map → ngstarter-ui-components-content-editor-table-block.component-DQgs_kyN.mjs.map} +1 -1
  31. package/fesm2022/{ngstarter-ui-components-content-editor-toggle-block-B46YeMGQ.mjs → ngstarter-ui-components-content-editor-toggle-block-Cb67ChE8.mjs} +3 -4
  32. package/fesm2022/{ngstarter-ui-components-content-editor-toggle-block-B46YeMGQ.mjs.map → ngstarter-ui-components-content-editor-toggle-block-Cb67ChE8.mjs.map} +1 -1
  33. package/fesm2022/ngstarter-ui-components-content-editor-upload-status-QnKI_Rfz.mjs +19 -0
  34. package/fesm2022/ngstarter-ui-components-content-editor-upload-status-QnKI_Rfz.mjs.map +1 -0
  35. package/fesm2022/ngstarter-ui-components-content-editor-video-block.component-CRa0g9Ez.mjs +134 -0
  36. package/fesm2022/ngstarter-ui-components-content-editor-video-block.component-CRa0g9Ez.mjs.map +1 -0
  37. package/fesm2022/ngstarter-ui-components-content-editor.mjs +1 -1
  38. package/fesm2022/ngstarter-ui-components-headless-editor.mjs +57 -0
  39. package/fesm2022/ngstarter-ui-components-headless-editor.mjs.map +1 -1
  40. package/package.json +1 -1
  41. package/types/ngstarter-ui-components-content-editor.d.ts +205 -10
  42. package/types/ngstarter-ui-components-headless-editor.d.ts +6 -1
  43. package/fesm2022/ngstarter-ui-components-content-editor-attachment-block-DlUkhwCu.mjs +0 -54
  44. package/fesm2022/ngstarter-ui-components-content-editor-attachment-block-DlUkhwCu.mjs.map +0 -1
  45. package/fesm2022/ngstarter-ui-components-content-editor-block-base-C46lyMrp.mjs +0 -47
  46. package/fesm2022/ngstarter-ui-components-content-editor-block-base-C46lyMrp.mjs.map +0 -1
  47. package/fesm2022/ngstarter-ui-components-content-editor-gallery-block-C4p-S0Do.mjs.map +0 -1
  48. package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-LfKZapgv.mjs +0 -169
  49. package/fesm2022/ngstarter-ui-components-content-editor-image-block.component-LfKZapgv.mjs.map +0 -1
  50. package/fesm2022/ngstarter-ui-components-content-editor-nested-blocks-CbZY0keH.mjs.map +0 -1
  51. package/fesm2022/ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CK4ssnlk.mjs.map +0 -1
  52. package/fesm2022/ngstarter-ui-components-content-editor-upload-block-base-DKqojf--.mjs +0 -29
  53. package/fesm2022/ngstarter-ui-components-content-editor-upload-block-base-DKqojf--.mjs.map +0 -1
  54. package/fesm2022/ngstarter-ui-components-content-editor-video-block.component-hBR5AauH.mjs +0 -201
  55. package/fesm2022/ngstarter-ui-components-content-editor-video-block.component-hBR5AauH.mjs.map +0 -1
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ngstarter-ui/components",
3
3
  "description": "NgStarter - AI-friendly Enterprise Angular UI Components and Admin Panel",
4
- "version": "22.2.3",
4
+ "version": "22.2.4",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/elementarlabsdev/ngstarter.git"
@@ -1,7 +1,7 @@
1
1
  import * as _angular_core from '@angular/core';
2
2
  import { InjectionToken, Signal, Type, InputSignal, EnvironmentProviders, OnDestroy, OnInit, AfterViewInit, EventEmitter, ViewContainerRef, ElementRef, Renderer2, NgZone, Provider } from '@angular/core';
3
3
  import * as _ngstarter_ui_components_headless_editor from '@ngstarter-ui/components/headless-editor';
4
- import { NgsHeadlessEditor, NgsHeadlessEditorMark, NgsHeadlessEditorBlock, NgsHeadlessEditorText, NgsHeadlessEditorDocument, NgsHeadlessEditorMarkDefinition } from '@ngstarter-ui/components/headless-editor';
4
+ import { NgsHeadlessEditor, NgsHeadlessEditorMark, NgsHeadlessEditorBlock, NgsHeadlessEditorText, NgsHeadlessEditorDocument, NgsHeadlessEditorMarkDefinition, NgsHeadlessEditorChangeOrigin, NgsHeadlessEditorSelection } from '@ngstarter-ui/components/headless-editor';
5
5
  import * as _ngstarter_ui_components_content_editor from '@ngstarter-ui/components/content-editor';
6
6
  import { CdkDropList, CdkDragDrop, CdkDrag, CdkDragStart } from '@angular/cdk/drag-drop';
7
7
  import { Menu, MenuCloseReason } from '@ngstarter-ui/components/menu';
@@ -154,7 +154,13 @@ interface ContentEditorBlockInsertionTarget {
154
154
  scope: ContentEditorBlockScope;
155
155
  afterId?: string;
156
156
  }
157
- type ContentEditorUploadFn = (file: File, dataUrl: string) => Promise<string>;
157
+ interface ContentEditorUploadContext {
158
+ /** Abort the transport when cancelled, replaced or the block is removed. */
159
+ signal: AbortSignal;
160
+ /** Report transport progress from 0 to 100; omit for indeterminate progress. */
161
+ onProgress(percent: number): void;
162
+ }
163
+ type ContentEditorUploadFn = (file: File, dataUrl: string, context: ContentEditorUploadContext) => Promise<string>;
158
164
  /** UI input view of a native document block. Never used as the saved document. */
159
165
  interface ContentEditorBlockView {
160
166
  id: string;
@@ -262,6 +268,35 @@ interface ContentEditorBlockRendererInputSignals<TContent = unknown, TSettings =
262
268
  index: InputSignal<number>;
263
269
  }
264
270
 
271
+ type ContentEditorDraftStatus = 'disabled' | 'idle' | 'saving' | 'saved' | 'error';
272
+ interface ContentEditorDraftStorage {
273
+ getItem(key: string): string | null;
274
+ setItem(key: string, value: string): void;
275
+ removeItem(key: string): void;
276
+ }
277
+ interface ContentEditorDraftConfig {
278
+ storage?: ContentEditorDraftStorage;
279
+ debounceMs?: number;
280
+ }
281
+ /** Delayed persistence keeps storage errors visible and flushes before switching documents. */
282
+ declare class ContentEditorDraftController {
283
+ readonly status: _angular_core.WritableSignal<ContentEditorDraftStatus>;
284
+ readonly error: _angular_core.WritableSignal<string>;
285
+ readonly savedAt: _angular_core.WritableSignal<number | null>;
286
+ private key;
287
+ private storage;
288
+ private debounceMs;
289
+ private enabled;
290
+ private pending;
291
+ private timer;
292
+ configure(key: string, enabled: boolean, config?: ContentEditorDraftConfig): void;
293
+ read(validate: (source: unknown) => ContentEditorDocument): ContentEditorDocument | null;
294
+ schedule(document: ContentEditorDocument): void;
295
+ flush(): void;
296
+ clear(): void;
297
+ private fail;
298
+ }
299
+
265
300
  interface ContentEditorImportOptions {
266
301
  /** Maximum JSON/HTML nesting depth. Default: 64. */
267
302
  maxDepth?: number;
@@ -270,6 +305,12 @@ interface ContentEditorImportOptions {
270
305
  /** Preserve application-defined JSON block types. Default: false. */
271
306
  allowUnknownBlocks?: boolean;
272
307
  }
308
+ interface ContentEditorImportPlacement {
309
+ /** Replace the document (default), or insert into a block collection. */
310
+ mode?: 'replace' | 'insert';
311
+ /** Defaults to the active collection and block when inserting. */
312
+ target?: ContentEditorBlockInsertionTarget;
313
+ }
273
314
  interface ContentEditorHtmlImportOptions extends ContentEditorImportOptions {
274
315
  /** A DOM document supplied by the application, useful for server-side parsers. */
275
316
  document?: Document;
@@ -298,6 +339,19 @@ declare class ContentEditorImportError extends Error {
298
339
  type ContentEditorImportMarkDefinition = NgsHeadlessEditorMarkDefinition;
299
340
 
300
341
  interface ContentEditorBlockConfig {
342
+ /** Eager component, or loadEditor for lazy loading; the lazy loader takes precedence. */
343
+ editor?: Type<unknown>;
344
+ loadEditor?: () => Promise<Type<unknown>>;
345
+ renderer?: Type<unknown>;
346
+ /** Native initial data. The editor supplies a fresh id and the configured type. */
347
+ create?: () => Pick<ContentEditorBlock, 'content' | 'attrs'>;
348
+ /** Adds the block to the global insertion menu. */
349
+ menu?: {
350
+ title: string;
351
+ description?: string;
352
+ iconName?: string;
353
+ settings?: Readonly<Record<string, unknown>>;
354
+ };
301
355
  toHtml?: ContentEditorBlockHtmlConverter;
302
356
  fromHtml?: ContentEditorBlockHtmlImporter;
303
357
  validateImport?: ContentEditorBlockImportValidator;
@@ -307,17 +361,25 @@ interface ContentEditorConfig {
307
361
  blocks?: Readonly<Record<string, ContentEditorBlockConfig>>;
308
362
  marks?: Readonly<Record<string, ContentEditorMarkHtmlConverter>>;
309
363
  includeStyles?: boolean;
364
+ draft?: ContentEditorDraftConfig;
310
365
  /** Additional or overridden mark definitions used when importing HTML. */
311
366
  importMarks?: readonly ContentEditorImportMarkDefinition[];
312
367
  /** Unknown blocks throw by default to avoid silently losing saved content. */
313
368
  unknownBlockToHtml?: ContentEditorBlockHtmlConverter;
314
369
  }
370
+ /** Nested renderers inherit per-instance configuration through their parent. */
371
+ declare const CONTENT_EDITOR_RENDER_CONFIG: InjectionToken<Signal<ContentEditorConfig>>;
315
372
  declare const CONTENT_EDITOR_CONFIG: InjectionToken<ContentEditorConfig>;
316
373
  /** Later configurations override individual block fields, preserving unrelated options. */
317
374
  declare function mergeContentEditorConfig(...configs: readonly ContentEditorConfig[]): ContentEditorConfig;
318
375
  /** Application or route environment configuration. Child environments inherit parent settings. */
319
376
  declare function provideContentEditorConfig(config?: ContentEditorConfig): EnvironmentProviders;
320
377
 
378
+ type ContentEditorConvertibleBlockType = 'paragraph' | 'heading' | 'quote' | 'callout';
379
+ declare const CONTENT_EDITOR_CONVERTIBLE_BLOCKS: readonly ContentEditorConvertibleBlockType[];
380
+ /** Retains identity, rich text and alignment. Quote attribution becomes a final line. */
381
+ declare function contentEditorConvertBlock(block: ContentEditorBlock, type: ContentEditorConvertibleBlockType, settings?: Readonly<Record<string, unknown>>): ContentEditorBlock;
382
+
321
383
  /**
322
384
  * Directive to enable mouse-drag selection of child blocks inside a container.
323
385
  *
@@ -363,8 +425,17 @@ declare class ContentBuilderComponent implements OnInit, AfterViewInit, OnDestro
363
425
  private readonly importer;
364
426
  readonly config: _angular_core.InputSignal<ContentEditorConfig>;
365
427
  /** One insertion menu shared by root controls, nested collections and custom blocks. */
428
+ readonly conversionMenu: _angular_core.Signal<Menu>;
429
+ readonly conversionTypes: readonly ContentEditorConvertibleBlockType[];
366
430
  readonly blockMenu: _angular_core.Signal<Menu>;
367
431
  private readonly document;
432
+ private readonly drafts;
433
+ readonly draftStatus: _angular_core.WritableSignal<_ngstarter_ui_components_content_editor.ContentEditorDraftStatus>;
434
+ readonly draftError: _angular_core.WritableSignal<string>;
435
+ readonly draftSavedAt: _angular_core.WritableSignal<number | null>;
436
+ readonly documentId: _angular_core.InputSignal<string | undefined>;
437
+ readonly draftDebounceMs: _angular_core.InputSignalWithTransform<number | undefined, unknown>;
438
+ private draftKey;
368
439
  private loaded;
369
440
  private lastInput;
370
441
  private _platformId;
@@ -395,12 +466,15 @@ declare class ContentBuilderComponent implements OnInit, AfterViewInit, OnDestro
395
466
  protected blockDefsOptionsMap: Map<string, any>;
396
467
  protected _blockDragging: _angular_core.WritableSignal<boolean>;
397
468
  isSelectionOfBlocksActive: _angular_core.WritableSignal<boolean>;
398
- readonly selectedBlocksModel: SelectionModel<unknown>;
469
+ readonly selectedBlocksModel: SelectionModel<string>;
399
470
  commandBar: typeof CommandBarComponent;
400
471
  get api(): {
401
472
  focusChanged: EventEmitter<void>;
402
473
  };
474
+ readonly insertionSuggestions: _angular_core.Signal<any[]>;
475
+ private readonly componentSources;
403
476
  private buildBlockDefMaps;
477
+ private resolvedBlockDefs;
404
478
  /** Shared by nested block collections; all edits use this root editor. */
405
479
  get rootBuilder(): ContentBuilderComponent;
406
480
  getBlockComponent(type: string): any;
@@ -426,6 +500,8 @@ declare class ContentBuilderComponent implements OnInit, AfterViewInit, OnDestro
426
500
  insertBlock(type: string, index: number, options?: object, focus?: boolean, content?: any): ContentEditorBlock;
427
501
  private _createBlock;
428
502
  addBlock(type: string, options: object, index?: number): void;
503
+ canConvertBlock(id: string): boolean;
504
+ convertBlock(id: string, type: ContentEditorConvertibleBlockType, settings?: Readonly<Record<string, unknown>>): boolean;
429
505
  duplicateBlock(blockId: string): void;
430
506
  private regenerateChildIds;
431
507
  duplicateSelectedBlocks(popover: Popover): void;
@@ -441,9 +517,12 @@ declare class ContentBuilderComponent implements OnInit, AfterViewInit, OnDestro
441
517
  readonly canEnterRoot: (_drag: CdkDrag, drop: CdkDropList) => boolean;
442
518
  onTagSelected(tagName: string | null): void;
443
519
  getData(): _ngstarter_ui_components_headless_editor.NgsHeadlessEditorDocument;
520
+ /** Structural HTML paste splits the active text block without flattening lists/tables. */
521
+ pasteBlocksAtSelection(id: string, imported: ContentEditorDocument, start: number, end: number): boolean;
444
522
  /** Validates before replacing the document. Import is one undoable edit. */
445
- importJson(source: unknown, config?: ContentEditorConfig, options?: ContentEditorImportOptions): ContentEditorDocument;
446
- importHtml(html: string, config?: ContentEditorConfig, options?: ContentEditorHtmlImportOptions): ContentEditorDocument;
523
+ importJson(source: unknown, config?: ContentEditorConfig, options?: ContentEditorImportOptions & ContentEditorImportPlacement): ContentEditorDocument;
524
+ importHtml(html: string, config?: ContentEditorConfig, options?: ContentEditorHtmlImportOptions & ContentEditorImportPlacement): ContentEditorDocument;
525
+ getInsertionTarget(): ContentEditorBlockInsertionTarget;
447
526
  private applyImport;
448
527
  /** Exports the live document, including nested blocks, through the configured converters. */
449
528
  toHtml(config?: ContentEditorConfig): string;
@@ -463,18 +542,19 @@ declare class ContentBuilderComponent implements OnInit, AfterViewInit, OnDestro
463
542
  protected onFocusChange(origin: string | null, dataBlock: ContentEditorBlockView): void;
464
543
  protected onSuggestionsMenuClose(reason: MenuCloseReason): void;
465
544
  ngOnDestroy(): void;
545
+ private configureDraft;
466
546
  private _getDraftContent;
467
547
  private _saveDraft;
548
+ saveDraftNow(): void;
549
+ clearDraft(): void;
468
550
  private _canUseDraftStorage;
469
551
  private _getDraftStorageKey;
470
552
  onSettingsPopoverClose(): void;
471
553
  protected _onPaste(event: ClipboardEvent): void;
472
554
  private _handleTextPaste;
473
555
  private _handleHtmlPaste;
474
- private _mapNodeToBlock;
475
- private _mapListItems;
476
556
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ContentBuilderComponent, never>;
477
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<ContentBuilderComponent, "ngs-content-editor-builder", ["ngsContentEditorBuilder"], { "config": { "alias": "config"; "required": false; "isSignal": true; }; "content": { "alias": "content"; "required": false; "isSignal": true; }; "contentChangedDelay": { "alias": "contentChangedDelay"; "required": false; "isSignal": true; }; "persistDraft": { "alias": "persistDraft"; "required": false; "isSignal": true; }; "suggestions": { "alias": "suggestions"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "scrollContainer": { "alias": "scrollContainer"; "required": false; "isSignal": true; }; }, { "contentChanged": "contentChanged"; }, never, never, true, [{ directive: typeof BlockSelectionDirective; inputs: { "autoScrollContainerSelector": "autoScrollContainerSelector"; }; outputs: {}; }]>;
557
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ContentBuilderComponent, "ngs-content-editor-builder", ["ngsContentEditorBuilder"], { "config": { "alias": "config"; "required": false; "isSignal": true; }; "documentId": { "alias": "documentId"; "required": false; "isSignal": true; }; "draftDebounceMs": { "alias": "draftDebounceMs"; "required": false; "isSignal": true; }; "content": { "alias": "content"; "required": false; "isSignal": true; }; "contentChangedDelay": { "alias": "contentChangedDelay"; "required": false; "isSignal": true; }; "persistDraft": { "alias": "persistDraft"; "required": false; "isSignal": true; }; "suggestions": { "alias": "suggestions"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "scrollContainer": { "alias": "scrollContainer"; "required": false; "isSignal": true; }; }, { "contentChanged": "contentChanged"; }, never, never, true, [{ directive: typeof BlockSelectionDirective; inputs: { "autoScrollContainerSelector": "autoScrollContainerSelector"; }; outputs: {}; }]>;
478
558
  }
479
559
 
480
560
  interface ContentEditorRenderItem {
@@ -483,6 +563,9 @@ interface ContentEditorRenderItem {
483
563
  inputs: ContentEditorBlockRendererInputs;
484
564
  }
485
565
  declare class ContentEditorRenderer {
566
+ private readonly globalConfig;
567
+ private readonly parentConfig;
568
+ readonly resolvedConfig: _angular_core.Signal<ContentEditorConfig>;
486
569
  private readonly htmlSerializer;
487
570
  readonly config: _angular_core.InputSignal<ContentEditorConfig>;
488
571
  private readonly providedRendererGroups;
@@ -770,6 +853,12 @@ declare function contentEditorCollection(blocks: readonly NgsHeadlessEditorBlock
770
853
  declare function replaceContentEditorCollection(blocks: NgsHeadlessEditorBlock[], scope: ContentEditorBlockScope, value: readonly NgsHeadlessEditorBlock[]): void;
771
854
  /** Mutable UI payloads must not mutate saved documents or undo snapshots. */
772
855
  declare function cloneContentEditorValue<T>(value: T): T;
856
+ /** Locates the collection owning a block, including deeply nested Grid/Toggle blocks. */
857
+ declare function contentEditorBlockScope(blocks: readonly NgsHeadlessEditorBlock[], id: string, scope?: ContentEditorBlockScope): ContentEditorBlockScope | null;
858
+ /** Copies for insertion/duplication receive fresh ids throughout the tree. */
859
+ declare function contentEditorCopyBlocks(blocks: readonly NgsHeadlessEditorBlock[]): NgsHeadlessEditorBlock[];
860
+ /** UTF-16 offsets match the editor selection model; marks remain on sliced runs. */
861
+ declare function contentEditorSliceText(content: ContentEditorText, start: number, end?: number): ContentEditorText;
773
862
 
774
863
  /** Parses and validates the native version-1 format without changing the caller's objects. */
775
864
  declare function contentEditorFromJson(source: unknown, config?: ContentEditorConfig, options?: ContentEditorImportOptions): ContentEditorDocument;
@@ -845,5 +934,111 @@ declare class ContentEditorGridRenderer extends ContentEditorRendererBase<Conten
845
934
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<ContentEditorGridRenderer, "ngs-content-editor-grid-renderer", never, {}, {}, never, never, true, never>;
846
935
  }
847
936
 
848
- export { BlockSelectionDirective, CONTENT_BUILDER, CONTENT_EDITOR_BLOCK, CONTENT_EDITOR_BLOCK_RENDERERS, CONTENT_EDITOR_CALLOUT_HTML_STYLES, CONTENT_EDITOR_CONFIG, CONTENT_EDITOR_DEFAULT_HTML_CONVERTERS, CONTENT_EDITOR_DEFAULT_RENDERERS, CONTENT_EDITOR_GALLERY_HTML_STYLES, CONTENT_EDITOR_GRID_HTML_STYLES, CommandBarComponent, ContentBuilderComponent, ContentEditorAttachmentRenderer, ContentEditorCalloutRenderer, ContentEditorCodeRenderer, ContentEditorDividerRenderer, ContentEditorEmbedRenderer, ContentEditorGalleryRenderer, ContentEditorGridRenderer, ContentEditorHeadingRenderer, ContentEditorHtmlSerializer, ContentEditorImageRenderer, ContentEditorImportError, ContentEditorImporter, ContentEditorListRenderer, ContentEditorParagraphRenderer, ContentEditorQuoteRenderer, ContentEditorRenderer, ContentEditorTableRenderer, ContentEditorToggleRenderer, ContentEditorVideoRenderer, TextSelectionPopupDirective, cloneContentEditorValue, contentEditorAttachmentToHtml, contentEditorBlockToHtml, contentEditorBlockView, contentEditorCalloutToHtml, contentEditorChildCollections, contentEditorCodeToHtml, contentEditorCollection, contentEditorDividerToHtml, contentEditorEmbedToHtml, contentEditorFromHtml, contentEditorFromJson, contentEditorGalleryToHtml, contentEditorGridToHtml, contentEditorHeadingToHtml, contentEditorImageToHtml, contentEditorListToHtml, contentEditorNativeBlock, contentEditorParagraphToHtml, contentEditorQuoteToHtml, contentEditorTableToHtml, contentEditorText, contentEditorToHtml, contentEditorToggleToHtml, contentEditorVideoToHtml, findContentEditorBlock, isContentEditorBlockEmpty, mergeContentEditorConfig, provideContentEditor, provideContentEditorConfig, provideContentEditorRenderer, provideContentEditorRenderers, replaceContentEditorCollection };
849
- export type { ContentEditorAttachmentContent, ContentEditorBlock, ContentEditorBlockConfig, ContentEditorBlockDef, ContentEditorBlockEmpty, ContentEditorBlockHtmlConverter, ContentEditorBlockHtmlImporter, ContentEditorBlockImportValidator, ContentEditorBlockInsertionTarget, ContentEditorBlockRendererDef, ContentEditorBlockRendererInputSignals, ContentEditorBlockRendererInputs, ContentEditorBlockScope, ContentEditorBlockView, ContentEditorBuiltinBlockType, ContentEditorCalloutSettings, ContentEditorCalloutVariant, ContentEditorCodeRendererSettings, ContentEditorConfig, ContentEditorDataBlock, ContentEditorDimension, ContentEditorDocument, ContentEditorEmbedBlockSettings, ContentEditorEmbedContent, ContentEditorGalleryContent, ContentEditorGalleryImage, ContentEditorGridCell, ContentEditorGridContent, ContentEditorGridGap, ContentEditorGridSettings, ContentEditorHeadingBlockSettings, ContentEditorHtmlContext, ContentEditorHtmlImportContext, ContentEditorHtmlImportOptions, ContentEditorHtmlUrlKind, ContentEditorImageBlockSettings, ContentEditorImageContent, ContentEditorImportMarkDefinition, ContentEditorImportOptions, ContentEditorItemProperty, ContentEditorListItem, ContentEditorListSettings, ContentEditorMarkHtmlConverter, ContentEditorOptions, ContentEditorQuoteContent, ContentEditorQuoteRendererContent, ContentEditorQuoteRendererContentPart, ContentEditorSuggestionHeading, ContentEditorSuggestionItem, ContentEditorTableAttributes, ContentEditorTableBlockSettings, ContentEditorTableCell, ContentEditorTableCellMetadata, ContentEditorText, ContentEditorToggleContent, ContentEditorToggleSettings, ContentEditorUploadFn, ContentEditorVideoBlockSettings, ContentEditorVideoContent, ISelectionPopupComponent };
937
+ interface ContentEditorUploadedFile {
938
+ file: File;
939
+ url: string;
940
+ dataUrl: string;
941
+ }
942
+ interface ContentEditorUploadRequest {
943
+ files: readonly File[];
944
+ upload: ContentEditorUploadFn;
945
+ accept?: (file: File) => boolean;
946
+ urlKind?: ContentEditorHtmlUrlKind;
947
+ maxFileSize?: number;
948
+ apply(results: readonly ContentEditorUploadedFile[]): void;
949
+ }
950
+ /** One cancellable request per block. Retry only sends failed files again. */
951
+ declare class ContentEditorUploadTask {
952
+ private readonly writable;
953
+ readonly uploading: _angular_core.WritableSignal<boolean>;
954
+ readonly progress: _angular_core.WritableSignal<number | null>;
955
+ readonly error: _angular_core.WritableSignal<string>;
956
+ readonly canRetry: _angular_core.WritableSignal<boolean>;
957
+ private controller;
958
+ private failed;
959
+ constructor(writable: () => boolean);
960
+ cancel(): void;
961
+ retry(): Promise<void>;
962
+ run(request: ContentEditorUploadRequest): Promise<void>;
963
+ }
964
+
965
+ /** UI state and block operations. The headless document is the only content store. */
966
+ declare class ContentBuilderStore {
967
+ readonly editor: NgsHeadlessEditor;
968
+ private dragging;
969
+ constructor();
970
+ private textEdit;
971
+ /** Scopes typing groups to one text region, so adjacent cells never share undo. */
972
+ withTextEdit(origin: NgsHeadlessEditorChangeOrigin, group: string, edit: () => void): void;
973
+ readonly insertionTarget: _angular_core.WritableSignal<ContentEditorBlockInsertionTarget>;
974
+ readonly restoreTextSelection: _angular_core.WritableSignal<{
975
+ blockId: string;
976
+ selection: NgsHeadlessEditorSelection;
977
+ } | null>;
978
+ readonly focusedBlockId: _angular_core.WritableSignal<string | null>;
979
+ readonly activeBlockId: _angular_core.WritableSignal<string | null>;
980
+ readonly dragPointer: _angular_core.WritableSignal<{
981
+ x: number;
982
+ y: number;
983
+ } | null>;
984
+ setDragging(dragging: boolean): void;
985
+ readonly dropLists: _angular_core.WritableSignal<CdkDropList<ContentEditorBlockScope>[]>;
986
+ registerDropList(list: CdkDropList<ContentEditorBlockScope>): void;
987
+ unregisterDropList(list: CdkDropList<ContentEditorBlockScope>): void;
988
+ readonly blocks: _angular_core.Signal<ContentEditorBlockView[]>;
989
+ setFocusedBlockId(id: string | null): void;
990
+ setActiveBlockId(id: string | null): void;
991
+ setBlocks(value: ContentEditorDocument): void;
992
+ addBlock(block: ContentEditorBlockView, index: number, scope?: ContentEditorBlockScope): void;
993
+ deleteBlock(id: string, _index: number): void;
994
+ deleteBlocks(ids: readonly string[]): void;
995
+ updateBlock(id: string, data: Partial<ContentEditorBlockView>): void;
996
+ moveBlock(from: number, to: number): void;
997
+ moveBetweenCollections(from: number, to: number, source: ContentEditorBlockScope, target: ContentEditorBlockScope): void;
998
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ContentBuilderStore, never>;
999
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<any>;
1000
+ }
1001
+
1002
+ /** Shared native inputs and root history for the built-in block editors. */
1003
+ declare abstract class ContentEditorBlockBase<T, S extends object = Record<string, unknown>> implements ContentEditorDataBlock {
1004
+ protected readonly store: ContentBuilderStore;
1005
+ protected readonly builder: ContentBuilderComponent;
1006
+ protected readonly element: HTMLElement;
1007
+ readonly id: _angular_core.InputSignal<string>;
1008
+ readonly content: _angular_core.InputSignal<T>;
1009
+ readonly settings: _angular_core.InputSignal<S>;
1010
+ readonly index: _angular_core.InputSignal<number>;
1011
+ readonly props: _angular_core.InputSignal<ContentEditorItemProperty[]>;
1012
+ readonly initialized: _angular_core.WritableSignal<boolean>;
1013
+ constructor();
1014
+ focus(): void;
1015
+ getData(): {
1016
+ content: T;
1017
+ settings: S;
1018
+ props: ContentEditorItemProperty[];
1019
+ };
1020
+ isEmpty(): boolean;
1021
+ protected save(content: T, settings?: S): void;
1022
+ protected latestContent(): T;
1023
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ContentEditorBlockBase<any, any>, never>;
1024
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ContentEditorBlockBase<any, any>, never, never, { "id": { "alias": "id"; "required": true; "isSignal": true; }; "content": { "alias": "content"; "required": true; "isSignal": true; }; "settings": { "alias": "settings"; "required": true; "isSignal": true; }; "index": { "alias": "index"; "required": false; "isSignal": true; }; "props": { "alias": "props"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
1025
+ }
1026
+
1027
+ declare abstract class ContentEditorUploadBlockBase<T, S extends object = Record<string, unknown>> extends ContentEditorBlockBase<T, S> {
1028
+ readonly uploadTask: ContentEditorUploadTask;
1029
+ readonly uploading: _angular_core.WritableSignal<boolean>;
1030
+ readonly error: _angular_core.WritableSignal<string>;
1031
+ constructor();
1032
+ protected uploadFiles(type: string, request: Omit<ContentEditorUploadRequest, 'upload' | 'maxFileSize'>): Promise<void>;
1033
+ cancelUpload(): void;
1034
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ContentEditorUploadBlockBase<any, any>, never>;
1035
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ContentEditorUploadBlockBase<any, any>, never, never, {}, {}, never, never, true, never>;
1036
+ }
1037
+
1038
+ /** Read files with actual cancellation and progress. */
1039
+ declare function readContentEditorFile(file: File, context?: ContentEditorUploadContext): Promise<string>;
1040
+ declare function contentEditorFileSize(size: number): string;
1041
+ declare function contentEditorResourceUrl(url: string): string;
1042
+
1043
+ export { BlockSelectionDirective, CONTENT_BUILDER, CONTENT_EDITOR_BLOCK, CONTENT_EDITOR_BLOCK_RENDERERS, CONTENT_EDITOR_CALLOUT_HTML_STYLES, CONTENT_EDITOR_CONFIG, CONTENT_EDITOR_CONVERTIBLE_BLOCKS, CONTENT_EDITOR_DEFAULT_HTML_CONVERTERS, CONTENT_EDITOR_DEFAULT_RENDERERS, CONTENT_EDITOR_GALLERY_HTML_STYLES, CONTENT_EDITOR_GRID_HTML_STYLES, CONTENT_EDITOR_RENDER_CONFIG, CommandBarComponent, ContentBuilderComponent, ContentEditorAttachmentRenderer, ContentEditorBlockBase, ContentEditorCalloutRenderer, ContentEditorCodeRenderer, ContentEditorDividerRenderer, ContentEditorDraftController, ContentEditorEmbedRenderer, ContentEditorGalleryRenderer, ContentEditorGridRenderer, ContentEditorHeadingRenderer, ContentEditorHtmlSerializer, ContentEditorImageRenderer, ContentEditorImportError, ContentEditorImporter, ContentEditorListRenderer, ContentEditorParagraphRenderer, ContentEditorQuoteRenderer, ContentEditorRenderer, ContentEditorRendererBase, ContentEditorTableRenderer, ContentEditorToggleRenderer, ContentEditorUploadBlockBase, ContentEditorUploadTask, ContentEditorVideoRenderer, TextSelectionPopupDirective, cloneContentEditorValue, contentEditorAttachmentToHtml, contentEditorBlockScope, contentEditorBlockToHtml, contentEditorBlockView, contentEditorCalloutToHtml, contentEditorChildCollections, contentEditorCodeToHtml, contentEditorCollection, contentEditorConvertBlock, contentEditorCopyBlocks, contentEditorDividerToHtml, contentEditorEmbedToHtml, contentEditorFileSize, contentEditorFromHtml, contentEditorFromJson, contentEditorGalleryToHtml, contentEditorGridToHtml, contentEditorHeadingToHtml, contentEditorImageToHtml, contentEditorListToHtml, contentEditorNativeBlock, contentEditorParagraphToHtml, contentEditorQuoteToHtml, contentEditorResourceUrl, contentEditorSliceText, contentEditorTableToHtml, contentEditorText, contentEditorToHtml, contentEditorToggleToHtml, contentEditorVideoToHtml, findContentEditorBlock, isContentEditorBlockEmpty, mergeContentEditorConfig, provideContentEditor, provideContentEditorConfig, provideContentEditorRenderer, provideContentEditorRenderers, readContentEditorFile, replaceContentEditorCollection };
1044
+ export type { ContentEditorAttachmentContent, ContentEditorBlock, ContentEditorBlockConfig, ContentEditorBlockDef, ContentEditorBlockEmpty, ContentEditorBlockHtmlConverter, ContentEditorBlockHtmlImporter, ContentEditorBlockImportValidator, ContentEditorBlockInsertionTarget, ContentEditorBlockRendererDef, ContentEditorBlockRendererInputSignals, ContentEditorBlockRendererInputs, ContentEditorBlockScope, ContentEditorBlockView, ContentEditorBuiltinBlockType, ContentEditorCalloutSettings, ContentEditorCalloutVariant, ContentEditorCodeRendererSettings, ContentEditorConfig, ContentEditorConvertibleBlockType, ContentEditorDataBlock, ContentEditorDimension, ContentEditorDocument, ContentEditorDraftConfig, ContentEditorDraftStatus, ContentEditorDraftStorage, ContentEditorEmbedBlockSettings, ContentEditorEmbedContent, ContentEditorGalleryContent, ContentEditorGalleryImage, ContentEditorGridCell, ContentEditorGridContent, ContentEditorGridGap, ContentEditorGridSettings, ContentEditorHeadingBlockSettings, ContentEditorHtmlContext, ContentEditorHtmlImportContext, ContentEditorHtmlImportOptions, ContentEditorHtmlUrlKind, ContentEditorImageBlockSettings, ContentEditorImageContent, ContentEditorImportMarkDefinition, ContentEditorImportOptions, ContentEditorImportPlacement, ContentEditorItemProperty, ContentEditorListItem, ContentEditorListSettings, ContentEditorMarkHtmlConverter, ContentEditorOptions, ContentEditorQuoteContent, ContentEditorQuoteRendererContent, ContentEditorQuoteRendererContentPart, ContentEditorSuggestionHeading, ContentEditorSuggestionItem, ContentEditorTableAttributes, ContentEditorTableBlockSettings, ContentEditorTableCell, ContentEditorTableCellMetadata, ContentEditorText, ContentEditorToggleContent, ContentEditorToggleSettings, ContentEditorUploadContext, ContentEditorUploadFn, ContentEditorUploadRequest, ContentEditorUploadedFile, ContentEditorVideoBlockSettings, ContentEditorVideoContent, ISelectionPopupComponent };
@@ -117,6 +117,10 @@ declare class NgsHeadlessEditor {
117
117
  handleKeydown(event: KeyboardEvent): boolean;
118
118
  handlePaste(event: ClipboardEvent): boolean;
119
119
  insertText(text: string, origin?: NgsHeadlessEditorChangeOrigin): boolean;
120
+ /** Inserts structured inline runs in one history step, preserving their marks. */
121
+ insertTextContent(content: readonly NgsHeadlessEditorText[], origin?: NgsHeadlessEditorChangeOrigin): boolean;
122
+ /** Word deletion is model-driven on every platform, including Ctrl+Backspace on macOS. */
123
+ deleteWordBackward(): boolean;
120
124
  deleteBackward(): boolean;
121
125
  deleteForward(): boolean;
122
126
  deleteRange(selection: NgsHeadlessEditorSelection, origin: NgsHeadlessEditorChangeOrigin, historyGroup?: string | null): boolean;
@@ -381,7 +385,8 @@ declare class NgsHeadlessEditorSurface {
381
385
  /** Deletes the range the browser reports for a word/line deletion. */
382
386
  private deleteTargetRange;
383
387
  private readTargetRange;
384
- private syncSelectionFromDom;
388
+ /** Synchronizes the DOM range before an application handles a surface event. */
389
+ syncSelectionFromDom(): void;
385
390
  private readSelectionFromDom;
386
391
  private domPositionToPoint;
387
392
  /**
@@ -1,54 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { computed, ChangeDetectionStrategy, Component } from '@angular/core';
3
- import { UploadArea, UploadTriggerDirective } from '@ngstarter-ui/components/upload';
4
- import { ProgressBar } from '@ngstarter-ui/components/progress-bar';
5
- import { Alert } from '@ngstarter-ui/components/alert';
6
- import { Button } from '@ngstarter-ui/components/button';
7
- import { Icon } from '@ngstarter-ui/components/icon';
8
- import { FormField, Label } from '@ngstarter-ui/components/form-field';
9
- import { Input } from '@ngstarter-ui/components/input';
10
- import { C as ContentEditorUploadBlockBase } from './ngstarter-ui-components-content-editor-upload-block-base-DKqojf--.mjs';
11
- import { f as contentEditorFileSize, g as contentEditorResourceUrl, r as readContentEditorFile } from './ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CK4ssnlk.mjs';
12
-
13
- class ContentEditorAttachmentBlock extends ContentEditorUploadBlockBase {
14
- sizeLabel = computed(() => contentEditorFileSize(this.content().size), /* @ts-ignore */
15
- ...(ngDevMode ? [{ debugName: "sizeLabel" }] : /* istanbul ignore next */ []));
16
- href = computed(() => contentEditorResourceUrl(this.content().url), /* @ts-ignore */
17
- ...(ngDevMode ? [{ debugName: "href" }] : /* istanbul ignore next */ []));
18
- changeName(event) { this.save({ ...this.latestContent(), name: event.target.value }); }
19
- async upload(event) {
20
- const file = event.files[0];
21
- if (!file)
22
- return;
23
- const request = this.beginUpload();
24
- try {
25
- const dataUrl = await readContentEditorFile(file);
26
- if (!this.isCurrentUpload(request))
27
- return;
28
- const uploadFn = this.builder.getBlockDefOption('attachment', 'uploadFn');
29
- const url = await uploadFn(file, dataUrl);
30
- if (!this.isCurrentUpload(request))
31
- return;
32
- if (typeof url !== 'string' || !contentEditorResourceUrl(url))
33
- throw new Error('Invalid file URL');
34
- this.save({ url, name: file.name, size: file.size, mimeType: file.type });
35
- }
36
- catch {
37
- if (this.isCurrentUpload(request))
38
- this.error.set('Could not upload the file. Please try again.');
39
- }
40
- finally {
41
- if (this.isCurrentUpload(request))
42
- this.uploading.set(false);
43
- }
44
- }
45
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ContentEditorAttachmentBlock, deps: null, target: i0.ɵɵFactoryTarget.Component });
46
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: ContentEditorAttachmentBlock, isStandalone: true, selector: "ngs-content-editor-attachment-block", usesInheritance: true, ngImport: i0, template: "<div class=\"flex flex-col gap-3\">\n @if (href()) {\n <div class=\"flex items-center gap-3\">\n <ngs-icon name=\"fluent:document-24-regular\"/>\n <div class=\"min-w-0 flex-1\"><div class=\"truncate\">{{content().name}}</div><div class=\"text-xs\">{{sizeLabel()}} \u00B7 {{content().mimeType}}</div></div>\n <a ngsButton [href]=\"href()\" [attr.download]=\"content().name\" target=\"_blank\" rel=\"noopener noreferrer\">Download</a>\n </div>\n <ngs-form-field><ngs-label>File name</ngs-label><input ngsInput [value]=\"content().name\" (input)=\"changeName($event)\"></ngs-form-field>\n }\n @if (uploading()) {\n <ngs-progress-bar mode=\"indeterminate\"/>\n <button ngsButton (click)=\"cancelUpload()\">Cancel upload</button>\n } @else {\n <ngs-upload-area ngsUploadTrigger [multiple]=\"false\" (fileSelected)=\"upload($event)\">\n {{href() ? 'Click or drop a file to replace it' : 'Click or drop a file to attach it'}}\n </ngs-upload-area>\n }\n @if (error()) { <ngs-alert variant=\"negative\">{{error()}}</ngs-alert> }\n</div>\n", dependencies: [{ kind: "component", type: UploadArea, selector: "ngs-upload-area", inputs: ["accept", "allowHover", "multiple"], outputs: ["fileSelected"], exportAs: ["ngsUploadArea"] }, { kind: "directive", type: UploadTriggerDirective, selector: "[ngsUploadTrigger]", inputs: ["accept", "multiple"], outputs: ["fileSelected"], exportAs: ["ngsUploadTrigger"] }, { kind: "component", type: ProgressBar, selector: "ngs-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["ngsProgressBar"] }, { kind: "component", type: Alert, selector: "ngs-alert", inputs: ["autoClose", "bordered", "variant"], outputs: ["closed"], exportAs: ["ngsAlert"] }, { kind: "component", type: Button, selector: " button[ngsButton], button[ngsIconButton], a[ngsButton], a[ngsIconButton] ", inputs: ["ngsButton", "ngsIconButton", "loading", "disabled", "disabledInteractive", "disableRipple", "reverse", "fullWidth", "hideTextOnMobile"], exportAs: ["ngsButton"] }, { kind: "component", type: Icon, selector: "ngs-icon", inputs: ["name"], exportAs: ["ngsIcon"] }, { kind: "component", type: FormField, selector: "ngs-form-field", inputs: ["labelMode", "subscriptHiddenIfEmpty", "sameHeightAsButton"], exportAs: ["ngsFormField"] }, { kind: "component", type: Label, selector: "ngs-label" }, { kind: "directive", type: Input, selector: "input[ngsInput], textarea[ngsInput]", inputs: ["id", "placeholder", "required", "disabled", "readonly", "errorStateMatcher"], exportAs: ["ngsInput"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
47
- }
48
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ContentEditorAttachmentBlock, decorators: [{
49
- type: Component,
50
- args: [{ selector: 'ngs-content-editor-attachment-block', imports: [UploadArea, UploadTriggerDirective, ProgressBar, Alert, Button, Icon, FormField, Label, Input], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"flex flex-col gap-3\">\n @if (href()) {\n <div class=\"flex items-center gap-3\">\n <ngs-icon name=\"fluent:document-24-regular\"/>\n <div class=\"min-w-0 flex-1\"><div class=\"truncate\">{{content().name}}</div><div class=\"text-xs\">{{sizeLabel()}} \u00B7 {{content().mimeType}}</div></div>\n <a ngsButton [href]=\"href()\" [attr.download]=\"content().name\" target=\"_blank\" rel=\"noopener noreferrer\">Download</a>\n </div>\n <ngs-form-field><ngs-label>File name</ngs-label><input ngsInput [value]=\"content().name\" (input)=\"changeName($event)\"></ngs-form-field>\n }\n @if (uploading()) {\n <ngs-progress-bar mode=\"indeterminate\"/>\n <button ngsButton (click)=\"cancelUpload()\">Cancel upload</button>\n } @else {\n <ngs-upload-area ngsUploadTrigger [multiple]=\"false\" (fileSelected)=\"upload($event)\">\n {{href() ? 'Click or drop a file to replace it' : 'Click or drop a file to attach it'}}\n </ngs-upload-area>\n }\n @if (error()) { <ngs-alert variant=\"negative\">{{error()}}</ngs-alert> }\n</div>\n" }]
51
- }] });
52
-
53
- export { ContentEditorAttachmentBlock };
54
- //# sourceMappingURL=ngstarter-ui-components-content-editor-attachment-block-DlUkhwCu.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ngstarter-ui-components-content-editor-attachment-block-DlUkhwCu.mjs","sources":["../../../projects/components/content-editor/src/_builder/attachment-block/attachment-block.ts","../../../projects/components/content-editor/src/_builder/attachment-block/attachment-block.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed } from '@angular/core';\nimport { UploadArea, UploadTriggerDirective, UploadFileSelectedEvent } from '@ngstarter-ui/components/upload';\nimport { ProgressBar } from '@ngstarter-ui/components/progress-bar';\nimport { Alert } from '@ngstarter-ui/components/alert';\nimport { Button } from '@ngstarter-ui/components/button';\nimport { Icon } from '@ngstarter-ui/components/icon';\nimport { FormField, Label } from '@ngstarter-ui/components/form-field';\nimport { Input } from '@ngstarter-ui/components/input';\nimport { ContentEditorUploadBlockBase } from '../upload-block-base';\nimport { ContentEditorAttachmentContent, ContentEditorUploadFn } from '../../types';\nimport { contentEditorFileSize, contentEditorResourceUrl, readContentEditorFile } from '../../upload';\n\n@Component({\n selector: 'ngs-content-editor-attachment-block',\n imports: [UploadArea, UploadTriggerDirective, ProgressBar, Alert, Button, Icon, FormField, Label, Input],\n templateUrl: './attachment-block.html', changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class ContentEditorAttachmentBlock extends ContentEditorUploadBlockBase<ContentEditorAttachmentContent> {\n readonly sizeLabel = computed(() => contentEditorFileSize(this.content().size));\n readonly href = computed(() => contentEditorResourceUrl(this.content().url));\n changeName(event: Event): void { this.save({ ...this.latestContent(), name: (event.target as HTMLInputElement).value }); }\n async upload(event: UploadFileSelectedEvent): Promise<void> {\n const file = event.files[0];\n if (!file) return;\n const request = this.beginUpload();\n try {\n const dataUrl = await readContentEditorFile(file);\n if (!this.isCurrentUpload(request)) return;\n const uploadFn: ContentEditorUploadFn = this.builder.getBlockDefOption('attachment', 'uploadFn');\n const url = await uploadFn(file, dataUrl);\n if (!this.isCurrentUpload(request)) return;\n if (typeof url !== 'string' || !contentEditorResourceUrl(url)) throw new Error('Invalid file URL');\n this.save({ url, name: file.name, size: file.size, mimeType: file.type });\n } catch {\n if (this.isCurrentUpload(request)) this.error.set('Could not upload the file. Please try again.');\n } finally {\n if (this.isCurrentUpload(request)) this.uploading.set(false);\n }\n }\n}\n","<div class=\"flex flex-col gap-3\">\n @if (href()) {\n <div class=\"flex items-center gap-3\">\n <ngs-icon name=\"fluent:document-24-regular\"/>\n <div class=\"min-w-0 flex-1\"><div class=\"truncate\">{{content().name}}</div><div class=\"text-xs\">{{sizeLabel()}} · {{content().mimeType}}</div></div>\n <a ngsButton [href]=\"href()\" [attr.download]=\"content().name\" target=\"_blank\" rel=\"noopener noreferrer\">Download</a>\n </div>\n <ngs-form-field><ngs-label>File name</ngs-label><input ngsInput [value]=\"content().name\" (input)=\"changeName($event)\"></ngs-form-field>\n }\n @if (uploading()) {\n <ngs-progress-bar mode=\"indeterminate\"/>\n <button ngsButton (click)=\"cancelUpload()\">Cancel upload</button>\n } @else {\n <ngs-upload-area ngsUploadTrigger [multiple]=\"false\" (fileSelected)=\"upload($event)\">\n {{href() ? 'Click or drop a file to replace it' : 'Click or drop a file to attach it'}}\n </ngs-upload-area>\n }\n @if (error()) { <ngs-alert variant=\"negative\">{{error()}}</ngs-alert> }\n</div>\n"],"names":[],"mappings":";;;;;;;;;;;;AAiBM,MAAO,4BAA6B,SAAQ,4BAA4D,CAAA;AACnG,IAAA,SAAS,GAAG,QAAQ,CAAC,MAAM,qBAAqB,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC;kFAAC;AACtE,IAAA,IAAI,GAAG,QAAQ,CAAC,MAAM,wBAAwB,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC;6EAAC;IAC5E,UAAU,CAAC,KAAY,EAAA,EAAU,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,aAAa,EAAE,EAAE,IAAI,EAAG,KAAK,CAAC,MAA2B,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IACzH,MAAM,MAAM,CAAC,KA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AK,sDAAE,KAAK,EAAA,QAAA,EAAA,qCAAA,EAAA,MAAA,EAAA,CAAA,IAAA,EAAA,aAAA,EAAA,UAAA,EAAA,UAAA,EAAA,UAAA,EAAA,mBAAA,CAAA,EAAA,QAAA,EAAA,CAAA,UAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAG5F,4BAA4B,EAAA,UAAA,EAAA,CAAA;kBALxC,SAAS;+BACE,qCAAqC,EAAA,OAAA,EACtC,CAAC,UAAU,EAAE,sBAAsB,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC,EAAA,eAAA,EAC/C,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,sjCAAA,EAAA;;;;;"}
@@ -1,47 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { inject, ElementRef, input, signal, effect, untracked, Directive } from '@angular/core';
3
- import { C as ContentBuilderStore, a as CONTENT_BUILDER, h as findContentEditorBlock, n as isContentEditorBlockEmpty, l as contentEditorBlockView } from './ngstarter-ui-components-content-editor-ngstarter-ui-components-content-editor-CK4ssnlk.mjs';
4
-
5
- /** Shared native inputs and root history for the built-in block editors. */
6
- class ContentEditorBlockBase {
7
- store = inject(ContentBuilderStore);
8
- builder = inject(CONTENT_BUILDER);
9
- element = inject(ElementRef).nativeElement;
10
- id = input.required(/* @ts-ignore */
11
- ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
12
- content = input.required(/* @ts-ignore */
13
- ...(ngDevMode ? [{ debugName: "content" }] : /* istanbul ignore next */ []));
14
- settings = input.required(/* @ts-ignore */
15
- ...(ngDevMode ? [{ debugName: "settings" }] : /* istanbul ignore next */ []));
16
- index = input(0, /* @ts-ignore */
17
- ...(ngDevMode ? [{ debugName: "index" }] : /* istanbul ignore next */ []));
18
- props = input([], /* @ts-ignore */
19
- ...(ngDevMode ? [{ debugName: "props" }] : /* istanbul ignore next */ []));
20
- initialized = signal(true, /* @ts-ignore */
21
- ...(ngDevMode ? [{ debugName: "initialized" }] : /* istanbul ignore next */ []));
22
- constructor() {
23
- effect(() => {
24
- if (this.store.focusedBlockId() === this.id())
25
- untracked(() => this.focus());
26
- });
27
- }
28
- focus() { this.element.querySelector('[contenteditable="true"], input, button')?.focus(); }
29
- getData() { return { content: this.content(), settings: this.settings(), props: this.props() }; }
30
- isEmpty() {
31
- const block = findContentEditorBlock(this.store.editor.document().blocks, this.id());
32
- return !block || isContentEditorBlockEmpty(block);
33
- }
34
- save(content, settings = this.settings()) { this.store.updateBlock(this.id(), { content, settings }); }
35
- latestContent() {
36
- const block = findContentEditorBlock(this.store.editor.document().blocks, this.id());
37
- return block ? contentEditorBlockView(block).content : this.content();
38
- }
39
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ContentEditorBlockBase, deps: [], target: i0.ɵɵFactoryTarget.Directive });
40
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.7", type: ContentEditorBlockBase, isStandalone: true, inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: true, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: true, transformFunction: null }, settings: { classPropertyName: "settings", publicName: "settings", isSignal: true, isRequired: true, transformFunction: null }, index: { classPropertyName: "index", publicName: "index", isSignal: true, isRequired: false, transformFunction: null }, props: { classPropertyName: "props", publicName: "props", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
41
- }
42
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ContentEditorBlockBase, decorators: [{
43
- type: Directive
44
- }], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: true }] }], content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: true }] }], settings: [{ type: i0.Input, args: [{ isSignal: true, alias: "settings", required: true }] }], index: [{ type: i0.Input, args: [{ isSignal: true, alias: "index", required: false }] }], props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }] } });
45
-
46
- export { ContentEditorBlockBase as C };
47
- //# sourceMappingURL=ngstarter-ui-components-content-editor-block-base-C46lyMrp.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ngstarter-ui-components-content-editor-block-base-C46lyMrp.mjs","sources":["../../../projects/components/content-editor/src/_builder/block-base.ts"],"sourcesContent":["import { Directive, ElementRef, effect, inject, input, signal, untracked } from '@angular/core';\nimport { ContentBuilderStore } from '../content-builder.store';\nimport { ContentBuilderComponent } from '../content-builder/content-builder.component';\nimport { CONTENT_BUILDER, ContentEditorDataBlock, ContentEditorItemProperty } from '../types';\nimport { contentEditorBlockView, findContentEditorBlock, isContentEditorBlockEmpty } from '../document';\n\n/** Shared native inputs and root history for the built-in block editors. */\n@Directive()\nexport abstract class ContentEditorBlockBase<T, S extends object = Record<string, unknown>> implements ContentEditorDataBlock {\n protected readonly store = inject(ContentBuilderStore);\n protected readonly builder = inject<ContentBuilderComponent>(CONTENT_BUILDER);\n protected readonly element = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n readonly id = input.required<string>();\n readonly content = input.required<T>();\n readonly settings = input.required<S>();\n readonly index = input(0);\n readonly props = input<ContentEditorItemProperty[]>([]);\n readonly initialized = signal(true);\n\n constructor() {\n effect(() => {\n if (this.store.focusedBlockId() === this.id()) untracked(() => this.focus());\n });\n }\n focus(): void { this.element.querySelector<HTMLElement>('[contenteditable=\"true\"], input, button')?.focus(); }\n getData() { return { content: this.content(), settings: this.settings(), props: this.props() }; }\n isEmpty(): boolean {\n const block = findContentEditorBlock(this.store.editor.document().blocks, this.id());\n return !block || isContentEditorBlockEmpty(block);\n }\n protected save(content: T, settings: S = this.settings()): void { this.store.updateBlock(this.id(), { content, settings }); }\n protected latestContent(): T {\n const block = findContentEditorBlock(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AA,EAAA,KAAA,EAAA,EAAA,iBAAA,EAAA,OAAA,EAAA,UAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAtB,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAD3C;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ngstarter-ui-components-content-editor-gallery-block-C4p-S0Do.mjs","sources":["../../../projects/components/content-editor/src/_builder/gallery-block/gallery-block.ts","../../../projects/components/content-editor/src/_builder/gallery-block/gallery-block.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, linkedSignal, signal } from '@angular/core';\nimport { CdkDrag, CdkDragDrop, CdkDragHandle, CdkDropList, moveItemInArray } from '@angular/cdk/drag-drop';\nimport { createNgsHeadlessEditorId, createNgsHeadlessEditorText } from '@ngstarter-ui/components/headless-editor';\nimport { UploadArea, UploadTriggerDirective, UploadFileSelectedEvent } from '@ngstarter-ui/components/upload';\nimport { ProgressBar } from '@ngstarter-ui/components/progress-bar';\nimport { Alert } from '@ngstarter-ui/components/alert';\nimport { Button } from '@ngstarter-ui/components/button';\nimport { Icon } from '@ngstarter-ui/components/icon';\nimport { FormField, Hint, Label } from '@ngstarter-ui/components/form-field';\nimport { Input } from '@ngstarter-ui/components/input';\nimport { Menu, MenuDivider, MenuItem, MenuTrigger } from '@ngstarter-ui/components/menu';\nimport { ImageViewerDirective, ImageViewerPictureDirective } from '@ngstarter-ui/components/image-viewer';\nimport { ContentEditorUploadBlockBase } from '../upload-block-base';\nimport { ContentEditorGalleryContent, ContentEditorGalleryImage, ContentEditorUploadFn } from '../../types';\nimport { contentEditorText } from '../../document';\nimport { contentEditorResourceUrl, readContentEditorFile } from '../../upload';\n\n@Component({\n selector: 'ngs-content-editor-gallery-block',\n imports: [UploadArea, UploadTriggerDirective, ProgressBar, Alert, Button, Icon, FormField, Hint, Label, Input,\n CdkDrag, CdkDragHandle, CdkDropList, Menu, MenuDivider, MenuItem, MenuTrigger, ImageViewerDirective, ImageViewerPictureDirective],\n templateUrl: './gallery-block.html', styleUrl: './gallery-block.scss', changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class ContentEditorGalleryBlock extends ContentEditorUploadBlockBase<ContentEditorGalleryContent> {\n readonly images = computed(() => this.content().images);\n readonly selectedId = linkedSignal<readonly ContentEditorGalleryImage[], string | null>({\n source: this.images,\n computation: (images, previous) => {\n if (images.some(image => image.id === previous?.value)) return previous!.value;\n const previousIndex = previous?.source.findIndex(image => image.id === previous.value) ?? 0;\n return images[Math.min(Math.max(previousIndex, 0), images.length - 1)]?.id ?? null;\n }\n });\n readonly selectedIndex = computed(() => this.images().findIndex(image => image.id === this.selectedId()));\n readonly selectedImage = computed(() => this.images()[this.selectedIndex()] ?? null);\n readonly replacementId = signal<string | null>(null);\n readonly captionText = contentEditorText;\n\n selectImage(id: string): void { this.selectedId.set(id); }\n previousImage(): void { const image = this.images()[this.selectedIndex() - 1]; if (image) this.selectImage(image.id); }\n nextImage(): void { const image = this.images()[this.selectedIndex() + 1]; if (image) this.selectImage(image.id); }\n changeAlt(id: string, event: Event): void { this.changeImage(id, { alt: (event.target as HTMLInputElement).value }); }\n changeCaption(id: string, caption: string): void { this.changeImage(id, { caption: [createNgsHeadlessEditorText(caption)] }); }\n private changeImage(id: string, data: Partial<ContentEditorGalleryImage>): void {\n this.save({ images: this.latestContent().images.map(image => image.id === id ? { ...image, ...data } : image) });\n }\n removeImage(id: string): void { this.save({ images: this.latestContent().images.filter(image => image.id !== id) }); }\n moveImage(index: number, direction: number): void { this.reorderImage(index, index + direction); }\n dropImage(event: CdkDragDrop<readonly ContentEditorGalleryImage[]>): void {\n this.reorderImage(event.previousIndex, event.currentIndex);\n }\n private reorderImage(from: number, to: number): void {\n const images = [...this.latestContent().images];\n if (from < 0 || to < 0 || from >= images.length || to >= images.length || from === to) return;\n moveItemInArray(images, from, to);\n this.save({ images });\n }\n requestReplacement(id: string, trigger: UploadTriggerDirective): void {\n this.replacementId.set(id);\n trigger._handleClick();\n }\n async upload(event: UploadFileSelectedEvent, replaceId: string | null = null): Promise<void> {\n const candidates = event.files.filter(file => file.type.startsWith('image/'));\n const files = replaceId ? candidates.slice(0, 1) : candidates;\n if (!files.length) { this.error.set('Choose image files.'); return; }\n const request = this.beginUpload();\n const uploadFn: ContentEditorUploadFn = this.builder.getBlockDefOption('gallery', 'uploadFn');\n const results = await Promise.allSettled(files.map(async file => {\n const dataUrl = await readContentEditorFile(file);\n if (!this.isCurrentUpload(request)) throw new Error('Cancelled');\n const src = await uploadFn(file, dataUrl);\n if (typeof src !== 'string' || !contentEditorResourceUrl(src)) throw new Error('Invalid image URL');\n return { id: createNgsHeadlessEditorId('image'), src, alt: file.name, caption: [] } satisfies ContentEditorGalleryImage;\n }));\n if (!this.isCurrentUpload(request)) return;\n const images = results.flatMap(result => result.status === 'fulfilled' ? [result.value] : []);\n if (images.length) {\n if (replaceId) this.changeImage(replaceId, { src: images[0].src });\n else {\n this.save({ images: [...this.latestContent().images, ...images] });\n this.selectImage(images[0].id);\n }\n }\n if (images.length !== files.length) this.error.set(replaceId ? 'Could not replace the image. Please try again.' : 'Some images could not be uploaded. Please try again.');\n this.uploading.set(false);\n }\n}\n","<div class=\"flex min-w-0 flex-col gap-4 p-3 sm:p-4\">\n <div class=\"flex flex-wrap items-center gap-3\">\n <span class=\"text-base font-semibold\">Carousel</span>\n <span class=\"text-sm text-on-surface-variant\">{{ images().length }} {{ images().length === 1 ? 'image' : 'images' }}</span>\n </div>\n @if (selectedImage(); as image) {\n <div class=\"gallery-preview relative overflow-hidden rounded-lg\" ngsImageViewer>\n <button ngsButton class=\"gallery-picture block w-full\" [fullWidth]=\"true\" ngsImageViewerPicture [sourceUrl]=\"image.src\" [caption]=\"captionText(image.caption)\" [attr.aria-label]=\"image.alt || 'View image'\">\n <img class=\"block aspect-video w-full object-cover\" [src]=\"image.src\" [alt]=\"image.alt\" draggable=\"false\">\n </button>\n <button ngsIconButton class=\"preview-action image-actions absolute right-3 top-3\" aria-label=\"Image actions\" [ngsMenuTriggerFor]=\"imageMenu\"><ngs-icon name=\"fluent:more-horizontal-24-regular\"/></button>\n @if (images().length > 1) {\n <button ngsIconButton class=\"preview-action absolute left-3 top-1/2 -translate-y-1/2\" aria-label=\"Previous image\" [disabled]=\"selectedIndex() === 0\" (click)=\"previousImage()\"><ngs-icon name=\"fluent:chevron-left-24-regular\"/></button>\n <button ngsIconButton class=\"preview-action absolute right-3 top-1/2 -translate-y-1/2\" aria-label=\"Next image\" [disabled]=\"selectedIndex() === images().length - 1\" (click)=\"nextImage()\"><ngs-icon name=\"fluent:chevron-right-24-regular\"/></button>\n }\n <span class=\"image-counter absolute bottom-3 left-1/2 -translate-x-1/2 rounded-full px-3 py-1 text-sm\" aria-live=\"polite\">{{ selectedIndex() + 1 }} / {{ images().length }}</span>\n </div>\n <div class=\"flex min-w-0 flex-col gap-2\">\n <span class=\"flex items-center gap-2 text-xs text-on-surface-variant\"><ngs-icon name=\"fluent:re-order-24-regular\" class=\"size-4\"/>Drag to reorder</span>\n <div class=\"thumbnail-strip flex min-w-0 gap-3 overflow-x-auto pb-2\">\n <div cdkDropList cdkDropListOrientation=\"horizontal\" [cdkDropListData]=\"images()\" (cdkDropListDropped)=\"dropImage($event)\" class=\"flex shrink-0 gap-3\">\n @for (thumbnail of images(); track thumbnail.id) {\n <div cdkDrag [cdkDragData]=\"thumbnail.id\" class=\"gallery-thumbnail flex shrink-0 items-center gap-1 rounded-lg p-1\" [attr.data-image-id]=\"thumbnail.id\">\n <div cdkDragHandle class=\"thumbnail-handle flex w-5 shrink-0 self-stretch items-center justify-center select-none touch-none\" [attr.title]=\"'Drag to reorder image ' + ($index + 1)\"><ngs-icon name=\"fluent:re-order-dots-vertical-24-regular\"/></div>\n <button ngsButton class=\"thumbnail-picture\" [class.is-selected]=\"selectedId() === thumbnail.id\" [attr.aria-label]=\"'Select image ' + ($index + 1)\" [attr.aria-pressed]=\"selectedId() === thumbnail.id\" (click)=\"selectImage(thumbnail.id)\">\n <img class=\"block h-18 w-32 rounded-md object-cover\" [src]=\"thumbnail.src\" [alt]=\"thumbnail.alt\" draggable=\"false\" loading=\"lazy\">\n </button>\n </div>\n }\n </div>\n <button ngsButton class=\"add-image-tile flex shrink-0 flex-col justify-center gap-1 rounded-lg\" ngsUploadTrigger accept=\"image/*\" [multiple]=\"true\" [disabled]=\"uploading()\" (fileSelected)=\"upload($event)\"><ngs-icon name=\"fluent:add-24-regular\"/>Add images</button>\n </div>\n </div>\n <div class=\"flex flex-col gap-3\">\n <ngs-form-field labelMode=\"external\" subscriptHiddenIfEmpty class=\"gallery-field\">\n <ngs-label>Caption</ngs-label>\n <input ngsInput [value]=\"captionText(image.caption)\" placeholder=\"Add a caption\" (input)=\"changeCaption(image.id, $any($event.target).value)\">\n </ngs-form-field>\n <ngs-form-field labelMode=\"external\" class=\"gallery-field\">\n <ngs-label>Alt text</ngs-label>\n <input ngsInput [value]=\"image.alt\" placeholder=\"Describe this image\" (input)=\"changeAlt(image.id, $event)\">\n <ngs-hint>Describe the image for screen readers</ngs-hint>\n </ngs-form-field>\n </div>\n <ngs-menu #imageMenu>\n <button ngs-menu-item [disabled]=\"uploading()\" (click)=\"requestReplacement(image.id, replaceUpload)\">Replace image</button>\n <button ngs-menu-item [disabled]=\"selectedIndex() === 0\" (click)=\"moveImage(selectedIndex(), -1)\">Move image earlier</button>\n <button ngs-menu-item [disabled]=\"selectedIndex() === images().length - 1\" (click)=\"moveImage(selectedIndex(), 1)\">Move image later</button>\n <ngs-menu-divider/>\n <button ngs-menu-item (click)=\"removeImage(image.id)\">Remove image</button>\n </ngs-menu>\n } @else {\n <ngs-upload-area ngsUploadTrigger accept=\"image/*\" [multiple]=\"true\" (fileSelected)=\"!uploading() && upload($event)\">\n <div class=\"flex flex-col items-center gap-2 py-8\"><ngs-icon name=\"fluent:image-multiple-24-regular\" class=\"size-8\"/><span>Add images to your carousel</span><span class=\"text-xs text-on-surface-variant\">Click or drop images here</span></div>\n </ngs-upload-area>\n }\n <button ngsButton hidden ngsUploadTrigger accept=\"image/*\" #replaceUpload=\"ngsUploadTrigger\" (fileSelected)=\"upload($event, replacementId())\" aria-label=\"Replace selected image\"></button>\n @if (uploading()) {\n <ngs-progress-bar mode=\"indeterminate\"/><button ngsButton (click)=\"cancelUpload()\">Cancel upload</button>\n }\n @if (error()) { <ngs-alert variant=\"negative\">{{error()}}</ngs-alert> }\n</div>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAuBM,MAAO,yBAA0B,SAAQ,4BAAyD,CAAA;IAC7F,MAAM,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC,MAAM;+EAAC;AAC9C,IAAA,UAAU,GAAG,YAAY,CAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,YAAA,EAAA,8BAAA,EAAA,CAAA,EAChC,MAAM,EAAE,IAAI,CAAC,MAAM;AACnB,QAAA,WAAW,EAAE,CAAC,MAAM,EAAE,QAAQ,KAAI;AAChC,YAAA,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,EAAE,KAAK,QAAQ,EAAE,KAAK,CAAC;gBAAE,OAAO,QAAS,CAAC,KAAK;YAC9E,MAAM,aAAa,GAAG,QAAQ,EAAE,MAAM,CAAC,SAAS,CAAC,KAAK,IAAI,KAAK,CAAC,EAAE,KAAK,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC;YAC3F,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,IAAI;AACpF,QAAA,CAAC,GACD;IACO,aAAa,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC,SA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