@orangelogic/design-system 3.17.0 → 3.19.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.
Files changed (139) hide show
  1. package/library/chunks/{asset-link-format.FmSSysED.js → asset-link-format.ttcRQgDc.js} +6 -6
  2. package/library/chunks/{button.DCyoZrRj.js → button.D1YIxtv-.js} +1 -1
  3. package/library/chunks/{color-swatch-group.CvApE9bf.js → color-swatch-group.Bumfw-G2.js} +4788 -4335
  4. package/library/chunks/{color-swatch.DxxOpJXT.js → color-swatch.DdsUysbF.js} +1 -1
  5. package/library/chunks/{confirm-popover.-_1n24v-.js → confirm-popover.CJXyEa5A.js} +3 -3
  6. package/library/chunks/{dialog.Dl9aHLD4.js → dialog.BbQ4Du0M.js} +2 -2
  7. package/library/chunks/{document-viewer.DY5s9zRW.js → document-viewer.C9tM2Gc7.js} +7 -7
  8. package/library/chunks/{dot-pagination.BNoG-qx7.js → dot-pagination.CJRAtM51.js} +1 -1
  9. package/library/chunks/{folder-select.CsuADJH9.js → folder-select.BAPsI-gg.js} +4 -4
  10. package/library/chunks/gradient.CIzq8fOU.js +176 -0
  11. package/library/chunks/{header.v8maWlzT.js → header.BioJzPlg.js} +1 -1
  12. package/library/chunks/{i18n.CNnI4-0K.js → i18n.rtxrs1c1.js} +11 -3
  13. package/library/chunks/{icon-button.5-oAlIkv.js → icon-button.CbUddcgI.js} +1 -1
  14. package/library/chunks/{iframe.DOwG9Q7o.js → iframe.y7iCAVZP.js} +1 -1
  15. package/library/chunks/{image.BSh7WAGF.js → image.A2hE1WoV.js} +1 -1
  16. package/library/chunks/{index.CW7LXCxo.js → index.Coy2OPB4.js} +14 -14
  17. package/library/chunks/{input.Csf-S2nB.js → input.D1FFprPl.js} +1 -1
  18. package/library/chunks/{markdown.b03AOvFT.js → markdown.Dd_GFJK8.js} +2 -2
  19. package/library/chunks/{menu-item.HtTWOcq4.js → menu-item.0TbnDEDp.js} +1 -1
  20. package/library/chunks/{option.DgxoCq1j.js → option.CyorNG0S.js} +17 -17
  21. package/library/chunks/{pagination.C9NblxKt.js → pagination.D0BeaEIi.js} +5 -5
  22. package/library/chunks/{tab-group.B6Aej-jM.js → tab-group.C98CWzEH.js} +4 -4
  23. package/library/chunks/{toast.CGIDPKV8.js → toast.BxiewnAG.js} +1 -1
  24. package/library/chunks/{transformation.OaRYixzE.js → transformation.CjWnFhab.js} +12 -11
  25. package/library/chunks/{tree.DKofDMGu.js → tree.B7IKBX3n.js} +7 -4
  26. package/library/chunks/{types.BNc8NEZr.js → types.DVZ_cbKn.js} +14220 -13897
  27. package/library/components/alert.js +2 -2
  28. package/library/components/asset-link-format.js +4 -4
  29. package/library/components/atoms.js +15 -15
  30. package/library/components/audio.js +3 -3
  31. package/library/components/border-input-group.js +2 -2
  32. package/library/components/breadcrumb.js +1 -1
  33. package/library/components/button.js +2 -2
  34. package/library/components/color-picker.js +971 -337
  35. package/library/components/color-swatch-group.js +5 -5
  36. package/library/components/color-swatch.js +2 -2
  37. package/library/components/confirm-popover.js +4 -4
  38. package/library/components/copy-button.js +1 -1
  39. package/library/components/corner-position-input-group.js +3 -3
  40. package/library/components/date-calendar.js +1 -1
  41. package/library/components/details.js +1 -1
  42. package/library/components/dialog.js +3 -3
  43. package/library/components/document-viewer.js +3 -3
  44. package/library/components/dot-pagination.js +2 -2
  45. package/library/components/drawer.js +2 -2
  46. package/library/components/dropdown.js +2 -2
  47. package/library/components/dynamic-select.js +4 -4
  48. package/library/components/e-chart.js +1 -1
  49. package/library/components/element-clamp.js +2 -2
  50. package/library/components/file-on-demand.js +9 -9
  51. package/library/components/folder-select.js +4 -4
  52. package/library/components/format-bytes.js +1 -1
  53. package/library/components/format-date.js +1 -1
  54. package/library/components/format-number.js +1 -1
  55. package/library/components/format-time.js +1 -1
  56. package/library/components/header.js +2 -2
  57. package/library/components/icon-button.js +2 -2
  58. package/library/components/iframe.js +2 -2
  59. package/library/components/image-comparer.js +1 -1
  60. package/library/components/image.js +2 -2
  61. package/library/components/input.js +2 -2
  62. package/library/components/line-clamp.js +1 -1
  63. package/library/components/markdown.js +3 -3
  64. package/library/components/masonry.js +2 -2
  65. package/library/components/menu-item.js +2 -2
  66. package/library/components/menu.js +2 -2
  67. package/library/components/molecules.js +3 -3
  68. package/library/components/mutation-observer.js +1 -1
  69. package/library/components/option.js +2 -2
  70. package/library/components/organisms.js +2 -2
  71. package/library/components/padding-input-group.js +1 -1
  72. package/library/components/pagination.js +6 -6
  73. package/library/components/popup.js +1 -1
  74. package/library/components/position-picker.js +1 -1
  75. package/library/components/progress-bar.js +1 -1
  76. package/library/components/progress-ring.js +1 -1
  77. package/library/components/range.js +1 -1
  78. package/library/components/rating.js +1 -1
  79. package/library/components/relative-time.js +1 -1
  80. package/library/components/select.js +2 -2
  81. package/library/components/shadow-input-group.js +1 -1
  82. package/library/components/share-option-list.js +1 -1
  83. package/library/components/sidebar.js +1 -1
  84. package/library/components/size-input-group.js +3 -3
  85. package/library/components/spinner.js +1 -1
  86. package/library/components/split-panel.js +1 -1
  87. package/library/components/tab-group.js +5 -5
  88. package/library/components/tab.js +2 -2
  89. package/library/components/tag.js +2 -2
  90. package/library/components/tooltip.js +1 -1
  91. package/library/components/tree-item.js +2 -2
  92. package/library/components/tree.js +2 -2
  93. package/library/components/typeface.js +2 -2
  94. package/library/components/types.js +199 -188
  95. package/library/components/video.js +3 -3
  96. package/library/package.json +1 -1
  97. package/library/packages/atoms/src/components/audio/audio.d.ts +1 -0
  98. package/library/packages/atoms/src/components/color-picker/color-picker.d.ts +160 -2
  99. package/library/packages/atoms/src/components/color-picker/components/gradient-slider/gradient-slider.d.ts +80 -0
  100. package/library/packages/atoms/src/components/color-picker/components/gradient-slider/gradient-slider.styles.d.ts +2 -0
  101. package/library/packages/atoms/src/components/color-picker/components/gradient-stop-list/gradient-stop-list.d.ts +85 -0
  102. package/library/packages/atoms/src/components/color-picker/components/gradient-stop-list/gradient-stop-list.styles.d.ts +2 -0
  103. package/library/packages/atoms/src/components/input/input.d.ts +1 -1
  104. package/library/packages/atoms/src/components/option/option.d.ts +1 -1
  105. package/library/packages/atoms/src/components/tree/tree.d.ts +2 -2
  106. package/library/packages/atoms/src/components/video/video.d.ts +1 -0
  107. package/library/packages/events/src/cx-gradient-change.d.ts +10 -0
  108. package/library/packages/events/src/cx-gradient-stop-add.d.ts +9 -0
  109. package/library/packages/events/src/cx-gradient-stop-change.d.ts +10 -0
  110. package/library/packages/events/src/cx-gradient-stop-remove.d.ts +8 -0
  111. package/library/packages/events/src/cx-gradient-stop-select.d.ts +8 -0
  112. package/library/packages/events/src/cx-keydown.d.ts +4 -1
  113. package/library/packages/events/src/events.d.ts +5 -0
  114. package/library/packages/molecules/src/multi-select/components/board/board.d.ts +58 -2
  115. package/library/packages/molecules/src/multi-select/components/board-list-item/board-list-item.d.ts +14 -0
  116. package/library/packages/molecules/src/multi-select/controllers/filter-controller.d.ts +68 -0
  117. package/library/packages/molecules/src/multi-select/multi-select.d.ts +211 -0
  118. package/library/packages/molecules/src/multi-select/utils/base.d.ts +44 -0
  119. package/library/packages/molecules/src/multi-select/utils/reconcile.d.ts +57 -0
  120. package/library/packages/organisms/src/bento-grid/bento-grid.d.ts +32 -11
  121. package/library/packages/organisms/src/carousel/carousel.d.ts +1 -0
  122. package/library/packages/organisms/src/content-builder/blocks/audio/audio.d.ts +1 -0
  123. package/library/packages/organisms/src/content-builder/blocks/image/image.d.ts +27 -4
  124. package/library/packages/organisms/src/content-builder/content-builder-constants.d.ts +12 -0
  125. package/library/packages/organisms/src/content-builder/content-builder.d.ts +150 -0
  126. package/library/packages/organisms/src/content-builder/content-builder.utils.d.ts +20 -0
  127. package/library/packages/organisms/src/content-builder/plugins/wrapper-container.d.ts +11 -0
  128. package/library/packages/organisms/src/content-builder-viewer/content-builder-viewer.d.ts +10 -2
  129. package/library/packages/types/src/board.d.ts +25 -0
  130. package/library/packages/types/src/color-picker.d.ts +35 -2
  131. package/library/packages/utils/src/custom-element/i18n.d.ts +8 -0
  132. package/library/packages/utils/src/gradient/gradient.d.ts +65 -0
  133. package/library/packages/utils/src/gradient/index.d.ts +1 -0
  134. package/library/packages/utils/src/index.d.ts +1 -0
  135. package/library/packages/utils/src/transformation/transformation.d.ts +2 -0
  136. package/library/react-web-component.d.ts +497 -469
  137. package/library/utils.js +162 -151
  138. package/package.json +1 -1
  139. package/library/packages/molecules/src/multi-select/multi-select.utils.d.ts +0 -3
