@orangelogic/design-system 3.20.0 → 4.0.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.
- package/library/chunks/{asset-link-format.BnE0FbUH.js → asset-link-format.ttcRQgDc.js} +1 -1
- package/library/chunks/{color-swatch-group.GEu5gVrg.js → color-swatch-group.Bumfw-G2.js} +2 -2
- package/library/chunks/{document-viewer.Bkf3JbWk.js → document-viewer.C9tM2Gc7.js} +1 -1
- package/library/chunks/{folder-select.D8_6pC8Y.js → folder-select.BAPsI-gg.js} +1 -1
- package/library/chunks/{index.Ct-dh3Y5.js → index.Coy2OPB4.js} +5 -5
- package/library/chunks/{toast.CGIDPKV8.js → toast.BxiewnAG.js} +1 -1
- package/library/chunks/{transformation.OaRYixzE.js → transformation.CjWnFhab.js} +12 -11
- package/library/chunks/{tree.DB-QLic1.js → tree.B7IKBX3n.js} +6 -3
- package/library/chunks/{types.DrJgdbwu.js → types.DVZ_cbKn.js} +14162 -13849
- package/library/components/asset-link-format.js +2 -2
- package/library/components/atoms.js +2 -2
- package/library/components/audio.js +1 -1
- package/library/components/color-swatch-group.js +3 -3
- package/library/components/document-viewer.js +1 -1
- package/library/components/file-on-demand.js +1 -1
- package/library/components/folder-select.js +2 -2
- package/library/components/molecules.js +1 -1
- package/library/components/mutation-observer.js +1 -1
- package/library/components/organisms.js +2 -2
- package/library/components/tree-item.js +1 -1
- package/library/components/tree.js +1 -1
- package/library/components/types.js +152 -151
- package/library/components/video.js +1 -1
- package/library/package.json +1 -1
- package/library/packages/atoms/src/components/audio/audio.d.ts +1 -0
- package/library/packages/atoms/src/components/tree/tree.d.ts +2 -2
- package/library/packages/atoms/src/components/video/video.d.ts +1 -0
- package/library/packages/organisms/src/bento-grid/bento-grid.d.ts +32 -11
- package/library/packages/organisms/src/content-builder/blocks/audio/audio.d.ts +1 -0
- package/library/packages/organisms/src/content-builder/blocks/image/image.d.ts +27 -4
- package/library/packages/organisms/src/content-builder/content-builder-constants.d.ts +12 -0
- package/library/packages/organisms/src/content-builder/content-builder.d.ts +150 -0
- package/library/packages/organisms/src/content-builder/content-builder.utils.d.ts +20 -0
- package/library/packages/organisms/src/content-builder/plugins/wrapper-container.d.ts +11 -0
- package/library/packages/organisms/src/content-builder-viewer/content-builder-viewer.d.ts +10 -2
- package/library/packages/utils/src/transformation/transformation.d.ts +2 -0
- package/library/react-web-component.d.ts +4 -0
- package/library/utils.js +109 -108
- package/package.json +1 -1
|
@@ -42,7 +42,7 @@ export default class CxBentoGrid extends CortexElement {
|
|
|
42
42
|
/** Cached viewport height — updated on resize only, not on every scroll. */
|
|
43
43
|
private _viewportHeight;
|
|
44
44
|
/** Watches the host element for size changes so the grid reflows when its container resizes. */
|
|
45
|
-
private
|
|
45
|
+
private resizeObserver;
|
|
46
46
|
/** Tracks the last emitted range to avoid firing cx-bento-range-change when the range hasn't changed. */
|
|
47
47
|
private _lastEmittedFirst;
|
|
48
48
|
private _lastEmittedLast;
|
|
@@ -273,6 +273,11 @@ export default class CxBentoGrid extends CortexElement {
|
|
|
273
273
|
runConnectedCallback(): void;
|
|
274
274
|
disconnectedCallback(): void;
|
|
275
275
|
runFirstUpdated(): void;
|
|
276
|
+
/**
|
|
277
|
+
* ResizeObserver on the container covers both window resize and any container-driven
|
|
278
|
+
* width changes (sidebar toggle, flex layout shifts, etc.).
|
|
279
|
+
*/
|
|
280
|
+
private observeContainerResize;
|
|
276
281
|
/**
|
|
277
282
|
* Returns the visible viewport height for virtualization.
|
|
278
283
|
*
|
|
@@ -339,8 +344,27 @@ export default class CxBentoGrid extends CortexElement {
|
|
|
339
344
|
* instead of stopping it.
|
|
340
345
|
*/
|
|
341
346
|
private scheduleRowRelease;
|
|
342
|
-
/**
|
|
347
|
+
/** Drops the pending release, keeping the rows already released. */
|
|
348
|
+
private cancelRowRelease;
|
|
349
|
+
/**
|
|
350
|
+
* Clears any pending release and resets the gate back to its initial state.
|
|
351
|
+
*
|
|
352
|
+
* Must run BEFORE `computeLayout()` in the same pass: that call ends by arming the
|
|
353
|
+
* next release, and a reset landing after it cancels the arm with nothing left to
|
|
354
|
+
* re-arm, which gates every row for good.
|
|
355
|
+
*/
|
|
343
356
|
private resetRowRelease;
|
|
357
|
+
/**
|
|
358
|
+
* Restarts row gating when the dataset shrinks or is replaced wholesale.
|
|
359
|
+
*
|
|
360
|
+
* Row indices refer to a specific layout, so keeping a release count across a new
|
|
361
|
+
* dataset would let its rows load all at once — the burst this gate exists to prevent.
|
|
362
|
+
* Progress is kept only for an appended page: the new dataset must repeat the previous
|
|
363
|
+
* items, in order, as its prefix, so the already-released rows still hold the same
|
|
364
|
+
* items and the new rows queue behind them. Any other replacement restarts the gate,
|
|
365
|
+
* including a same-length or larger array carrying different items.
|
|
366
|
+
*/
|
|
367
|
+
private resetRowReleaseForNewData;
|
|
344
368
|
/**
|
|
345
369
|
* Returns the index of the last item whose rowStart is within maxRows.
|
|
346
370
|
*/
|
|
@@ -377,21 +401,18 @@ export default class CxBentoGrid extends CortexElement {
|
|
|
377
401
|
* idempotent — safe to call again on already-observed elements.
|
|
378
402
|
*/
|
|
379
403
|
private observeItemContentSlots;
|
|
404
|
+
/**
|
|
405
|
+
* Decides whether this pass restarts row gating, and does so.
|
|
406
|
+
*
|
|
407
|
+
* Must run BEFORE `computeLayout()` — see `resetRowRelease()`.
|
|
408
|
+
*/
|
|
409
|
+
private applyRowReleaseResets;
|
|
380
410
|
willUpdate(changed: PropertyValues): void;
|
|
381
411
|
/**
|
|
382
412
|
* Re-syncs row content heights whenever the layout recomputes (containerStyles
|
|
383
413
|
* changes on every computeLayout() call, including resize-driven reflows) or
|
|
384
414
|
* the sync-row-content-height flag itself is toggled.
|
|
385
415
|
*/
|
|
386
|
-
/**
|
|
387
|
-
* Restarts row gating when the dataset shrinks or is replaced wholesale.
|
|
388
|
-
*
|
|
389
|
-
* Row indices refer to a specific layout, so keeping a release count across a new
|
|
390
|
-
* dataset would let its rows load all at once — the burst this gate exists to prevent.
|
|
391
|
-
* A dataset that only grew is treated as an appended page: the already-released rows
|
|
392
|
-
* still hold the same items, so their progress is kept and the new rows queue behind.
|
|
393
|
-
*/
|
|
394
|
-
handleDataChangeForRowRelease(oldData?: unknown, newData?: unknown): void;
|
|
395
416
|
handleRowContentHeightSync(): Promise<void>;
|
|
396
417
|
/**
|
|
397
418
|
* Get content position based on the size of the item.
|
|
@@ -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
|
-
*
|
|
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
|
|
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
|
|
13
|
-
* expired-URL recovery only)
|
|
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;
|
|
@@ -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
|
/**
|
|
@@ -10070,6 +10070,10 @@
|
|
|
10070
10070
|
* Initial data for the content builder This should be a JSON string representing the initial state of the content builder. <br/>@default ''
|
|
10071
10071
|
*/
|
|
10072
10072
|
initialData?: string;
|
|
10073
|
+
/**
|
|
10074
|
+
* Published HTML of the page, used as the content source when it holds more content blocks than `initial-data` (a page whose JSON was never produced by this editor, e.g. published through the API with HTML only or with a partial JSON). Parsed through the registered block types, so every block the editor knows is recovered. Ignored when `initial-data` has at least as many blocks. <br/>@default ''
|
|
10075
|
+
*/
|
|
10076
|
+
initialHtml?: string;
|
|
10073
10077
|
/**
|
|
10074
10078
|
* This property reflects the current device type being used in the content builder. It can be one of the predefined device types such as 'desktop', 'tablet', or 'mobile'. <br/>@default 'desktop'
|
|
10075
10079
|
*/
|