@orangelogic/design-system 4.30.0 → 4.31.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/assets/validation.worker-CATXl-v2.js +1 -0
- package/library/chunks/{alert.CuW7fOVy.js → alert.l5EVK3-E.js} +2 -2
- package/library/chunks/{array-line-clamp.AbuJqKJ3.js → array-line-clamp.CU5D9cZY.js} +2 -2
- package/library/chunks/{asset-link-format.DLmg4fTR.js → asset-link-format.vptDP26p.js} +116 -106
- package/library/chunks/{audio.BVQX3_8E.js → audio.CeFgoQdF.js} +14 -7
- package/library/chunks/{bicolor-picker.C9XSuhnX.js → bicolor-picker.CU3ukAg7.js} +1 -1
- package/library/chunks/{block-width.D0anJjOD.js → block-width.CMPZBHqn.js} +81 -81
- package/library/chunks/{border-input-group.DESRXoh1.js → border-input-group.CD01EzK_.js} +3 -3
- package/library/chunks/{breadcrumb.qggcceb5.js → breadcrumb.wAs0dDVb.js} +1 -1
- package/library/chunks/{button.CI1tg4c9.js → button.CD8evBb3.js} +2 -2
- package/library/chunks/{color-picker.DUEghDon.js → color-picker.BJqVkgCG.js} +10 -10
- package/library/chunks/{color-swatch-group.BTrVIgkv.js → color-swatch-group.RTIWNZVn.js} +690 -614
- package/library/chunks/{color-swatch.CcWp7P5w.js → color-swatch.CZKAA6aA.js} +3 -3
- package/library/chunks/{config-manager.gcdPEXK6.js → config-manager.D7YYUDHX.js} +28 -28
- package/library/chunks/{configs-controller.8izRFSig.js → configs-controller.CGAljtXC.js} +55 -7
- package/library/chunks/{confirm-popover.CaNKM2dH.js → confirm-popover.CuUcSDEG.js} +4 -4
- package/library/chunks/{copy-button.BLHge7EN.js → copy-button.Db9OgUsk.js} +2 -2
- package/library/chunks/{corner-position-input-group.CPrsYabs.js → corner-position-input-group.D7nqy1PF.js} +4 -4
- package/library/chunks/{date-calendar.UWxXkZCn.js → date-calendar.QH4E3gcB.js} +1 -1
- package/library/chunks/{details.DLqFxjTf.js → details.QX575PyS.js} +1 -1
- package/library/chunks/{dialog.BuirdRW8.js → dialog.CWc63UTR.js} +3 -3
- package/library/chunks/{document-viewer.DZp_IRF7.js → document-viewer.CqFpoWJg.js} +14 -14
- package/library/chunks/{dot-pagination.CSSalEx6.js → dot-pagination.DecVZgSJ.js} +2 -2
- package/library/chunks/{drawer.BO3puoiw.js → drawer.DlQiWzOM.js} +2 -2
- package/library/chunks/{dropdown.HoJsYnUC.js → dropdown.HWaiHRYl.js} +4 -4
- package/library/chunks/{dynamic-select.G1V7Da24.js → dynamic-select.C4ZFmny4.js} +5 -5
- package/library/chunks/{e-chart.BopkVc04.js → e-chart.c19ibTnT.js} +2 -2
- package/library/chunks/{element-clamp.DIUYu8kK.js → element-clamp.Bo_TtVq2.js} +2 -2
- package/library/chunks/{file-on-demand.C_2vBGS3.js → file-on-demand.C7BgY0Pl.js} +16 -16
- package/library/chunks/{folder-select.CzNXsgl_.js → folder-select.Cymp8xGF.js} +7 -7
- package/library/chunks/{format-time.BO9Y72qk.js → format-time.Dfu1FCrK.js} +1 -1
- package/library/chunks/{header.BaWpIXRz.js → header.BosjiWVg.js} +2 -2
- package/library/chunks/{i18n.BMXeDUpk.js → i18n.D_iHIFdS.js} +3 -0
- package/library/chunks/{icon-button.CziUJUiX.js → icon-button.D6mTxvLN.js} +2 -2
- package/library/chunks/{iframe.BnAR2-o2.js → iframe.C7j4Uzku.js} +1 -1
- package/library/chunks/{image-comparer.DStatUUS.js → image-comparer.D7C-cLm6.js} +1 -1
- package/library/chunks/{image.BD0t8XU4.js → image.CIGPxKGh.js} +17 -4
- package/library/chunks/{input.B3HfssSr.js → input.C44u0jQi.js} +1 -1
- package/library/chunks/{line-clamp.DlenWria.js → line-clamp.D9NJFIfS.js} +2 -2
- package/library/chunks/{markdown.C-q35PEY.js → markdown.B6J44eJB.js} +2 -2
- package/library/chunks/{masonry.B3G5f-eL.js → masonry.BwhxOJL-.js} +3 -3
- package/library/chunks/{menu-item.DS4-vQe3.js → menu-item.BpB-Zp1I.js} +3 -3
- package/library/chunks/{menu.BRFXqBpq.js → menu.TbftncJn.js} +2 -2
- package/library/chunks/{option.wsYX6Pp-.js → option.DFutJxYo.js} +1 -1
- package/library/chunks/{padding-input-group.DKIv6567.js → padding-input-group.CSYzP2s4.js} +1 -1
- package/library/chunks/{pagination.By0sijVv.js → pagination.DQgNOqGM.js} +7 -7
- package/library/chunks/{popup.CxGrVXG-.js → popup.DwPq0yI9.js} +1 -1
- package/library/chunks/{position-picker.CyXlSYCi.js → position-picker.aNCROlig.js} +1 -1
- package/library/chunks/{progress-bar.Cp8jz3Cn.js → progress-bar.VFfb2YnK.js} +1 -1
- package/library/chunks/{progress-ring.CMylJgKR.js → progress-ring.Czn6GoZL.js} +1 -1
- package/library/chunks/{radio-card.DPIcsAW9.js → radio-card.BKJtxuuO.js} +1 -1
- package/library/chunks/{range.Dl85wEtv.js → range.UVbDGy7M.js} +2 -2
- package/library/chunks/{rating.C-3rSMOT.js → rating.Dpqp5fJ2.js} +1 -1
- package/library/chunks/{relative-time.5fu63h4C.js → relative-time.ImRpAXxg.js} +1 -1
- package/library/chunks/{select.v6t2pNH4.js → select.eBMe63kf.js} +8 -8
- package/library/chunks/{shadow-input-group.CFb61kzG.js → shadow-input-group.CZaqMPQV.js} +2 -2
- package/library/chunks/{share-option-list.BO50cnCs.js → share-option-list.CVyc5zE3.js} +2 -2
- package/library/chunks/{sidebar.CDTaDQY_.js → sidebar.B1CkFnS-.js} +1 -1
- package/library/chunks/{size-input-group.Z_9n7Nv6.js → size-input-group.IVVAysAr.js} +5 -5
- package/library/chunks/{spinner.-79sJ3oo.js → spinner.BPSFoJkz.js} +1 -1
- package/library/chunks/{split-panel.DE2NmORY.js → split-panel.BsE9_zvp.js} +1 -1
- package/library/chunks/{src.DKYroWZc.js → src.BVh8NgdB.js} +1 -1
- package/library/chunks/{src.fDrPRx_j.js → src.CswHQQN4.js} +47 -47
- package/library/chunks/{step.BKIlgV-h.js → step.GmnPARTV.js} +3 -3
- package/library/chunks/{stepper-wizard.BCNJD-aa.js → stepper-wizard.D_MmYLfc.js} +2 -2
- package/library/chunks/{stepper.D-B3UVVF.js → stepper.-RZKsA5t.js} +1 -1
- package/library/chunks/{tab-group.oiueox5q.js → tab-group.xQlBJJPJ.js} +7 -7
- package/library/chunks/{tab.Dd0cNxxc.js → tab.DMcCiQv2.js} +3 -3
- package/library/chunks/{tag.CWTVcGc7.js → tag.dbXBL3Rg.js} +3 -3
- package/library/chunks/{tooltip.CGCOh4cQ.js → tooltip.BAg1FXgE.js} +2 -2
- package/library/chunks/{tree.BZvt8Ol0.js → tree.CydKk_dU.js} +3 -3
- package/library/chunks/{typeface.BU6CLTXo.js → typeface.CbVDDGWe.js} +3 -3
- package/library/chunks/{video.Ba5xl_3K.js → video.dKdkgJUo.js} +4575 -4525
- package/library/components/alert.js +1 -1
- package/library/components/array-line-clamp.js +1 -1
- package/library/components/asset-link-format.js +1 -1
- package/library/components/atoms.js +48 -48
- package/library/components/audio.js +1 -1
- package/library/components/bicolor-picker.js +1 -1
- package/library/components/border-input-group.js +1 -1
- package/library/components/breadcrumb.js +1 -1
- package/library/components/button.js +1 -1
- package/library/components/color-picker.js +1 -1
- package/library/components/color-swatch-group.js +1 -1
- package/library/components/color-swatch.js +1 -1
- package/library/components/confirm-popover.js +1 -1
- package/library/components/copy-button.js +1 -1
- package/library/components/corner-position-input-group.js +1 -1
- package/library/components/date-calendar.js +1 -1
- package/library/components/details.js +1 -1
- package/library/components/dialog.js +1 -1
- package/library/components/document-viewer.js +1 -1
- package/library/components/dot-pagination.js +1 -1
- package/library/components/drawer.js +1 -1
- package/library/components/dropdown.js +1 -1
- package/library/components/dynamic-select.js +1 -1
- package/library/components/e-chart.js +1 -1
- package/library/components/element-clamp.js +1 -1
- package/library/components/file-on-demand.js +1 -1
- package/library/components/folder-select.js +1 -1
- package/library/components/format-bytes.js +1 -1
- package/library/components/format-date.js +1 -1
- package/library/components/format-number.js +1 -1
- package/library/components/format-time.js +1 -1
- package/library/components/header.js +1 -1
- package/library/components/icon-button.js +1 -1
- package/library/components/iframe.js +1 -1
- package/library/components/image-comparer.js +1 -1
- package/library/components/image.js +1 -1
- package/library/components/input.js +1 -1
- package/library/components/line-clamp.js +1 -1
- package/library/components/markdown.js +1 -1
- package/library/components/masonry.js +1 -1
- package/library/components/menu-item.js +1 -1
- package/library/components/menu.js +1 -1
- package/library/components/molecules.js +16 -16
- package/library/components/option.js +1 -1
- package/library/components/organisms.js +3 -3
- package/library/components/padding-input-group.js +1 -1
- package/library/components/pagination.js +1 -1
- package/library/components/popup.js +1 -1
- package/library/components/position-picker.js +1 -1
- package/library/components/progress-bar.js +1 -1
- package/library/components/progress-ring.js +1 -1
- package/library/components/radio-card.js +1 -1
- package/library/components/range.js +1 -1
- package/library/components/rating.js +1 -1
- package/library/components/relative-time.js +1 -1
- package/library/components/select.js +1 -1
- package/library/components/shadow-input-group.js +1 -1
- package/library/components/share-option-list.js +1 -1
- package/library/components/sidebar.js +1 -1
- package/library/components/size-input-group.js +1 -1
- package/library/components/spinner.js +1 -1
- package/library/components/split-panel.js +1 -1
- package/library/components/step.js +1 -1
- package/library/components/stepper-wizard.js +1 -1
- package/library/components/stepper.js +1 -1
- package/library/components/tab-group.js +1 -1
- package/library/components/tab.js +1 -1
- package/library/components/tag.js +1 -1
- package/library/components/tooltip.js +1 -1
- package/library/components/tree-item.js +1 -1
- package/library/components/tree.js +1 -1
- package/library/components/typeface.js +1 -1
- package/library/components/types.js +10623 -10454
- package/library/components/video.js +1 -1
- package/library/package.json +1 -1
- package/library/packages/atoms/src/components/audio/audio.d.ts +15 -0
- package/library/packages/atoms/src/components/image/image.d.ts +1 -1
- package/library/packages/atoms/src/components/video/video.d.ts +23 -0
- package/library/packages/molecules/src/multi-select/components/board-list-item/board-list-item.d.ts +1 -0
- package/library/packages/organisms/src/chatbot/chatbot.d.ts +1 -1
- package/library/packages/organisms/src/content-builder/blocks/gallery/gallery.d.ts +7 -0
- package/library/packages/organisms/src/content-builder/blocks/image/image.d.ts +17 -1
- package/library/packages/organisms/src/content-builder/blocks/video/video.d.ts +1 -0
- package/library/packages/organisms/src/content-builder/configs/image.d.ts +4 -0
- package/library/packages/organisms/src/content-builder/configs-controller.d.ts +14 -10
- package/library/packages/organisms/src/index.d.ts +1 -0
- package/library/packages/services/src/api/asset/asset.d.ts +3 -3
- package/library/packages/services/src/api/asset/asset.types.d.ts +4 -0
- package/library/packages/tools/src/fetch-image/fetch-image.d.ts +8 -4
- package/library/packages/types/src/table.d.ts +7 -6
- package/library/packages/utils/src/custom-element/i18n.d.ts +3 -0
- package/library/react-web-component.d.ts +4 -0
- package/library/utils.js +2 -2
- package/package.json +1 -1
- package/library/assets/validation.worker-DnJlaA8S.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, t } from "../chunks/video.
|
|
1
|
+
import { n as e, t } from "../chunks/video.dKdkgJUo.js";
|
|
2
2
|
export { t as VIDEO_BACKGROUND_SIZE_BY_OBJECT_FIT, e as default };
|
package/library/package.json
CHANGED
|
@@ -14,6 +14,9 @@ import { default as CxTypography } from '../typography/typography';
|
|
|
14
14
|
* always shows time relative to `in-point` (starting at 0). `cx-time-update` emits `time` relative
|
|
15
15
|
* to `in-point`.
|
|
16
16
|
*
|
|
17
|
+
* Use `start-time` to open the player at a position without restricting the window: playback starts
|
|
18
|
+
* there, and the listener can still seek back to `in-point`.
|
|
19
|
+
*
|
|
17
20
|
* @event cx-play - Emitted when playback starts.
|
|
18
21
|
* @event cx-pause - Emitted when playback pauses.
|
|
19
22
|
* @event {{ time: number }} cx-time-update - Emitted while the playback position changes. `time` is relative to `in-point` (starts at 0).
|
|
@@ -88,6 +91,13 @@ export default class CxAudio extends ResizableElement {
|
|
|
88
91
|
* Playback stop position in seconds. 0 means play to the end of the file.
|
|
89
92
|
*/
|
|
90
93
|
outPoint: number;
|
|
94
|
+
/**
|
|
95
|
+
* Position in seconds, on the file's timeline, where playback starts each time a source loads. Ignored when it
|
|
96
|
+
* falls outside the `in-point`/`out-point` window. Changing it after the source loaded does not seek; use `seek()`.
|
|
97
|
+
*/
|
|
98
|
+
startTime: number;
|
|
99
|
+
/** Whether `startTime` was applied to the current source. */
|
|
100
|
+
private isStartTimeApplied;
|
|
91
101
|
/** Whether the audio is currently playing. */
|
|
92
102
|
private isPlaying;
|
|
93
103
|
/** Whether the audio has finished loading and is ready for playback. */
|
|
@@ -142,6 +152,11 @@ export default class CxAudio extends ResizableElement {
|
|
|
142
152
|
play(): void;
|
|
143
153
|
/** Pauses audio playback. */
|
|
144
154
|
pause(): void;
|
|
155
|
+
/**
|
|
156
|
+
* Moves playback to `time` seconds on the file's timeline, clamped to the `in-point`/`out-point` window.
|
|
157
|
+
* Does nothing before the audio has loaded its duration.
|
|
158
|
+
*/
|
|
159
|
+
seek(time: number): void;
|
|
145
160
|
/** Toggles between play and pause. */
|
|
146
161
|
togglePlay(): void;
|
|
147
162
|
private formatTime;
|
|
@@ -168,7 +168,7 @@ export default class CxImage extends ResizableElement {
|
|
|
168
168
|
get currentAltValue(): string;
|
|
169
169
|
get currentSrc(): string;
|
|
170
170
|
get highlighterTabindex(): "0" | undefined;
|
|
171
|
-
get highlighterRole():
|
|
171
|
+
get highlighterRole(): 'button' | 'img' | undefined;
|
|
172
172
|
/**
|
|
173
173
|
* `object-position` only shifts content already stretched to fill the `<img>` box, so
|
|
174
174
|
* under `contain` (where the image shrinks to fit and never fills that box on both axes)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { default as CxImage } from '../image/image.ts';
|
|
2
2
|
import { default as CxResizeObserver } from '../resize-observer/resize-observer.ts';
|
|
3
|
+
import { default as CxTooltip } from '../tooltip/tooltip.ts';
|
|
3
4
|
import { default as ResizableElement } from '../../../../base/src/resizable-element.ts';
|
|
4
5
|
import { ObjectFit } from '../../../../types/src/index.ts';
|
|
5
6
|
import { PositionPickerValue } from '../../../../types/src/position-picker';
|
|
@@ -27,6 +28,10 @@ import { VideoJsPlayer } from './videojs/index.js';
|
|
|
27
28
|
* @event cx-error - Emitted when the video fails to load.
|
|
28
29
|
*
|
|
29
30
|
* @slot placeholder - The placeholder element, shown while the `src` is not set.
|
|
31
|
+
*
|
|
32
|
+
* @description Captions and subtitles are declared like on a native `<video>`: add `<track>` children with
|
|
33
|
+
* `src` (WebVTT), `kind`, `label`, `srclang` and optionally `default`. Adding, removing or editing them updates
|
|
34
|
+
* the player, and a captions menu appears in the control bar while at least one track is present.
|
|
30
35
|
*/
|
|
31
36
|
/**
|
|
32
37
|
* `background-size` only accepts `cover`/`contain` — map the crop-style
|
|
@@ -40,6 +45,7 @@ export default class CxVideo extends ResizableElement {
|
|
|
40
45
|
static readonly dependencies: {
|
|
41
46
|
'cx-image': typeof CxImage;
|
|
42
47
|
'cx-resize-observer': typeof CxResizeObserver;
|
|
48
|
+
'cx-tooltip': typeof CxTooltip;
|
|
43
49
|
};
|
|
44
50
|
readonly localize: LocalizeController;
|
|
45
51
|
accessor videoJsContainer: HTMLDivElement;
|
|
@@ -119,6 +125,11 @@ export default class CxVideo extends ResizableElement {
|
|
|
119
125
|
protected autoPlayTimeout: number | null;
|
|
120
126
|
parsedName: string;
|
|
121
127
|
formattedPoster: string;
|
|
128
|
+
/** The player's copy of each `<track>` child, with the options it was created from. */
|
|
129
|
+
private playerTextTracks;
|
|
130
|
+
private readonly trackChildrenObserver;
|
|
131
|
+
/** The `<track>` children that declare the captions and subtitles. */
|
|
132
|
+
get trackElements(): HTMLTrackElement[];
|
|
122
133
|
/**
|
|
123
134
|
* The current time of the video.
|
|
124
135
|
*/
|
|
@@ -154,6 +165,18 @@ export default class CxVideo extends ResizableElement {
|
|
|
154
165
|
protected removeVideoEventListeners(): void;
|
|
155
166
|
attachSeekbar(): void;
|
|
156
167
|
private applyBigPlayButtonVisibility;
|
|
168
|
+
private isTrackChildMutation;
|
|
169
|
+
/**
|
|
170
|
+
* Mirrors the `<track>` children into the player, which keeps its copies across source changes. Only the copies
|
|
171
|
+
* of added, edited or removed children change, so the caption the viewer picked stays on; an edited child's copy
|
|
172
|
+
* keeps its mode.
|
|
173
|
+
*/
|
|
174
|
+
private syncTextTracks;
|
|
175
|
+
/**
|
|
176
|
+
* The captions menu is left out of the control bar until a track exists, so a stream that carries its own
|
|
177
|
+
* subtitles keeps the control bar it had.
|
|
178
|
+
*/
|
|
179
|
+
private addCaptionsMenu;
|
|
157
180
|
/**
|
|
158
181
|
* Keeps the big play button centered in the visible video content rather than
|
|
159
182
|
* the full player when object-fit leaves empty space around the video.
|
|
@@ -582,6 +582,13 @@ export default class CxGallery extends CortexElement {
|
|
|
582
582
|
/** Same as the space list above: page cards carry no title or description of their own. */
|
|
583
583
|
handlePagesAndLinksChange(): Promise<void>;
|
|
584
584
|
handleSourceFieldsChange(): Promise<void>;
|
|
585
|
+
private refreshSourceData;
|
|
586
|
+
/**
|
|
587
|
+
* Custom content only changes the card overlay and its slots, so it must not
|
|
588
|
+
* invalidate already-resolved image URLs. Switching back to automatic content
|
|
589
|
+
* does need metadata, but a failed metadata refresh must not blank those images.
|
|
590
|
+
*/
|
|
591
|
+
handleContentTypeChange(_previousContentType?: unknown, nextContentType?: unknown): Promise<void>;
|
|
585
592
|
handleLoopChange(): Promise<void>;
|
|
586
593
|
handleChunkChange(): Promise<void>;
|
|
587
594
|
handleActiveSlideChange(): Promise<void>;
|
|
@@ -109,6 +109,10 @@ export default class CxSbImage extends CxImage {
|
|
|
109
109
|
* A description of the image used by assistive devices in dark mode.
|
|
110
110
|
*/
|
|
111
111
|
altDarkMode: string;
|
|
112
|
+
/** Whether to use authored alt text instead of asset metadata. */
|
|
113
|
+
useCustomAlt: boolean;
|
|
114
|
+
/** Whether to use authored alt text for the dark-mode image. */
|
|
115
|
+
useCustomAltDarkMode: boolean;
|
|
112
116
|
altSourceField: string;
|
|
113
117
|
/**
|
|
114
118
|
* CMS5 only. Click action for the image.
|
|
@@ -236,6 +240,12 @@ export default class CxSbImage extends CxImage {
|
|
|
236
240
|
get currentAltValue(): string;
|
|
237
241
|
get currentRecordId(): string;
|
|
238
242
|
get currentSrc(): string;
|
|
243
|
+
/**
|
|
244
|
+
* Keeps a valid serialized URL visible while edit mode refreshes it by record id.
|
|
245
|
+
* GrapesJS can recreate the element when custom content is added, so runtime-only
|
|
246
|
+
* resolved state is briefly empty even though the saved source is still usable.
|
|
247
|
+
*/
|
|
248
|
+
private resolveRenderableSource;
|
|
239
249
|
get currentTransformations(): Transformation[];
|
|
240
250
|
/** Whether the variant being displayed had its format picked by hand. */
|
|
241
251
|
get isCurrentFormatManual(): boolean;
|
|
@@ -272,7 +282,7 @@ export default class CxSbImage extends CxImage {
|
|
|
272
282
|
*/
|
|
273
283
|
private get requestedAssetFields();
|
|
274
284
|
get highlighterTabindex(): "0" | undefined;
|
|
275
|
-
get highlighterRole(): "button" | "img";
|
|
285
|
+
get highlighterRole(): "button" | "img" | undefined;
|
|
276
286
|
get highlighterClass(): {
|
|
277
287
|
[x: string]: boolean;
|
|
278
288
|
'highlightable-item--has-action': boolean;
|
|
@@ -294,6 +304,12 @@ export default class CxSbImage extends CxImage {
|
|
|
294
304
|
* Whether the image has an click action.
|
|
295
305
|
*/
|
|
296
306
|
private get hasClickAction();
|
|
307
|
+
/** The native link replaces the wrapper's synthetic button semantics in read mode. */
|
|
308
|
+
private get hasNavigationAnchor();
|
|
309
|
+
/** Resolves the destination shared by pointer handling and the accessibility anchor. */
|
|
310
|
+
private get navigationUrl();
|
|
311
|
+
/** Names the native link from visible content before falling back to its destination. */
|
|
312
|
+
private get navigationLabel();
|
|
297
313
|
/**
|
|
298
314
|
* The rendered width in CSS pixels, used as the `sizes` hint so the browser can pick
|
|
299
315
|
* the smallest `srcset` candidate that still covers the box.
|
|
@@ -33,6 +33,7 @@ export default class CxSbVideo extends CxVideo {
|
|
|
33
33
|
'cx-asset-data-display': typeof CxAssetDataDisplay;
|
|
34
34
|
'cx-image': typeof import('../../../../../atoms/src').CxImage;
|
|
35
35
|
'cx-resize-observer': typeof import('../../../../../atoms/src').CxResizeObserver;
|
|
36
|
+
'cx-tooltip': typeof import('../../../../../atoms/src').CxTooltip;
|
|
36
37
|
};
|
|
37
38
|
/**
|
|
38
39
|
* The share source of the image's asset.
|
|
@@ -3,6 +3,8 @@ import { LocalizeController } from '../../../../utils/src/custom-element/i18n';
|
|
|
3
3
|
import { default as CxImage } from '../blocks/image/image';
|
|
4
4
|
type Attribute = {
|
|
5
5
|
'additional-fields': string;
|
|
6
|
+
alt: CxImage['alt'];
|
|
7
|
+
'alt-dark-mode': CxImage['altDarkMode'];
|
|
6
8
|
'alt-source-field': CxImage['altSourceField'];
|
|
7
9
|
'aspect-ratio': CxImage['aspectRatio'];
|
|
8
10
|
'aspect-ratio-dark-mode': CxImage['aspectRatioDarkMode'];
|
|
@@ -51,6 +53,8 @@ type Attribute = {
|
|
|
51
53
|
'text-reveal-style'?: CxImage['textRevealStyle'];
|
|
52
54
|
transformations: string;
|
|
53
55
|
'transition-type'?: string;
|
|
56
|
+
'use-custom-alt': CxImage['useCustomAlt'];
|
|
57
|
+
'use-custom-alt-dark-mode': CxImage['useCustomAltDarkMode'];
|
|
54
58
|
width: CxImage['width'];
|
|
55
59
|
'zoom-style'?: CxImage['zoomStyle'];
|
|
56
60
|
};
|
|
@@ -310,6 +310,8 @@ export default class ConfigsController {
|
|
|
310
310
|
src: string;
|
|
311
311
|
}>[] | import('../../../types/src/content-builder').PropertyConfig<{
|
|
312
312
|
'additional-fields': string;
|
|
313
|
+
alt: import('./blocks/image/image').default["alt"];
|
|
314
|
+
'alt-dark-mode': import('./blocks/image/image').default["altDarkMode"];
|
|
313
315
|
'alt-source-field': import('./blocks/image/image').default["altSourceField"];
|
|
314
316
|
'aspect-ratio': import('./blocks/image/image').default["aspectRatio"];
|
|
315
317
|
'aspect-ratio-dark-mode': import('./blocks/image/image').default["aspectRatioDarkMode"];
|
|
@@ -358,15 +360,17 @@ export default class ConfigsController {
|
|
|
358
360
|
'text-reveal-style'?: import('./blocks/image/image').default["textRevealStyle"];
|
|
359
361
|
transformations: string;
|
|
360
362
|
'transition-type'?: string;
|
|
363
|
+
'use-custom-alt': import('./blocks/image/image').default["useCustomAlt"];
|
|
364
|
+
'use-custom-alt-dark-mode': import('./blocks/image/image').default["useCustomAltDarkMode"];
|
|
361
365
|
width: import('./blocks/image/image').default["width"];
|
|
362
366
|
'zoom-style'?: import('./blocks/image/image').default["zoomStyle"];
|
|
363
367
|
}>[] | import('../../../types/src/content-builder').PropertyConfig<{
|
|
364
|
-
appearance: import('
|
|
365
|
-
'can-search-by-icon': import('
|
|
368
|
+
appearance: import('../../../../apps/cortex/src/types').CxSearchBox["appearance"];
|
|
369
|
+
'can-search-by-icon': import('../../../../apps/cortex/src/types').CxSearchBox["canSearchByIcon"];
|
|
366
370
|
'data-icon-name': string;
|
|
367
|
-
label: import('
|
|
368
|
-
placeholder: import('
|
|
369
|
-
size: import('
|
|
371
|
+
label: import('../../../../apps/cortex/src/types').CxSearchBox["label"];
|
|
372
|
+
placeholder: import('../../../../apps/cortex/src/types').CxSearchBox["placeholder"];
|
|
373
|
+
size: import('../../../../apps/cortex/src/types').CxSearchBox["size"];
|
|
370
374
|
'width-type': import('../../../types/src/search-box').SearchBoxWidthType;
|
|
371
375
|
}>[] | import('../../../types/src/content-builder').PropertyConfig<{
|
|
372
376
|
data: string;
|
|
@@ -725,12 +729,12 @@ export default class ConfigsController {
|
|
|
725
729
|
'page-id': string;
|
|
726
730
|
src: string;
|
|
727
731
|
} | {
|
|
728
|
-
appearance: import('
|
|
729
|
-
'can-search-by-icon': import('
|
|
732
|
+
appearance: import('../../../../apps/cortex/src/types').CxSearchBox["appearance"];
|
|
733
|
+
'can-search-by-icon': import('../../../../apps/cortex/src/types').CxSearchBox["canSearchByIcon"];
|
|
730
734
|
'data-icon-name': string;
|
|
731
|
-
label: import('
|
|
732
|
-
placeholder: import('
|
|
733
|
-
size: import('
|
|
735
|
+
label: import('../../../../apps/cortex/src/types').CxSearchBox["label"];
|
|
736
|
+
placeholder: import('../../../../apps/cortex/src/types').CxSearchBox["placeholder"];
|
|
737
|
+
size: import('../../../../apps/cortex/src/types').CxSearchBox["size"];
|
|
734
738
|
'width-type': import('../../../types/src/search-box').SearchBoxWidthType;
|
|
735
739
|
} | {
|
|
736
740
|
'data-constraints': boolean;
|
|
@@ -20,6 +20,7 @@ export { default as CxFileOnDemand } from './file-on-demand/file-on-demand';
|
|
|
20
20
|
export { default as CxFindAndReplace } from './find-and-replace/find-and-replace';
|
|
21
21
|
export { default as CxLightbox } from './lightbox/lightbox';
|
|
22
22
|
export { default as CxListEditor } from './list-editor/list-editor';
|
|
23
|
+
export { default as CxSearchBox } from './content-builder/blocks/search-box/search-box';
|
|
23
24
|
export { default as CxSpaceSelector } from './space-selector/space-selector';
|
|
24
25
|
export { default as CxSpecialCharactersDialog } from './special-characters-dialog/special-characters-dialog';
|
|
25
26
|
export { default as CxTemplateSwitcher } from './template-switcher/template-switcher';
|
|
@@ -19,7 +19,7 @@ export declare const FIELD_DOC_SUBTYPE = "Document.DocSubType";
|
|
|
19
19
|
export declare const FIELD_IN_POINT = "Document.InPoint";
|
|
20
20
|
export declare const FIELD_OUT_POINT = "Document.OutPoint";
|
|
21
21
|
export declare function resolveAssetExtraFilters(selectedFacets?: Record<string, string[]>): Record<string, string[]>;
|
|
22
|
-
export declare function apiSearchAssets({ consistency, countPerPage, fields, getPermanentAssetsPaths, httpMethod, isSiteBuilder, pageNumber, query, securityByPassToken, siteUrl, sort, token, useSession, }: SearchAssetsParams): Promise<SearchAssetsResponse>;
|
|
22
|
+
export declare function apiSearchAssets({ consistency, countPerPage, fields, getPermanentAssetsPaths, httpMethod, isSiteBuilder, pageNumber, query, securityByPassToken, siteUrl, sort, throwOnError, token, useSession, }: SearchAssetsParams): Promise<SearchAssetsResponse>;
|
|
23
23
|
export declare function apiGetTransformAssetLink({ assetId, extension, format, siteUrl, token, transformations, useSession, }: {
|
|
24
24
|
assetId: string;
|
|
25
25
|
extension?: string;
|
|
@@ -29,8 +29,8 @@ export declare function apiGetTransformAssetLink({ assetId, extension, format, s
|
|
|
29
29
|
transformations?: string;
|
|
30
30
|
useSession?: string;
|
|
31
31
|
}): Promise<GetTransformAssetLinkResponse | null>;
|
|
32
|
-
export declare function apiGetAssets({ consistency, extraFields, getPermanentAssetsPaths, isSiteBuilder, recordIds, securityByPassToken, token, }: GetAssetsRequest): Promise<GetAssetsResponse>;
|
|
33
|
-
export declare function apiGetAssetsInFolder({ consistency, countPerPage, directParentFolderIdentifier, extraFields, getPermanentAssetsPaths, isSiteBuilder, limitedDocTypes, pageNumber, parentFolderIdentifier, searchTerm, securityByPassToken, sortOrder, token, }: GetAssetsInFolderRequest): Promise<GetAssetsInFolderResponse>;
|
|
32
|
+
export declare function apiGetAssets({ consistency, extraFields, getPermanentAssetsPaths, isSiteBuilder, recordIds, securityByPassToken, throwOnError, token, }: GetAssetsRequest): Promise<GetAssetsResponse>;
|
|
33
|
+
export declare function apiGetAssetsInFolder({ consistency, countPerPage, directParentFolderIdentifier, extraFields, getPermanentAssetsPaths, isSiteBuilder, limitedDocTypes, pageNumber, parentFolderIdentifier, searchTerm, securityByPassToken, sortOrder, throwOnError, token, }: GetAssetsInFolderRequest): Promise<GetAssetsInFolderResponse>;
|
|
34
34
|
export declare function apiGetCropFocusMode({ autoCropMode, cropHeight, cropWidth, imageUrl, useSession, }: GetCropZoneSuggestionRequest): Promise<GetCropZoneSuggestionResponse | null>;
|
|
35
35
|
export declare function apiGetAvailableProxies({ assetRecordId, isSiteBuilder, siteUrl, token, useSession, }: {
|
|
36
36
|
assetRecordId: string;
|
|
@@ -37,6 +37,7 @@ export type GetAssetsInFolderRequest = {
|
|
|
37
37
|
searchTerm: string;
|
|
38
38
|
securityByPassToken?: string;
|
|
39
39
|
sortOrder: string;
|
|
40
|
+
throwOnError?: boolean;
|
|
40
41
|
token?: string;
|
|
41
42
|
};
|
|
42
43
|
export type GetAssetsInFolderResponse = {
|
|
@@ -71,6 +72,7 @@ export type GetAssetsRequest = {
|
|
|
71
72
|
isSiteBuilder?: boolean;
|
|
72
73
|
recordIds: string[];
|
|
73
74
|
securityByPassToken?: string;
|
|
75
|
+
throwOnError?: boolean;
|
|
74
76
|
token?: string;
|
|
75
77
|
};
|
|
76
78
|
export type GetAssetsResponse = {
|
|
@@ -215,6 +217,8 @@ export type SearchAssetsParams = {
|
|
|
215
217
|
securityByPassToken?: string;
|
|
216
218
|
siteUrl?: string;
|
|
217
219
|
sort?: string;
|
|
220
|
+
/** Re-throw transport errors when the caller must distinguish failure from no results. */
|
|
221
|
+
throwOnError?: boolean;
|
|
218
222
|
token?: string;
|
|
219
223
|
useSession?: string;
|
|
220
224
|
};
|
|
@@ -101,7 +101,7 @@ export declare class FetchImageController implements ReactiveController {
|
|
|
101
101
|
* Shrinking is ignored once pages are cached: collapsing already has what it needs.
|
|
102
102
|
*/
|
|
103
103
|
setPageSize(pageSize: number): void;
|
|
104
|
-
fetchImages({ end, extraFields, format, manualFormat, start, transformations, }: {
|
|
104
|
+
fetchImages({ end, extraFields, format, manualFormat, start, throwOnError, transformations, }: {
|
|
105
105
|
end: number;
|
|
106
106
|
extraFields: string[];
|
|
107
107
|
format?: string;
|
|
@@ -111,9 +111,10 @@ export declare class FetchImageController implements ReactiveController {
|
|
|
111
111
|
*/
|
|
112
112
|
manualFormat?: boolean;
|
|
113
113
|
start: number;
|
|
114
|
+
throwOnError?: boolean;
|
|
114
115
|
transformations?: Transformation[];
|
|
115
116
|
}): Promise<ExtendedGalleryItem[] | undefined>;
|
|
116
|
-
fetchImagesInFolderBySlide({ activeSlide, extraFields, folderId, forceRefetch, format, manualFormat, minLimit, noPlaceholders, transformations, }: {
|
|
117
|
+
fetchImagesInFolderBySlide({ activeSlide, extraFields, folderId, forceRefetch, format, manualFormat, minLimit, noPlaceholders, throwOnError, transformations, }: {
|
|
117
118
|
activeSlide: number;
|
|
118
119
|
extraFields?: string[];
|
|
119
120
|
folderId: string;
|
|
@@ -122,9 +123,10 @@ export declare class FetchImageController implements ReactiveController {
|
|
|
122
123
|
manualFormat?: boolean;
|
|
123
124
|
minLimit?: number;
|
|
124
125
|
noPlaceholders?: boolean;
|
|
126
|
+
throwOnError?: boolean;
|
|
125
127
|
transformations?: Transformation[];
|
|
126
128
|
}): Promise<ExtendedGalleryItem[]>;
|
|
127
|
-
fetchImagesByIDs({ extraFields, format, manualFormat, recordIds, transformations, }: {
|
|
129
|
+
fetchImagesByIDs({ extraFields, format, manualFormat, recordIds, throwOnError, transformations, }: {
|
|
128
130
|
extraFields?: string[];
|
|
129
131
|
format?: string;
|
|
130
132
|
/**
|
|
@@ -133,6 +135,7 @@ export declare class FetchImageController implements ReactiveController {
|
|
|
133
135
|
*/
|
|
134
136
|
manualFormat?: boolean;
|
|
135
137
|
recordIds: string[];
|
|
138
|
+
throwOnError?: boolean;
|
|
136
139
|
transformations?: Transformation[];
|
|
137
140
|
}): Promise<ExtendedGalleryItem[]>;
|
|
138
141
|
fetchImagesInFolderByPage({ extraFields, folderId, forceRefetch, format, manualFormat, noPlaceholders, page, pageSize, transformations, }: {
|
|
@@ -146,7 +149,7 @@ export declare class FetchImageController implements ReactiveController {
|
|
|
146
149
|
pageSize?: number;
|
|
147
150
|
transformations?: Transformation[];
|
|
148
151
|
}): Promise<ExtendedGalleryItem[]>;
|
|
149
|
-
fetchImagesInFolderByChunk({ chunkSize: rawChunkSize, end, extraFields, folderId, forceRefetch, format, manualFormat, start, transformations, }: {
|
|
152
|
+
fetchImagesInFolderByChunk({ chunkSize: rawChunkSize, end, extraFields, folderId, forceRefetch, format, manualFormat, start, throwOnError, transformations, }: {
|
|
150
153
|
chunkSize?: number;
|
|
151
154
|
end?: number;
|
|
152
155
|
extraFields?: string[];
|
|
@@ -155,6 +158,7 @@ export declare class FetchImageController implements ReactiveController {
|
|
|
155
158
|
format?: string;
|
|
156
159
|
manualFormat?: boolean;
|
|
157
160
|
start?: number;
|
|
161
|
+
throwOnError?: boolean;
|
|
158
162
|
transformations?: Transformation[];
|
|
159
163
|
}): AsyncGenerator<ExtendedGalleryItem[], void, unknown>;
|
|
160
164
|
hostConnected?(): void;
|
|
@@ -2667,12 +2667,13 @@ export interface StringValidatorParameters {
|
|
|
2667
2667
|
* inclusive bounds as ISO date strings (or anything `Date.parse` understands).
|
|
2668
2668
|
*
|
|
2669
2669
|
* `format` additionally requires the input string to match a specific date
|
|
2670
|
-
* shape before it is parsed, using token placeholders: `
|
|
2671
|
-
* `MM` (2-digit month), `
|
|
2672
|
-
* (2-digit minute), `ss` (2-digit second)
|
|
2673
|
-
* (
|
|
2674
|
-
* `
|
|
2675
|
-
*
|
|
2670
|
+
* shape before it is parsed, using .NET-style token placeholders: `yyyy`
|
|
2671
|
+
* (4-digit year), `MM` (2-digit month), `dd` (2-digit day), `HH` (2-digit
|
|
2672
|
+
* hour, 24h), `mm` (2-digit minute), `ss` (2-digit second), `f` / `ff` /
|
|
2673
|
+
* `fff` (fractional seconds), `z` / `zz` / `zzz` (UTC offset), and `Z` (UTC).
|
|
2674
|
+
* Legacy `YYYY` and `DD` tokens remain supported. Any other character is
|
|
2675
|
+
* treated as a literal, allowing new arrangements of supported tokens without
|
|
2676
|
+
* a component change. Example: `'MM/dd/yyyy'` accepts `'02/29/2024'`.
|
|
2676
2677
|
*/
|
|
2677
2678
|
export interface DateValidatorParameters {
|
|
2678
2679
|
starts?: string;
|
|
@@ -303,6 +303,7 @@ export interface Translation extends DefaultTranslation {
|
|
|
303
303
|
currentValue: string;
|
|
304
304
|
currentVersion: string;
|
|
305
305
|
custom: string;
|
|
306
|
+
customAltText: string;
|
|
306
307
|
customColumns: string;
|
|
307
308
|
customExport: string;
|
|
308
309
|
customFormat: string;
|
|
@@ -314,7 +315,9 @@ export interface Translation extends DefaultTranslation {
|
|
|
314
315
|
cut: string;
|
|
315
316
|
damLibrary: string;
|
|
316
317
|
damViewNoAvailableOptionsForThisAsset: string;
|
|
318
|
+
darkCustomAltText: string;
|
|
317
319
|
darkImageFormat: string;
|
|
320
|
+
darkModeAltText: string;
|
|
318
321
|
darkModeImage: string;
|
|
319
322
|
dashSpacing: string;
|
|
320
323
|
dashWidth: string;
|
|
@@ -1512,6 +1512,10 @@
|
|
|
1512
1512
|
* Playback stop position in seconds. 0 means play to the end of the file.
|
|
1513
1513
|
*/
|
|
1514
1514
|
outPoint?: number;
|
|
1515
|
+
/**
|
|
1516
|
+
* Position in seconds, on the file's timeline, where playback starts each time a source loads. Ignored when it falls outside the `in-point`/`out-point` window. Changing it after the source loaded does not seek; use `seek()`.
|
|
1517
|
+
*/
|
|
1518
|
+
startTime?: number;
|
|
1515
1519
|
/**
|
|
1516
1520
|
* The width of the image.
|
|
1517
1521
|
*/
|
package/library/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as e, i as t, n, o as r, r as i, t as a } from "./chunks/event.C11S4obG.js";
|
|
2
2
|
import { t as o } from "./chunks/custom-element.BEMYNDK1.js";
|
|
3
|
-
import { r as s, t as c } from "./chunks/i18n.
|
|
3
|
+
import { r as s, t as c } from "./chunks/i18n.D_iHIFdS.js";
|
|
4
4
|
import { n as l, r as u, t as d } from "./chunks/slot.CZUlACxT.js";
|
|
5
5
|
import { t as f } from "./chunks/watch.Ub5r8btz.js";
|
|
6
6
|
import { C as p, S as m, _ as h, a as g, b as _, c as v, d as y, f as b, g as x, h as S, i as C, l as w, m as T, n as E, o as D, p as O, r as k, s as A, t as j, u as M, v as N, w as P, x as F, y as I } from "./chunks/string.DamEXDH2.js";
|
|
@@ -23,7 +23,7 @@ import { i as rt, n as it, r as at, t as ot } from "./chunks/scroll.CEH_a4pm.js"
|
|
|
23
23
|
import { t as st } from "./chunks/user-agent.D2bRhUeS.js";
|
|
24
24
|
import { t as ct } from "./chunks/parse.CDrJ-NY7.js";
|
|
25
25
|
import { S as lt, _ as ut, b as dt, d as ft, f as pt, g as mt, h as ht, m as gt, p as _t, t as vt, u as yt, v as bt, x as xt, y as St } from "./chunks/date.BL4L64Hx.js";
|
|
26
|
-
import { $ as Ct, A as wt, B as Tt, F as Et, G as Dt, H as Ot, I as kt, J as At, K as jt, L as Mt, M as Nt, N as Pt, O as Ft, P as It, Q as Lt, R as Rt, U as zt, V as Bt, W as Vt, X as Ht, Y as Ut, Z as Wt, _ as Gt, a as Kt, at as qt, b as Jt, c as Yt, ct as Xt, d as Zt, dt as Qt, et as $t, f as en, ft as tn, g as nn, h as rn, i as an, it as on, j as sn, k as cn, l as ln, lt as un, m as dn, mt as fn, n as pn, nt as mn, o as hn, ot as gn, p as _n, pt as vn, q as yn, r as bn, rt as xn, s as Sn, st as Cn, t as wn, tt as Tn, u as En, ut as Dn, v as On, y as kn, z as An } from "./chunks/src.
|
|
26
|
+
import { $ as Ct, A as wt, B as Tt, F as Et, G as Dt, H as Ot, I as kt, J as At, K as jt, L as Mt, M as Nt, N as Pt, O as Ft, P as It, Q as Lt, R as Rt, U as zt, V as Bt, W as Vt, X as Ht, Y as Ut, Z as Wt, _ as Gt, a as Kt, at as qt, b as Jt, c as Yt, ct as Xt, d as Zt, dt as Qt, et as $t, f as en, ft as tn, g as nn, h as rn, i as an, it as on, j as sn, k as cn, l as ln, lt as un, m as dn, mt as fn, n as pn, nt as mn, o as hn, ot as gn, p as _n, pt as vn, q as yn, r as bn, rt as xn, s as Sn, st as Cn, t as wn, tt as Tn, u as En, ut as Dn, v as On, y as kn, z as An } from "./chunks/src.BVh8NgdB.js";
|
|
27
27
|
import { n as jn } from "./chunks/modal.775mgCbW.js";
|
|
28
28
|
import { a as Mn, c as Nn, d as Pn, f as Fn, i as In, l as Ln, m as Rn, n as zn, o as Bn, p as Vn, r as Hn, s as Un, t as Wn, u as Gn } from "./chunks/url.BCc06dE7.js";
|
|
29
29
|
import { a as Kn, c as qn, d as Jn, f as Yn, h as Xn, i as Zn, l as Qn, m as $n, n as er, o as tr, p as nr, r as rr, s as ir, t as ar, u as or } from "./chunks/color.CIOzHtLK.js";
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(){function e(e){return e===``||e==null}function t(e){return Number.isFinite(Number(e))}function n(e,t){if(!t||typeof t!=`object`)return!0;let n=Number(e);return!(t.min!==void 0&&n<t.min||t.max!==void 0&&n>t.max)}function r(e){return e instanceof Date?e.getTime():typeof e==`number`?Number.isFinite(e)?e:NaN:typeof e==`string`?Date.parse(e):NaN}let i=[{groupName:`year`,token:`YYYY`},{groupName:`month`,token:`MM`},{groupName:`day`,token:`DD`},{groupName:`hour`,token:`HH`},{groupName:`minute`,token:`mm`},{groupName:`second`,token:`ss`}];function a(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function o(e){let t=``,n=0;for(;n<e.length;){let r=i.find(({token:t})=>e.startsWith(t,n));if(r){let e=r.token.length;t+=`(?<${r.groupName}>\\d{${e}})`,n+=e}else t+=a(e[n]),n+=1}return RegExp(`^${t}$`)}function s(e,t){let n=o(t).exec(e);if(!n?.groups)return NaN;let r=Number(n.groups.year??`1970`),i=Number(n.groups.month??`1`),a=Number(n.groups.day??`1`),s=Number(n.groups.hour??`0`),c=Number(n.groups.minute??`0`),l=Number(n.groups.second??`0`);if(i<1||i>12||s>23||c>59||l>59)return NaN;let u=new Date(r,i-1,a,s,c,l);return u.getFullYear()===r&&u.getMonth()===i-1&&u.getDate()===a?u.getTime():NaN}let c={alphanumeric(t){return e(t)?!0:/^[a-z0-9]+$/i.test(String(t))},boolean(t){return e(t)?!0:typeof t==`boolean`||t===`true`||t===`false`},date(t,n){if(e(t))return!0;let i=n&&typeof n==`object`?n.format:void 0,a=i===void 0?r(t):s(String(t),i);if(Number.isNaN(a))return!1;if(!n||typeof n!=`object`)return!0;if(n.starts!==void 0){let e=r(n.starts);if(Number.isNaN(e)||a<e)return!1}if(n.ends!==void 0){let e=r(n.ends);if(Number.isNaN(e)||a>e)return!1}return!0},ends(t,n){return e(t)?!0:String(t).toLowerCase().endsWith(String(n).toLowerCase())},float(r,i){if(e(r))return!0;let a=Number(r);return t(r)&&a%1!=0&&n(r,i)},in(t,n){if(e(t))return!0;let r=typeof n==`string`?n.split(`|`):n;return Array.isArray(r)&&r.includes(t)},integer(r,i){if(e(r))return!0;let a=Number(r);return t(r)&&Math.floor(a)===a&&n(r,i)},max(t,n){return e(t)?!0:Number.parseFloat(String(t))<=Number(n)},maxLength(t,n){return e(t)?!0:String(t).length<=Number(n)},min(t,n){return e(t)?!0:Number.parseFloat(String(t))>=Number(n)},minLength(t,n){return e(t)?!0:String(t).length>=Number(n)},numeric(t,r){return e(t)?!0:!Number.isNaN(Number(t))&&n(t,r)},regex(t,n){if(e(t))return!0;let r;r=n instanceof RegExp?n:n===void 0?``:String(n);try{return new RegExp(r).test(String(t))}catch{return!1}},required(t){return!e(t)},starts(t,n){return e(t)?!0:String(t).toLowerCase().startsWith(String(n).toLowerCase())},string(t,n){if(e(t))return!0;if(!Number.isNaN(Number(t)))return!1;if(!n||typeof n!=`object`)return!0;let r=String(t).length;return!(n.minLength!==void 0&&r<n.minLength||n.maxLength!==void 0&&r>n.maxLength)},unique(t,n,r){return e(t)||!r?.columnValues?!0:!r.columnValues.some(e=>e===t)}},l=1e3;function u(e){return e===``||e==null}function d(e){let t=/* @__PURE__ */ new Map;return e.forEach(e=>{u(e)||t.set(e,(t.get(e)??0)+1)}),t}function f(e,t,n){let r=[];return t.forEach(t=>{let i;if(t.type===`unique`)i=u(e)||(n.get(e)??0)<=1;else{let n=c[t.type];i=!n||n(e,t.parameters)}i||r.push({message:t.message,parameters:t.parameters,type:t.type})}),r}globalThis.addEventListener(`message`,e=>{if(e.origin!==``||e.data?.type!==`cx-validation-request`)return;let{fields:t,id:n}=e.data.payload,r=t.map(e=>e.rules.some(e=>e.type===`unique`)?d(e.values):/* @__PURE__ */ new Map),i=t.reduce((e,t)=>Math.max(e,t.values.length),0);for(let e=0;e<i||e===0;e+=l){let a=Math.min(e+l,i),o=[];for(let n=e;n<a;n++)t.forEach((e,t)=>{let i=f(e.values[n],e.rules,r[t]);i.length&&o.push({failures:i,fieldIndex:t,rowIndex:n})});let s={done:a>=i,id:n,results:o};if(globalThis.postMessage({payload:s,type:`cx-validation-response`}),a>=i)break}})})();
|