@@ -42,6 +42,7 @@ export default class CxSbAudio extends CxAudio {
42
42
  * Support CMS5 edit mode for the audio.
43
43
  */
44
44
  get isInEditMode(): boolean;
45
+ runConnectedCallback(): void;
45
46
  handleSrcChange(): Promise<void>;
46
47
  handleRecordIdChange(): Promise<void>;
47
48
  handleFetchedAssetDataChange(): void;
@@ -151,7 +151,8 @@ export default class CxSbImage extends CxImage {
151
151
  * `cx-content-builder-viewer`) that has already batch-fetched asset data
152
152
  * for the page. When set outside edit mode, the block stops its child
153
153
  * `cx-asset-data-display` from fetching on its own and maps this data into
154
- * alt text and overlay content instead.
154
+ * alt text and overlay content instead — and, inside a viewer, takes its
155
+ * delivery URL from the `path_*` fields here rather than searching for one.
155
156
  */
156
157
  fetchedAssetData: Record<string, unknown>;
157
158
  /**
@@ -204,6 +205,8 @@ export default class CxSbImage extends CxImage {
204
205
  private fetchAssetController?;
205
206
  /** Monotonic token to drop out-of-order expired-URL recovery responses. */
206
207
  private srcResolveVersion;
208
+ /** A source recovery is already queued for the current update cycle. */
209
+ private sourceRecoveryScheduled;
207
210
  /**
208
211
  * Support CMS5 edit mode for the image.
209
212
  */
@@ -309,10 +312,30 @@ export default class CxSbImage extends CxImage {
309
312
  */
310
313
  private resolveClickSpace;
311
314
  /**
312
- * When a stored URL has expired, re-resolve a fresh one from the block's
315
+ * Runs one source recovery per update cycle. A block mounted with both `record-id`
316
+ * and `src` changes both in the same cycle, and a block with `record-id` alone never
317
+ * changes `src` at all, so the record watch has to trigger recovery too; coalescing
318
+ * keeps that from fetching the same URL twice.
319
+ */
320
+ private scheduleSourceRecovery;
321
+ /**
322
+ * In read mode inside a `cx-content-builder-viewer` the viewer's batched Search already
323
+ * carries every `path_*` field a recovery could need, so the block never searches for
324
+ * itself — one call per page instead of one (or more) per block.
325
+ */
326
+ private get hasAssetDataProvider();
327
+ /**
328
+ * Picks one variant's delivery URL out of the viewer's batched data. Mirrors
329
+ * `FetchAssetController.refetchFormatUrl`: the original-file proxy is only used for a
330
+ * browser-displayable original and otherwise falls back to the transcoded one. Empty
331
+ * until the batch lands, and for a variant the batch did not cover.
332
+ */
333
+ private readProvidedSource;
334
+ /**
335
+ * When a stored URL has expired, or none was stored, resolve one from the block's
313
336
  * `record-id` + `format` (light and dark variants independently). Fires on every
314
- * `src` / `srcDarkMode` change and no-ops for non-expired URLs, so working paths
315
- * are untouched. On failure it leaves the stored URL in place and lets the
337
+ * `src` / `srcDarkMode` / record change and no-ops for non-expired URLs, so working
338
+ * paths are untouched. On failure it leaves the stored URL in place and lets the
316
339
  * existing `@error` / fallback path handle it.
317
340
  */
318
341
  private recoverExpiredSources;
@@ -30,6 +30,18 @@ export declare const OMITTED_ATTRIBUTES: string[];
30
30
  export declare const OMITTED_PROPERTIES: never[];
31
31
  export declare const BLOCK_CAROUSEL_LIMITED_BLOCKS: BlockType[];
32
32
  export declare const NEWLY_ADDED_COMPONENT_DELAY = 500;
33
+ /**
34
+ * Grace period the load settle waits for GrapesJS's `update` after its own timer has
35
+ * elapsed. A swap that produced no countable change never fires `update`, so the settle
36
+ * must give up rather than latch the change suppression for the element's lifetime.
37
+ */
38
+ export declare const SETTLE_UPDATE_GRACE = 50;
39
+ /**
40
+ * Ceiling on how long the load settle waits for the templates refresh. A hung or very
41
+ * slow `apiGetTemplates` must not keep `softLoading` on - late writes are already made
42
+ * harmless by the load-generation check.
43
+ */
44
+ export declare const SETTLE_TEMPLATES_TIMEOUT = 5000;
33
45
  export declare const OPEN_ON_NEWLY_ADDED_COMPONENT: Set<BlockType>;
34
46
  export declare const MULTI_LANGUAGE_BLOCKS: Set<BlockType>;
35
47
  export declare const DEFAULT_IMAGE_FORMAT = "TR1";
@@ -60,6 +60,16 @@ export default class CxContentBuilder extends CortexElement {
60
60
  * @default ''
61
61
  */
62
62
  initialData: string;
63
+ /**
64
+ * Published HTML of the page, used as the content source when it holds more
65
+ * content blocks than `initial-data` (a page whose JSON was never produced by
66
+ * this editor, e.g. published through the API with HTML only or with a
67
+ * partial JSON). Parsed through the registered block types, so every block
68
+ * the editor knows is recovered. Ignored when `initial-data` has at least as
69
+ * many blocks.
70
+ * @default ''
71
+ */
72
+ initialHtml: string;
63
73
  /**
64
74
  * This property reflects the current device type being used in the content builder.
65
75
  * It can be one of the predefined device types such as 'desktop', 'tablet', or 'mobile'.
@@ -240,6 +250,17 @@ export default class CxContentBuilder extends CortexElement {
240
250
  private _dsm;
241
251
  private get dsm();
242
252
  private hasBoundUpdate;
253
+ /**
254
+ * True while `loadPage` swaps project data into the running editor, so the
255
+ * swap is never mistaken for an authoring change (no `cx-change`, no
256
+ * builder re-init from the property watch).
257
+ */
258
+ private softLoading;
259
+ /**
260
+ * True when the last project load took its content from `initial-html`
261
+ * rather than `initial-data`; such content settles later than a JSON load.
262
+ */
263
+ private adoptedInitialHtml;
243
264
  /**
244
265
  * In-flight/resolved block-types fetch, kept as a promise (not the awaited value) so the
245
266
  * `component:open-picker` handler can share it even if it fires before the prefetch below
@@ -249,6 +270,24 @@ export default class CxContentBuilder extends CortexElement {
249
270
  private blockTypesPromise;
250
271
  private prefetchBlockTypes;
251
272
  private newlyAddedComponentTimeout;
273
+ /**
274
+ * Pending tail of a `loadPage` soft switch: lifts the change suppression and
275
+ * wipes the undo/dirty bookkeeping once GrapesJS has settled.
276
+ */
277
+ private loadPageSettleTimeout;
278
+ /**
279
+ * The one-shot `update` listener the settle waits on, kept so it can be detached
280
+ * along with the timer whenever the editor is torn down or a new load starts.
281
+ */
282
+ private loadPageSettleUpdateHandler;
283
+ /**
284
+ * Bumped on every project load. Async work started by a load compares against it
285
+ * so a response belonging to a superseded page is dropped instead of written to
286
+ * the editor the newer page now owns.
287
+ */
288
+ private loadGeneration;
289
+ /** The templates refresh started by the current load, awaited before settling. */
290
+ private templatesRefreshPromise;
252
291
  private readonly initializeCustomFrame;
253
292
  private containerDropdownObservers;
254
293
  private nextMapHoveredBadgeState;
@@ -314,6 +353,112 @@ export default class CxContentBuilder extends CortexElement {
314
353
  * effectively resetting the count of changes made since the last reset.
315
354
  */
316
355
  resetDirtyCount(): void;
356
+ /**
357
+ * Load another page's content into the running editor without recreating the
358
+ * GrapesJS instance or reloading the canvas frame document (a soft page
359
+ * switch). Only the project data is swapped here - the canvas document's own
360
+ * chrome (header, navigation, per-page styles) is the host's responsibility,
361
+ * typically by asking the frame to re-render itself in place.
362
+ *
363
+ * The switch resets selection, undo history and the dirty count, and never
364
+ * emits `cx-change`, so it cannot trigger an auto-save of the incoming page.
365
+ *
366
+ * @param options New page's `canvas-src`, `initial-data` JSON string,
367
+ * `initial-html` fallback and `page-id`. Omitted fields keep their current
368
+ * values, except `initial-html`, which belongs to one page and is cleared.
369
+ * @returns `true` when the switch was applied to a running editor; `false`
370
+ * when the editor has not booted yet - the caller must then fall back to a
371
+ * full render/init cycle.
372
+ */
373
+ loadPage(options: {
374
+ canvasSrc?: string;
375
+ initialData?: string;
376
+ initialHtml?: string;
377
+ pageId?: string;
378
+ }): Promise<boolean>;
379
+ /**
380
+ * Drop any pending load settle: both its timer and the `update` listener it is
381
+ * waiting on.
382
+ *
383
+ * Must run before every `contentBuilder.destroy()`. The scheduled callback closes
384
+ * over the editor it was armed for, and destroying does not null the field, so a
385
+ * surviving callback would clear the undo history of - and reset the dirty count
386
+ * of - whichever editor replaced it.
387
+ */
388
+ private cancelLoadPageSettle;
389
+ /**
390
+ * Run `finish` once GrapesJS has flushed the load, at the earliest after `delay`.
391
+ *
392
+ * GrapesJS chains two zero-delay timers on its way to `update`
393
+ * (`handleUpdates` -> `changesCount` -> `updateChanges` -> `update`), so a bare
394
+ * timer here fires before the swap's own `update` and would lift the change
395
+ * suppression while the load is still counted as authoring - emitting `cx-change`
396
+ * for the page that was just loaded. Waiting for both the delay and that event
397
+ * closes the gap; a swap that produced no countable change never fires it at all,
398
+ * so `SETTLE_UPDATE_GRACE` gives up rather than latching the suppression.
399
+ */
400
+ private scheduleSettle;
401
+ /**
402
+ * Parse the current `initial-data` JSON string into project data, treating a
403
+ * missing or malformed payload as an empty project.
404
+ */
405
+ private parseInitialProjectData;
406
+ /**
407
+ * Swap the project in place rather than via `loadProjectData`: that clears
408
+ * every module including pages/frames, and recreating the frame reloads the
409
+ * canvas iframe - the very reload this method exists to avoid. Pages and
410
+ * frames are kept; data sources, styles and the wrapper's component tree
411
+ * are what actually differ between pages.
412
+ */
413
+ private swapProjectData;
414
+ /**
415
+ * Number of blocks an author would see under `root`: every component other
416
+ * than the layout scaffolding (wrapper, cells, column groups), nested ones
417
+ * included.
418
+ */
419
+ private countComponentBlocks;
420
+ /**
421
+ * Whether `initial-html` carries blocks the loaded JSON does not. The
422
+ * published HTML is what readers see, so it wins whenever it holds strictly
423
+ * more blocks than the project JSON: a page whose JSON was never produced by
424
+ * this editor (published through the API) may carry only the blocks the
425
+ * server needs. Both sides are always counted, and after the same block-type
426
+ * resolution, so JSON that the editor saved itself always matches its HTML
427
+ * and keeps precedence - and markup with no recognized blocks is never
428
+ * adopted over JSON that has none either.
429
+ */
430
+ private initialHtmlHasMoreBlocks;
431
+ /**
432
+ * Fill a project from `initial-html` when the JSON lacks blocks the HTML
433
+ * has. GrapesJS parses the markup through the block types' `isComponent`
434
+ * recognizers, so each element comes back as its block with the plugin
435
+ * defaults merged in - the same component the picker would create. The one
436
+ * shape the parser cannot produce is the rich-text `content` string: it
437
+ * yields bare text nodes instead, which the host rejects as an empty block,
438
+ * so those are folded back into `content`.
439
+ */
440
+ private adoptInitialHtml;
441
+ /**
442
+ * The page viewer's `--row-gap`, as both the raw CSS value written back into
443
+ * the root column's style and its parsed pixel value (used for add-block
444
+ * popup spacing). Falls back to `12px` when the viewer or the property is
445
+ * missing.
446
+ */
447
+ private measureDefaultRowGap;
448
+ /**
449
+ * Guarantee the wrapper's root BlockCell: add a locked one when the body has
450
+ * none, otherwise re-apply that cell's locked settings and keep every
451
+ * column's drag/drop targets in sync.
452
+ */
453
+ private normalizeRootColumn;
454
+ /**
455
+ * Normalize a freshly loaded project: fall back to `initial-html` when the
456
+ * JSON lacks its blocks, lock the wrapper, guarantee the root BlockCell, rebind
457
+ * the templates data source, and reset the dirty count. Runs on the editor
458
+ * `load` event and again after every `loadPage` soft switch, outside the
459
+ * undo history in both cases.
460
+ */
461
+ private initializeProjectContent;
317
462
  /**
318
463
  * This method undoes the last change made in the content builder.
319
464
  */
@@ -340,6 +485,11 @@ export default class CxContentBuilder extends CortexElement {
340
485
  tryToGetSelectedComponent(): Component | undefined;
341
486
  private fetchTeamSpaceRoles;
342
487
  private updateTranslatableTextsDataSourceEntries;
488
+ /**
489
+ * @param generation The load this refresh belongs to. Once `apiGetTemplates`
490
+ * resolves, a mismatch means a newer page load (or a new editor) owns the canvas,
491
+ * and applying this response would write an older page's templates over it.
492
+ */
343
493
  private updateTemplatesDataSourceEntries;
344
494
  private getHoveredComponentPlacement;
345
495
  private mapHoveredComponent;
@@ -14,6 +14,26 @@ type FontPickerStoredValues = {
14
14
  export declare function getTemplateClass(templateId: string): string;
15
15
  export declare function getContentConfigs(traits: PropertyConfig[], adHocProperties: string[]): string[];
16
16
  export declare function getLimitedBlocks(blockType: BlockType): BlockType[];
17
+ /**
18
+ * Whether a GrapesJS component type is a block an author would see - any
19
+ * registered block type except the layout scaffolding (cells, column groups).
20
+ */
21
+ export declare function isContentBlockType(type: string | undefined): boolean;
22
+ /**
23
+ * A component tree in the shape GrapesJS parsers and `toJSON` produce: one
24
+ * definition, a list of them, or a text string.
25
+ */
26
+ export type ParsedComponentTree = string | ParsedComponentDefinition | ParsedComponentTree[] | undefined;
27
+ export type ParsedComponentDefinition = {
28
+ [key: string]: unknown;
29
+ components?: ParsedComponentTree;
30
+ type?: string;
31
+ };
32
+ /**
33
+ * Number of content blocks (see {@link isContentBlockType}) in a parsed
34
+ * component tree, nested ones included.
35
+ */
36
+ export declare function countContentBlocks(tree: ParsedComponentTree): number;
17
37
  /**
18
38
  * The `space-default` typeface inherits the team space's current font, so the
19
39
  * backend returns it with no variants of its own. Populate its `families` from
@@ -1,4 +1,15 @@
1
1
  import { Editor } from 'grapesjs';
2
2
 
3
+ /**
4
+ * Hosts the editable wrapper inside the canvas document's content container
5
+ * instead of the frame body.
6
+ *
7
+ * The canvas document is a real page render, and it does not always carry the
8
+ * container: the same running editor can be pointed at a page with no block
9
+ * content (a DAM/workspace page) and later back at one that has it. While the
10
+ * container is absent the wrapper is kept detached and every canvas click is
11
+ * left to the page itself - GrapesJS's select handler prevents the default
12
+ * action, which would break the links and buttons of a page it does not own.
13
+ */
3
14
  declare const WrapperContainerPlugin: (selector: string) => (editor: Editor) => void;
4
15
  export default WrapperContainerPlugin;
@@ -9,8 +9,9 @@ import { default as CortexLightElement } from '../../../base/src/cortex-light-el
9
9
  * call, and for blocks needing the team-space list (`cx-sb-button`, `cx-sb-image`,
10
10
  * `cx-sb-video` linking to a space, and `cx-gallery` showing space cards), fetching
11
11
  * the space list once and assigning it as `spaces`. It also distributes its
12
- * `securityBypassToken` to every record-id child (including `cx-timeline`, for
13
- * expired-URL recovery only) so their own runtime Search calls are authorised. Renders no UI. Blocks skip their own fetch whenever an ancestor supplies
12
+ * `securityBypassToken` to the record-id children that still search for themselves
13
+ * (`cx-sb-video`, `cx-sb-audio`, and `cx-timeline` for expired-URL recovery only); an
14
+ * image block takes its URL from the batch instead. Renders no UI. Blocks skip their own fetch whenever an ancestor supplies
14
15
  * it, so they must sit inside this element for that to apply — in the editor that means
15
16
  * inside the canvas document.
16
17
  *
@@ -45,6 +46,13 @@ export default class CxContentBuilderViewer extends CortexLightElement {
45
46
  private getPrimaryRecordId;
46
47
  /** Every field a block could map from fetched asset data. */
47
48
  private getRequestedFields;
49
+ /**
50
+ * Proxy fields that can serve as an image's delivery URL. A hand-picked format names one
51
+ * proxy; `Auto` is decided by the extension this same response carries, so both candidates
52
+ * are requested up front rather than in a follow-up call. The original-file proxy always
53
+ * comes with the transcoded fallback, which is what a non-image original falls back to.
54
+ */
55
+ private getImagePathFields;
48
56
  private buildFetchPlan;
49
57
  private fetchAllAssetData;
50
58
  private applyFetchedData;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Display-only summary of the selection a `cx-board` cannot see, supplied by the host that
3
+ * owns the selection (`cx-multi-select`). The board renders it (header tick/dash, footer
4
+ * count) and never acts on it.
5
+ */
6
+ export declare enum HiddenSelectionState {
7
+ All = "all",
8
+ None = "none",
9
+ Partial = "partial"
10
+ }
11
+ export interface BoardItem {
12
+ /** When true, the item is locked: not draggable, not selectable, not movable. */
13
+ disabled?: boolean;
14
+ group: string;
15
+ id: string;
16
+ index?: string;
17
+ /**
18
+ * Free-form metadata supplied by the host. Each key is a facet field whose display name comes
19
+ * from `cx-multi-select`'s `labelMap`; keys absent from that map are ignored.
20
+ */
21
+ metadata?: Record<string, string>;
22
+ text: string;
23
+ tooltip: string;
24
+ type?: string;
25
+ }
@@ -43,7 +43,40 @@ export type ParseColorValue = {
43
43
  };
44
44
  export declare enum ColorFormat {
45
45
  Hex = "hex",
46
- Rgb = "rgb",
47
46
  Hsl = "hsl",
48
- Hsv = "hsv"
47
+ Hsv = "hsv",
48
+ Rgb = "rgb"
49
49
  }
50
+ /** The kind of CSS gradient produced by the color picker's gradient tab. */
51
+ export declare enum GradientType {
52
+ Linear = "linear",
53
+ Radial = "radial"
54
+ }
55
+ /** Which editing surface the color picker is currently on. */
56
+ export declare enum ColorPickerMode {
57
+ Gradient = "gradient",
58
+ Solid = "solid"
59
+ }
60
+ /** A single color stop within a gradient. */
61
+ export type GradientStop = {
62
+ /**
63
+ * The stop's color. Always stored in a format that carries alpha (`rgba()` or 8-digit hex)
64
+ * so round-tripping through the picker never silently drops opacity.
65
+ */
66
+ color: string;
67
+ /**
68
+ * A stable identifier for the stop. Required because dragging a stop past another one
69
+ * re-sorts the array, and keyed rendering must not recreate the handle mid-drag.
70
+ */
71
+ id: string;
72
+ /** Position along the gradient line, 0-100. */
73
+ position: number;
74
+ };
75
+ /** A parsed gradient: its type, angle, and stops. */
76
+ export type GradientValue = {
77
+ /** Angle in degrees, 0-360. Only meaningful when `type` is `GradientType.Linear`. */
78
+ angle: number;
79
+ /** Color stops, always sorted by `position` ascending, always at least two entries. */
80
+ stops: GradientStop[];
81
+ type: GradientType;
82
+ };
@@ -37,6 +37,7 @@ export interface Translation extends DefaultTranslation {
37
37
  addControl: string;
38
38
  addCurrent: string;
39
39
  addFolderCard: string;
40
+ addGradientStop: string;
40
41
  addLimitExceeded: (limit: number) => string;
41
42
  addMarker: string;
42
43
  addPageCard: string;
@@ -506,6 +507,10 @@ export interface Translation extends DefaultTranslation {
506
507
  goToFirstPage: string;
507
508
  goToLastPage: string;
508
509
  goToSlide: (slide: number, count: number) => string;
510
+ gradient: string;
511
+ gradientAngle: string;
512
+ gradientStopNumber: (index: number) => string;
513
+ gradientStops: string;
509
514
  grid: string;
510
515
  groupBy: string;
511
516
  guttersWidth: string;
@@ -516,6 +521,7 @@ export interface Translation extends DefaultTranslation {
516
521
  height: string;
517
522
  heightMode: string;
518
523
  help: string;
524
+ hex: string;
519
525
  hideCode: string;
520
526
  hideColumn: string;
521
527
  hidePassword: string;
@@ -810,6 +816,7 @@ export interface Translation extends DefaultTranslation {
810
816
  quality: string;
811
817
  qualityHelpText: string;
812
818
  quote: string;
819
+ radial: string;
813
820
  radixPoint: string;
814
821
  read: string;
815
822
  readingMode: string;
@@ -825,6 +832,7 @@ export interface Translation extends DefaultTranslation {
825
832
  remove: string;
826
833
  removeBlock: string;
827
834
  removeFolder: (num: number) => string;
835
+ removeGradientStop: string;
828
836
  renderAudio: string;
829
837
  replace: string;
830
838
  replaceAll: string;
@@ -0,0 +1,65 @@
1
+ import { GradientStop, GradientValue } from '../../../types/src/color-picker';
2
+
3
+ /** A gradient needs at least a start and an end color to be meaningful. */
4
+ export declare const MIN_GRADIENT_STOPS = 2;
5
+ /**
6
+ * Creates a process-unique identifier for a gradient stop.
7
+ * @returns An identifier that stays stable for the lifetime of the stop.
8
+ * @example createStopId() => "gradient-stop-1"
9
+ */
10
+ export declare function createStopId(): string;
11
+ /**
12
+ * Splits a string on a separator, ignoring separators nested inside parentheses.
13
+ * Needed because `rgba(255, 0, 0, 1)` contains commas that must not split the stop list.
14
+ * @param value - The string to split.
15
+ * @param separator - The single character to split on.
16
+ * @returns The trimmed top-level segments, with empty segments removed.
17
+ * @example splitTopLevel('rgba(1, 2, 3, 1) 0%, #fff 100%', ',') => ['rgba(1, 2, 3, 1) 0%', '#fff 100%']
18
+ */
19
+ export declare function splitTopLevel(value: string, separator: string): string[];
20
+ /**
21
+ * Normalizes any angle into the 0-360 range.
22
+ * @param degrees - The angle in degrees, possibly negative or above 360.
23
+ * @returns The equivalent angle within 0-360.
24
+ * @example normalizeAngle(-90) => 270
25
+ */
26
+ export declare function normalizeAngle(degrees: number): number;
27
+ /**
28
+ * Sorts stops by position ascending, preserving the relative order of equal positions.
29
+ * @param stops - The stops to sort.
30
+ * @returns A new sorted array; the input is not mutated.
31
+ * @example sortStops([{ position: 100 }, { position: 0 }]) => [0%, 100%]
32
+ */
33
+ export declare function sortStops(stops: GradientStop[]): GradientStop[];
34
+ /**
35
+ * Checks whether a value looks like a CSS gradient this module can handle.
36
+ * @param value - The candidate string.
37
+ * @returns True for `linear-gradient(...)` and `radial-gradient(...)` strings.
38
+ * @example isGradientString('linear-gradient(90deg, red, blue)') => true
39
+ */
40
+ export declare function isGradientString(value: string): boolean;
41
+ /**
42
+ * Parses a CSS gradient string into structured stops.
43
+ * @param value - The gradient string to parse.
44
+ * @returns The parsed gradient, or null when the value is not a supported gradient or does
45
+ * not contain at least two valid color stops.
46
+ * @example parseGradient('linear-gradient(90deg, #f00 0%, #00f 100%)')
47
+ */
48
+ export declare function parseGradient(value: string): GradientValue | null;
49
+ /**
50
+ * Serializes structured stops back into a CSS gradient string.
51
+ * @param value - The gradient to serialize.
52
+ * @returns A CSS gradient string suitable for a `background` declaration.
53
+ * @example serializeGradient({ angle: 90, stops, type: GradientType.Linear })
54
+ * => 'linear-gradient(90deg, #ff0000 0%, #0000ff 100%)'
55
+ */
56
+ export declare function serializeGradient(value: GradientValue): string;
57
+ /**
58
+ * Computes the color a new stop should take when inserted at a position, by blending the
59
+ * two stops it falls between.
60
+ * @param stops - The existing stops; need not be sorted.
61
+ * @param position - Where the new stop is being inserted, 0-100.
62
+ * @returns An `rgba()` color string, or an empty string when there are no stops to blend.
63
+ * @example interpolateStopColor(redAtZeroAndBlueAtHundred, 50) => 'rgba(128, 0, 128, 1)'
64
+ */
65
+ export declare function interpolateStopColor(stops: GradientStop[], position: number): string;
@@ -0,0 +1 @@
1
+ export * from './gradient';
@@ -32,6 +32,7 @@ export * from './event';
32
32
  export * from './fetch';
33
33
  export * from './font';
34
34
  export * from './form';
35
+ export * from './gradient';
35
36
  export * from './history-manager';
36
37
  export * from './image';
37
38
  export * from './keyboard';
@@ -55,6 +55,8 @@ export declare function applyWidthToAssetUrl(url: string, width: number): string
55
55
  * crop or proxy format), so a ladder must not add a competing one.
56
56
  */
57
57
  export declare function hasTransformSegment(url: string): boolean;
58
+ /** Proxy format that serves the asset's original file rather than a rendered variant. */
59
+ export declare const ORIGINAL_FORMAT = "TRX";
58
60
  /** Proxy format that is always transcoded to a raster image, whatever the source file is. */
59
61
  export declare const AUTO_FALLBACK_FORMAT = "TR1";
60
62
  /**