@orangelogic/design-system 2.171.0 → 2.172.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/components/types.js +22247 -22082
- package/library/package.json +1 -1
- package/library/packages/organisms/src/content-builder/content-builder.d.ts +23 -0
- package/library/packages/organisms/src/content-builder/content-builder.telemetry.d.ts +67 -0
- package/library/packages/organisms/src/content-builder/plugins/index.d.ts +1 -0
- package/library/packages/organisms/src/content-builder/plugins/telemetry.d.ts +15 -0
- package/library/react-web-component.d.ts +4 -0
- package/package.json +1 -1
package/library/package.json
CHANGED
|
@@ -111,6 +111,15 @@ export default class CxContentBuilder extends CortexElement {
|
|
|
111
111
|
* @default false
|
|
112
112
|
*/
|
|
113
113
|
enableAssetFormatControls: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Whether the content builder emits `ol:ui-metric` events timing each user action,
|
|
116
|
+
* for collection as browser OpenTelemetry histograms.
|
|
117
|
+
*
|
|
118
|
+
* Off by default: when false no timers are armed and no events are dispatched, so an
|
|
119
|
+
* unmonitored site pays nothing for this being here.
|
|
120
|
+
* @default false
|
|
121
|
+
*/
|
|
122
|
+
enableMetrics: boolean;
|
|
114
123
|
/**
|
|
115
124
|
* Default asset format applied to image blocks.
|
|
116
125
|
* Used as the initial format when a block is added, whether or not
|
|
@@ -221,6 +230,20 @@ export default class CxContentBuilder extends CortexElement {
|
|
|
221
230
|
private readonly initializeCustomFrame;
|
|
222
231
|
private containerDropdownObservers;
|
|
223
232
|
private nextMapHoveredBadgeState;
|
|
233
|
+
/**
|
|
234
|
+
* Host callbacks handed to GrapesJS blocks and config UI, each timed via
|
|
235
|
+
* `measurePromise` so the promise's own settling is the completion signal.
|
|
236
|
+
*
|
|
237
|
+
* Getters, not fields set once in the constructor: a host can override
|
|
238
|
+
* `onRequestAsset` (etc.) on the element instance after construction but before
|
|
239
|
+
* these are read (e.g. `el.onRequestAsset = customFn`), and a constructor-time
|
|
240
|
+
* `.bind()` would have captured the original method forever, silently ignoring
|
|
241
|
+
* that override.
|
|
242
|
+
*/
|
|
243
|
+
private get measuredOnRequestAsset();
|
|
244
|
+
private get measuredOnRequestDownloadFormat();
|
|
245
|
+
private get measuredOnConfigureWorkflow();
|
|
246
|
+
private get measuredOnRequestAssetFormat();
|
|
224
247
|
get isDesigner(): boolean;
|
|
225
248
|
get isTemplateEditable(): boolean;
|
|
226
249
|
get isMultiLanguage(): boolean;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { Component } from 'grapesjs';
|
|
2
|
+
|
|
3
|
+
export declare const UiAction: {
|
|
4
|
+
readonly AddBlock: "add_block";
|
|
5
|
+
readonly ConfigureWorkflow: "configure_workflow";
|
|
6
|
+
readonly DeviceSwitch: "device_switch";
|
|
7
|
+
readonly DuplicateBlock: "duplicate_block";
|
|
8
|
+
readonly EditorBoot: "editor_boot";
|
|
9
|
+
readonly MoveBlock: "move_block";
|
|
10
|
+
readonly OpenConfig: "open_config";
|
|
11
|
+
readonly PickAsset: "pick_asset";
|
|
12
|
+
readonly PickAssetFormat: "pick_asset_format";
|
|
13
|
+
readonly PickDownloadFormat: "pick_download_format";
|
|
14
|
+
readonly Redo: "redo";
|
|
15
|
+
readonly RemoveBlock: "remove_block";
|
|
16
|
+
readonly RichTextEdit: "rich_text_edit";
|
|
17
|
+
readonly SaveConfig: "save_config";
|
|
18
|
+
readonly SelectBlock: "select_block";
|
|
19
|
+
readonly Undo: "undo";
|
|
20
|
+
};
|
|
21
|
+
export type UiActionName = (typeof UiAction)[keyof typeof UiAction];
|
|
22
|
+
/** Mirrors the CMS5_BO.Data.MetricsIsEnabled parameter, passed in by the host VForm. */
|
|
23
|
+
export declare function setEditorMetricsEnabled(enabled: boolean): void;
|
|
24
|
+
/** Whether metrics are currently armed - the same flag `measureSync` and friends check. */
|
|
25
|
+
export declare function isEditorMetricsEnabled(): boolean;
|
|
26
|
+
export declare function dispatch(action: string, durationMs: number, component: string, blockType?: string): void;
|
|
27
|
+
/**
|
|
28
|
+
* Derive the block-type label from a GrapesJS component.
|
|
29
|
+
*
|
|
30
|
+
* Returns undefined for anything that is not a CMS5 block - a raw text node, a wrapper,
|
|
31
|
+
* an element the builder does not own - so those actions are recorded without a block
|
|
32
|
+
* dimension rather than under a misleading one.
|
|
33
|
+
*/
|
|
34
|
+
export declare function blockTypeOf(component?: Component): string | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Time a synchronous action through to the paint that shows its result.
|
|
37
|
+
*
|
|
38
|
+
* Two nested frames, not one: the first callback still runs before the browser
|
|
39
|
+
* paints, so ending there would time the JavaScript and miss the layout and paint
|
|
40
|
+
* the user is actually waiting on.
|
|
41
|
+
*/
|
|
42
|
+
export declare function measureSync(action: UiActionName, blockType?: string): void;
|
|
43
|
+
/**
|
|
44
|
+
* Time a synchronous action that started earlier, through to the paint that shows it.
|
|
45
|
+
*
|
|
46
|
+
* Needed for the editor commands: the only place that knows which block was
|
|
47
|
+
* involved is *after* the command has run, but the clock has to start before it.
|
|
48
|
+
* The caller keeps the start time and supplies the block type at the end, so the
|
|
49
|
+
* sample covers the whole action rather than only its trailing paint.
|
|
50
|
+
*/
|
|
51
|
+
export declare function measureSyncFrom(startedAt: number, action: UiActionName, blockType?: string): void;
|
|
52
|
+
/**
|
|
53
|
+
* Start timing an action that finishes on its own schedule, and return the ender.
|
|
54
|
+
*
|
|
55
|
+
* Used where a paint is not the completion signal - opening the asset picker, saving
|
|
56
|
+
* a config, booting the editor. The returned function is safe to call more than once;
|
|
57
|
+
* only the first call records.
|
|
58
|
+
*/
|
|
59
|
+
export declare function measureAsync(action: UiActionName, blockType?: string): () => void;
|
|
60
|
+
/**
|
|
61
|
+
* Wrap a promise-returning host callback so it reports how long it took.
|
|
62
|
+
*
|
|
63
|
+
* The picker is host code we hand control to, so the promise settling is the only
|
|
64
|
+
* reliable completion signal. Rejections are timed too and then rethrown untouched:
|
|
65
|
+
* a picker that fails slowly is exactly the case worth seeing.
|
|
66
|
+
*/
|
|
67
|
+
export declare function measurePromise<TArgs extends unknown[], TResult>(action: UiActionName, fn: (...args: TArgs) => Promise<TResult>, blockType?: string): (...args: TArgs) => Promise<TResult>;
|
|
@@ -19,6 +19,7 @@ export { default as RichTextEditorPlugin } from './rich-text-editor';
|
|
|
19
19
|
export * from './rich-text-editor/components';
|
|
20
20
|
export { default as SearchBoxPlugin } from './search-box';
|
|
21
21
|
export { default as TabsPlugin } from './tab-group';
|
|
22
|
+
export { default as TelemetryPlugin } from './telemetry';
|
|
22
23
|
export { default as TextPlugin } from './text';
|
|
23
24
|
export { default as TimelinePlugin } from './timeline';
|
|
24
25
|
export { default as VideoPlugin } from './video';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Editor } from 'grapesjs';
|
|
2
|
+
|
|
3
|
+
export type TelemetryPluginOptions = {
|
|
4
|
+
bootStartedAt: number;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Subscribe to the editor's own event bus for edit-mode timing.
|
|
8
|
+
*
|
|
9
|
+
* A GrapesJS plugin rather than a function called after `grapesjs.init()`: all
|
|
10
|
+
* edit-mode instrumentation then lives alongside the other editor plugins and is
|
|
11
|
+
* wired the same way (`plugins: [...]`), instead of being a one-off call the reader
|
|
12
|
+
* has to notice separately.
|
|
13
|
+
*/
|
|
14
|
+
declare const TelemetryPlugin: (editor: Editor, options: TelemetryPluginOptions) => void;
|
|
15
|
+
export default TelemetryPlugin;
|
|
@@ -9769,6 +9769,10 @@
|
|
|
9769
9769
|
* Whether to expose the asset format / transformation / download-format / asset-format-picker controls in the per-block config sidebar for image, video, gallery, carousel, and timeline blocks. <br/>@default false
|
|
9770
9770
|
*/
|
|
9771
9771
|
enableAssetFormatControls?: boolean;
|
|
9772
|
+
/**
|
|
9773
|
+
* Whether the content builder emits `ol:ui-metric` events timing each user action, for collection as browser OpenTelemetry histograms. <br/> Off by default: when false no timers are armed and no events are dispatched, so an unmonitored site pays nothing for this being here. <br/>@default false
|
|
9774
|
+
*/
|
|
9775
|
+
enableMetrics?: boolean;
|
|
9772
9776
|
/**
|
|
9773
9777
|
* Default asset format applied to image blocks. Used as the initial format when a block is added, whether or not `enable-asset-format-controls` is on. <br/>@default 'TR1'
|
|
9774
9778
|
*/
|