@orangelogic/design-system 4.2.0 → 4.4.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/{_baseXor.DixEm6JQ.js → _baseXor.BCxbgizO.js} +2 -2
- package/library/chunks/{asset-link-format.CVwjA_yf.js → asset-link-format.DTLA2CFh.js} +435 -415
- package/library/chunks/{button.D1YIxtv-.js → button.cbDkxJHn.js} +3 -3
- package/library/chunks/button.styles.D3GdfF7I.js +5 -0
- package/library/chunks/{color-swatch-group.BPXiMxjh.js → color-swatch-group.CZSeCrot.js} +3279 -2903
- package/library/chunks/color.CIHdfM_a.js +187 -0
- package/library/chunks/{confirm-popover.CJXyEa5A.js → confirm-popover.Dvgoz-oA.js} +4 -4
- package/library/chunks/content-builder.CBBdfVOl.js +55 -0
- package/library/chunks/{dialog.BbQ4Du0M.js → dialog.BvSMV36r.js} +2 -2
- package/library/chunks/{document-viewer.DtBW-p7z.js → document-viewer.BLdEjbza.js} +11 -10
- package/library/chunks/{dom.DL-cNKsj.js → dom.D0lSUoEI.js} +1 -1
- package/library/chunks/{dot-pagination.CJRAtM51.js → dot-pagination.CukHxNBk.js} +1 -1
- package/library/chunks/{folder-select.BAPsI-gg.js → folder-select.DAZQRdLq.js} +5 -5
- package/library/chunks/form-control.styles.CHC7Q08Q.js +5 -0
- package/library/chunks/{form.DN2v7-DH.js → form.LpappO1d.js} +1 -1
- package/library/chunks/{header.BioJzPlg.js → header.2RH_nPmz.js} +132 -90
- package/library/chunks/{i18n.rtxrs1c1.js → i18n.BSPmBQ73.js} +94 -12
- package/library/chunks/{icon-button.CbUddcgI.js → icon-button.DV5Fks8j.js} +1 -1
- package/library/chunks/{iframe.y7iCAVZP.js → iframe.ddX2kGu3.js} +1 -1
- package/library/chunks/{image.A2hE1WoV.js → image.BM7bPTub.js} +407 -276
- package/library/chunks/index.DKKvxBAi.js +1130 -0
- package/library/chunks/{input.D1FFprPl.js → input.7pumTpdu.js} +3 -3
- package/library/chunks/{markdown.Dd_GFJK8.js → markdown.LHSzm035.js} +3 -3
- package/library/chunks/{menu-item.CbqZ66to.js → menu-item.CqPvDGeN.js} +1 -1
- package/library/chunks/{option.CkhHTlpl.js → option.dBUWN4sF.js} +1 -1
- package/library/chunks/{pagination.BlQRt932.js → pagination.C2f8lUVb.js} +6 -6
- package/library/chunks/{position-picker.DjnhxIKF.js → position-picker.qkbJlboF.js} +12 -0
- package/library/chunks/{resizable-component.styles.CAfXABBc.js → resizable-component.styles.kMFDlGgv.js} +2 -2
- package/library/chunks/responsive.BmBJSzC4.js +17 -0
- package/library/chunks/{string.Demn8Xmk.js → string.CfI2ejyR.js} +3 -3
- package/library/chunks/{tab-group.CQfcMVEw.js → tab-group.DOnaT12G.js} +312 -310
- package/library/chunks/toast.D3AW3RWv.js +94 -0
- package/library/chunks/transformation.Dm-pK2ft.js +352 -0
- package/library/chunks/{tree.B7IKBX3n.js → tree.CHQ1WjZV.js} +1 -1
- package/library/chunks/{types.MwUT4xFk.js → types.PdpKNndx.js} +77402 -54714
- package/library/chunks/typography.BLYdTF0n.js +102 -0
- package/library/components/alert.js +2 -2
- package/library/components/asset-link-format.js +6 -6
- package/library/components/atoms.js +161 -159
- package/library/components/audio.js +4 -4
- package/library/components/bicolor-picker.js +2 -2
- package/library/components/border-input-group.js +2 -2
- package/library/components/box.d.ts +3 -0
- package/library/components/box.js +22 -0
- package/library/components/breadcrumb.js +1 -1
- package/library/components/button.js +4 -4
- package/library/components/card.js +7 -7
- package/library/components/checkbox.js +2 -2
- package/library/components/color-picker.js +36 -32
- package/library/components/color-swatch-group.js +8 -7
- package/library/components/color-swatch.js +246 -22
- package/library/components/confirm-popover.js +5 -5
- package/library/components/copy-button.js +2 -2
- package/library/components/corner-position-input-group.js +3 -3
- package/library/components/date-calendar.js +1 -1
- package/library/components/details.js +19 -19
- package/library/components/dialog.js +3 -3
- package/library/components/diff.js +1 -1
- package/library/components/document-viewer.js +5 -5
- package/library/components/dot-pagination.js +2 -2
- package/library/components/drawer.js +2 -2
- package/library/components/dropdown.js +2 -2
- package/library/components/dynamic-select.js +95 -92
- package/library/components/e-chart.js +1 -1
- package/library/components/element-clamp.js +2 -2
- package/library/components/file-on-demand.js +12 -12
- package/library/components/folder-select.js +5 -5
- 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 +6 -3
- package/library/components/icon-button.js +2 -2
- package/library/components/iframe.js +2 -2
- package/library/components/image-comparer.js +1 -1
- package/library/components/image.js +5 -4
- package/library/components/input-group.js +1 -1
- package/library/components/input.js +4 -4
- package/library/components/line-clamp.js +1 -1
- package/library/components/markdown.js +4 -4
- package/library/components/masonry.js +70 -56
- package/library/components/menu-item.js +2 -2
- package/library/components/menu.js +2 -2
- package/library/components/molecules.js +4 -4
- package/library/components/mutation-observer.js +25 -23
- package/library/components/option.js +2 -2
- package/library/components/organisms.js +2 -2
- package/library/components/padding-input-group.js +1 -1
- package/library/components/pagination.js +7 -7
- package/library/components/popup.js +1 -1
- package/library/components/position-picker.js +2 -2
- package/library/components/progress-bar.js +1 -1
- package/library/components/progress-ring.js +1 -1
- package/library/components/radio-button.js +1 -1
- package/library/components/radio-card.js +1 -1
- package/library/components/radio-group.js +2 -2
- package/library/components/range.js +3 -3
- package/library/components/rating.js +1 -1
- package/library/components/relative-time.js +1 -1
- package/library/components/select.js +5 -5
- package/library/components/shadow-input-group.js +1 -1
- package/library/components/share-option-list.js +3 -3
- package/library/components/sidebar.js +1 -1
- package/library/components/size-input-group.js +3 -3
- package/library/components/spinner.js +1 -1
- package/library/components/split-panel.js +1 -1
- package/library/components/switch.js +2 -2
- package/library/components/tab-group.js +6 -6
- package/library/components/tab-panel.js +1 -1
- package/library/components/tab.js +16 -16
- package/library/components/tag.js +2 -2
- package/library/components/textarea.js +2 -2
- package/library/components/timecode.js +2 -2
- package/library/components/tooltip.js +1 -1
- package/library/components/tree-item.js +2 -2
- package/library/components/tree.js +2 -2
- package/library/components/typeface.js +3 -3
- package/library/components/types.js +496 -487
- package/library/components/typography.js +3 -2
- package/library/components/video.js +5277 -5209
- package/library/css/ol-base.css +1 -0
- package/library/package.json +1 -1
- package/library/packages/atoms/src/components/box/box.d.ts +26 -0
- package/library/packages/atoms/src/components/box/box.styles.d.ts +7 -0
- package/library/packages/atoms/src/components/button/button.d.ts +4 -0
- package/library/packages/atoms/src/components/card/card.d.ts +1 -0
- package/library/packages/atoms/src/components/color-picker/color-picker.d.ts +11 -0
- package/library/packages/atoms/src/components/copy-button/copy-button.d.ts +1 -0
- package/library/packages/atoms/src/components/details/details.d.ts +6 -1
- package/library/packages/atoms/src/components/header/header.d.ts +38 -2
- package/library/packages/atoms/src/components/image/image.d.ts +30 -0
- package/library/packages/atoms/src/components/mutation-observer/mutation-observer.d.ts +1 -1
- package/library/packages/atoms/src/components/radio-card/radio-card.d.ts +1 -0
- package/library/packages/atoms/src/components/tab/tab.d.ts +17 -0
- package/library/packages/atoms/src/components/typography/typography.d.ts +31 -0
- package/library/packages/atoms/src/components/video/video.d.ts +24 -0
- package/library/packages/atoms/src/index.d.ts +1 -0
- package/library/packages/events/src/cx-asset-transformation-dialog-confirm.d.ts +2 -0
- package/library/packages/events/src/cx-color-swatch-picker-columns-change.d.ts +15 -0
- package/library/packages/events/src/events.d.ts +1 -0
- package/library/packages/hybrid/table-core/src/table/table.d.ts +10 -1
- package/library/packages/molecules/src/color-swatch/color-swatch.d.ts +35 -1
- package/library/packages/molecules/src/data-tab-group/data-tab-group.d.ts +30 -1
- package/library/packages/molecules/src/details-group/details-group.d.ts +105 -3
- package/library/packages/molecules/src/dynamic-select/dynamic-select.d.ts +5 -0
- package/library/packages/molecules/src/font-picker/font-picker.d.ts +3 -0
- package/library/packages/molecules/src/gallery-item/gallery-item.d.ts +10 -0
- package/library/packages/molecules/src/icon-picker/icon-picker.d.ts +5 -6
- package/library/packages/molecules/src/index.d.ts +0 -1
- package/library/packages/molecules/src/masonry/masonry.d.ts +5 -0
- package/library/packages/organisms/src/asset-link-format/asset-link-format.d.ts +6 -0
- package/library/packages/organisms/src/asset-transformation-dialog/asset-transformation-dialog.d.ts +5 -1
- package/library/packages/organisms/src/color-swatch-group/color-swatch-group.constants.d.ts +37 -45
- package/library/packages/organisms/src/color-swatch-group/color-swatch-group.d.ts +210 -10
- package/library/packages/organisms/src/content-builder/blocks/font-kit-advanced/font-kit-advanced.utils.d.ts +85 -0
- package/library/packages/organisms/src/content-builder/blocks/image/image.d.ts +32 -9
- package/library/packages/organisms/src/content-builder/components/block-picker/block-picker.d.ts +24 -8
- package/library/packages/organisms/src/content-builder/components/color-swatch-picker/color-swatch-picker.d.ts +70 -1
- package/library/packages/organisms/src/content-builder/components/config-form/config-form-controller.d.ts +1 -22
- package/library/packages/organisms/src/content-builder/components/config-manager/config-manager.d.ts +7 -0
- package/library/packages/organisms/src/content-builder/components/gallery-config/gallery-config.d.ts +6 -0
- package/library/packages/organisms/src/content-builder/components/gallery-picker/gallery-picker.d.ts +1 -0
- package/library/packages/organisms/src/content-builder/configs/accordion.d.ts +7 -0
- package/library/packages/organisms/src/content-builder/configs/audio.d.ts +1 -0
- package/library/packages/organisms/src/content-builder/configs/button.d.ts +2 -1
- package/library/packages/organisms/src/content-builder/configs/carousel.d.ts +11 -1
- package/library/packages/organisms/src/content-builder/configs/color-swatches.d.ts +19 -1
- package/library/packages/organisms/src/content-builder/configs/column-group.d.ts +11 -2
- package/library/packages/organisms/src/content-builder/configs/column.d.ts +13 -3
- package/library/packages/organisms/src/content-builder/configs/dam-view.d.ts +1 -0
- package/library/packages/organisms/src/content-builder/configs/divider.d.ts +1 -0
- package/library/packages/organisms/src/content-builder/configs/document-viewer.d.ts +1 -0
- package/library/packages/organisms/src/content-builder/configs/font-kit-advanced.d.ts +19 -0
- package/library/packages/organisms/src/content-builder/configs/font-kit.d.ts +2 -0
- package/library/packages/organisms/src/content-builder/configs/gallery.d.ts +15 -1
- package/library/packages/organisms/src/content-builder/configs/header.d.ts +3 -1
- package/library/packages/organisms/src/content-builder/configs/image.d.ts +4 -0
- package/library/packages/organisms/src/content-builder/configs/index.d.ts +1 -0
- package/library/packages/organisms/src/content-builder/configs/search-box.d.ts +5 -1
- package/library/packages/organisms/src/content-builder/configs/tab-group.d.ts +7 -4
- package/library/packages/organisms/src/content-builder/configs/timeline.d.ts +1 -0
- package/library/packages/organisms/src/content-builder/configs/video.d.ts +3 -0
- package/library/packages/organisms/src/content-builder/configs-controller.d.ts +168 -13
- package/library/packages/organisms/src/content-builder/content-builder-config.d.ts +60 -0
- package/library/packages/organisms/src/content-builder/content-builder-constants.d.ts +27 -0
- package/library/packages/organisms/src/content-builder/content-builder.d.ts +122 -2
- package/library/packages/organisms/src/content-builder/content-builder.sections.utils.d.ts +78 -0
- package/library/packages/organisms/src/content-builder/content-builder.utils.d.ts +33 -2
- package/library/packages/organisms/src/content-builder/plugins/font-kit-advanced.d.ts +5 -0
- package/library/packages/organisms/src/content-builder/plugins/gallery.d.ts +6 -0
- package/library/packages/organisms/src/content-builder/plugins/header.d.ts +7 -1
- package/library/packages/organisms/src/content-builder/plugins/index.d.ts +2 -1
- package/library/packages/organisms/src/content-builder/plugins/rich-text-editor/components/rte-bubble-menu/rte-bubble-menu.d.ts +21 -1
- package/library/packages/organisms/src/content-builder/plugins/rich-text-editor/extensions/index.d.ts +2 -0
- package/library/packages/organisms/src/content-builder/plugins/rich-text-editor/rte-configs.d.ts +14 -0
- package/library/packages/organisms/src/content-builder/plugins/sections/section-fragment-component.d.ts +22 -0
- package/library/packages/organisms/src/content-builder/plugins/sections/section-host-mounting.d.ts +15 -0
- package/library/packages/organisms/src/content-builder/plugins/sections/sections-canvas-patches.d.ts +20 -0
- package/library/packages/organisms/src/content-builder/plugins/sections/sections-plugin.d.ts +7 -0
- package/library/packages/organisms/src/content-builder/plugins/toolbar.d.ts +10 -1
- package/library/packages/organisms/src/content-builder/plugins/utils/block-width.d.ts +20 -0
- package/library/packages/organisms/src/content-builder/styleController.d.ts +11 -5
- package/library/packages/organisms/src/content-builder-viewer/content-builder-viewer.d.ts +1 -0
- package/library/packages/organisms/src/form/control-renderer/control-renderer.d.ts +176 -0
- package/library/packages/organisms/src/form/control-renderer/control-renderer.styles.d.ts +9 -0
- package/library/packages/organisms/src/list-editor/list-editor.d.ts +181 -6
- package/library/packages/tools/src/tiptap/extensions/metafield/index.d.ts +12 -0
- package/library/packages/tools/src/tiptap/utils/md/schema.d.ts +1 -1
- package/library/packages/types/src/asset-link-format.d.ts +0 -1
- package/library/packages/types/src/button.d.ts +1 -1
- package/library/packages/types/src/color-swatch-group.d.ts +56 -0
- package/library/packages/types/src/color-swatch.d.ts +22 -0
- package/library/packages/types/src/column.d.ts +13 -0
- package/library/packages/types/src/content-builder.d.ts +73 -4
- package/library/packages/types/src/details-group.d.ts +80 -0
- package/library/packages/types/src/font-kit-advanced.d.ts +28 -0
- package/library/packages/types/src/font-kit.d.ts +19 -0
- package/library/packages/types/src/font-picker.d.ts +2 -0
- package/library/packages/types/src/gallery-item.d.ts +3 -1
- package/library/packages/types/src/gallery.d.ts +2 -1
- package/library/packages/types/src/index.d.ts +1 -0
- package/library/packages/types/src/masonry.d.ts +1 -0
- package/library/packages/types/src/position-picker.d.ts +6 -0
- package/library/packages/types/src/sb-button.d.ts +7 -0
- package/library/packages/types/src/search-box.d.ts +4 -0
- package/library/packages/utils/src/color/color.d.ts +27 -3
- package/library/packages/utils/src/custom-element/i18n.d.ts +86 -0
- package/library/packages/utils/src/font/font.d.ts +12 -0
- package/library/packages/utils/src/transformation/transformation.d.ts +11 -3
- package/library/react-web-component.d.ts +514 -156
- package/library/utils.js +415 -395
- package/package.json +1 -1
- package/library/chunks/button.styles.BWgHrfLD.js +0 -5
- package/library/chunks/color-swatch.DdsUysbF.js +0 -223
- package/library/chunks/color.LzSGBy7o.js +0 -164
- package/library/chunks/form-control.styles.CaGWmeAS.js +0 -5
- package/library/chunks/index.BO_sT6SH.js +0 -20123
- package/library/chunks/toast.BOkYwUIj.js +0 -109
- package/library/chunks/transformation.B8m0Nbao.js +0 -384
- package/library/chunks/typography.T72DuoCa.js +0 -52
- package/library/packages/molecules/src/search-box/search-box.d.ts +0 -114
- package/library/packages/organisms/src/content-builder/plugins/wrapper-container.d.ts +0 -15
- /package/library/packages/{molecules/src/search-box/search-box.styles.d.ts → organisms/src/content-builder-viewer/content-builder-viewer.styles.d.ts} +0 -0
|
@@ -20,6 +20,7 @@ import { default as CortexLightElement } from '../../../base/src/cortex-light-el
|
|
|
20
20
|
*/
|
|
21
21
|
export default class CxContentBuilderViewer extends CortexLightElement {
|
|
22
22
|
#private;
|
|
23
|
+
static styles: import('lit').CSSResult[];
|
|
23
24
|
/**
|
|
24
25
|
* Page-scoped security-bypass token, stamped by the server on this element in read-mode HTML.
|
|
25
26
|
* The viewer uses it for its batched Search call and distributes it to its record-id children
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { AssetFormatValue } from '../../../../types/src/asset-format-picker';
|
|
2
|
+
import { Asset, AssetTypeString, PropertyConfig } from '../../../../types/src/content-builder';
|
|
3
|
+
import { StyleProps } from 'grapesjs';
|
|
4
|
+
import { ReactiveControllerHost } from 'lit';
|
|
5
|
+
import { Ref } from 'lit/directives/ref.js';
|
|
6
|
+
|
|
7
|
+
/** Where a decoded value is written to: a block attribute, a style, a property, or nothing. */
|
|
8
|
+
export type ControlValueType = 'attribute' | 'style' | 'property' | 'decorative';
|
|
9
|
+
/**
|
|
10
|
+
* Ambient host state that the control branches read at render time.
|
|
11
|
+
*
|
|
12
|
+
* Every field is optional so a consumer supplies only what the control types it actually
|
|
13
|
+
* renders need. Missing fields are defaulted in the private `context` getter; the class
|
|
14
|
+
* doc lists which branch degrades without which field.
|
|
15
|
+
*/
|
|
16
|
+
export type ControlRendererContext = {
|
|
17
|
+
allowedFolders?: string[];
|
|
18
|
+
baseUrl?: string;
|
|
19
|
+
blockAttributes?: Record<string, any>;
|
|
20
|
+
blockStyles?: StyleProps;
|
|
21
|
+
boundary?: HTMLElement;
|
|
22
|
+
defaultLanguage?: string;
|
|
23
|
+
isAfterShow?: boolean;
|
|
24
|
+
onConfigureWorkflow?: (id?: string) => Promise<string>;
|
|
25
|
+
onRequestAsset?: (type: AssetTypeString, multiple?: boolean, accepts?: string[], restrictType?: AssetTypeString) => Promise<Asset | Record<string, Asset>>;
|
|
26
|
+
onRequestAssetFormat?: (assetId: string, value?: AssetFormatValue) => Promise<AssetFormatValue | null | undefined>;
|
|
27
|
+
onRequestDownloadFormat?: (assetIds: string[], formats?: Record<string, string[]>) => Promise<Record<string, string[]>>;
|
|
28
|
+
/**
|
|
29
|
+
* The list's other rows inside a list editor's dialog, so an
|
|
30
|
+
* `inputConfigs.validation` can reject duplicates. `cx-config-form` has no
|
|
31
|
+
* siblings and leaves it empty.
|
|
32
|
+
*/
|
|
33
|
+
siblingRecords?: Array<Record<string, unknown>>;
|
|
34
|
+
sortedLanguages?: string[];
|
|
35
|
+
token?: string;
|
|
36
|
+
traits?: PropertyConfig[];
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Writes one decoded value to the consumer's storage.
|
|
40
|
+
*
|
|
41
|
+
* `cx-config-form` routes this to block attributes / styles / properties and emits
|
|
42
|
+
* `cx-content-builder-form-change`. `cx-list-editor` writes into the edited item and
|
|
43
|
+
* ignores `type`, since an item row is a single flat record.
|
|
44
|
+
*/
|
|
45
|
+
export type ControlCommit = (params: {
|
|
46
|
+
callback?: PropertyConfig['callback'];
|
|
47
|
+
/** Skip the consumer's `await host.updateComplete` — the `switch` + attribute path. */
|
|
48
|
+
immediate?: boolean;
|
|
49
|
+
key: string;
|
|
50
|
+
type: ControlValueType;
|
|
51
|
+
value: unknown;
|
|
52
|
+
}) => Promise<void> | void;
|
|
53
|
+
export type ControlRendererOptions = {
|
|
54
|
+
commit: ControlCommit;
|
|
55
|
+
/** Live consumer state. Re-invoked at every read site — never cache the result. */
|
|
56
|
+
getContext: () => ControlRendererContext;
|
|
57
|
+
/** Renders a `group` trait's children. Omit when the consumer has no `group` support. */
|
|
58
|
+
renderChildren?: (children: PropertyConfig[], parent: PropertyConfig) => unknown;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* @summary Renders a content-builder `PropertyConfig` as a form control, and decodes the value
|
|
62
|
+
* that control emits back into key/value writes.
|
|
63
|
+
*
|
|
64
|
+
* Shared by `cx-config-form` (the block settings panel) and `cx-list-editor` (the add/edit item
|
|
65
|
+
* dialog) so the control types are implemented once.
|
|
66
|
+
*
|
|
67
|
+
* Two layers, usable independently:
|
|
68
|
+
* - `renderControl()` dispatches on `trait.controlType` and returns the control's template. It
|
|
69
|
+
* never writes anything; it calls the injected `handleChange` with a per-controlType payload.
|
|
70
|
+
* - `createChangeHandler()` builds the `handleChange` that decodes that payload and calls
|
|
71
|
+
* `options.commit`.
|
|
72
|
+
*
|
|
73
|
+
* The rendered `cx-*` tags are bare tag names: this module imports no component class for them.
|
|
74
|
+
* Each consumer declares the tags it needs in its own `static dependencies`, which is what lets
|
|
75
|
+
* `cx-list-editor` reuse the renderer without pulling in every picker.
|
|
76
|
+
*
|
|
77
|
+
* Context fields and the branches that read them:
|
|
78
|
+
*
|
|
79
|
+
* | Field | Read by | Missing means |
|
|
80
|
+
* | --- | --- | --- |
|
|
81
|
+
* | `onRequestAsset` | gallery / image / other / all / audio / video / icon picker | picker opens no DAM dialog |
|
|
82
|
+
* | `boundary` | asset-transformation, folder / gallery / page / color-swatch picker, list-editor | popup clipping only |
|
|
83
|
+
* | `blockStyles` | corner-position-input-group, font-picker | offsets read 0px, default font family |
|
|
84
|
+
* | `blockAttributes` | default input validation, image-picker record id | validation sees an empty record |
|
|
85
|
+
* | `sortedLanguages`, `defaultLanguage` | list-editor, color-swatch-picker | no translation tab |
|
|
86
|
+
* | `traits` | audio / video picker | no sibling asset-format-picker lookup |
|
|
87
|
+
* | `token`, `baseUrl` | asset-transformation | dialog cannot fetch the asset |
|
|
88
|
+
* | `onRequestDownloadFormat` | download-format-picker | picker inert |
|
|
89
|
+
* | `onRequestAssetFormat` | asset-format-picker | picker inert |
|
|
90
|
+
* | `onConfigureWorkflow` | dam-custom-toolbar-buttons | configure-workflow inert |
|
|
91
|
+
* | `isAfterShow` | color-swatch-picker | the swatch table never loads |
|
|
92
|
+
* | `allowedFolders` | folder-picker with `useAllowedFolders` | unrestricted root |
|
|
93
|
+
*/
|
|
94
|
+
export declare class ControlRenderer {
|
|
95
|
+
private readonly host;
|
|
96
|
+
private readonly options;
|
|
97
|
+
private readonly localize;
|
|
98
|
+
private apiSearchAssets;
|
|
99
|
+
private apiGetTeamSpaceFontFamily;
|
|
100
|
+
private readonly pendingGalleryPickerSaves;
|
|
101
|
+
private readonly fontFamiliesCache;
|
|
102
|
+
/** Space font name per control, to store the space-default option explicitly. */
|
|
103
|
+
private readonly spaceFontFamilyCache;
|
|
104
|
+
private readonly pendingFontFamilyFetches;
|
|
105
|
+
private readonly typeSubtypeOptionsCache;
|
|
106
|
+
private readonly pendingTypeSubtypeOptionsFetches;
|
|
107
|
+
/**
|
|
108
|
+
* Monotonic request counter per `srcKey`, so a slow format lookup cannot write
|
|
109
|
+
* its URL over a newer format's. Keyed by `srcKey` because that is the
|
|
110
|
+
* attribute being written — two traits writing different keys never race.
|
|
111
|
+
*/
|
|
112
|
+
private readonly srcResolveVersions;
|
|
113
|
+
constructor(host: ReactiveControllerHost & HTMLElement, options: ControlRendererOptions);
|
|
114
|
+
/**
|
|
115
|
+
* Builds the `handleChange` for one trait: it decodes the payload that the matching
|
|
116
|
+
* `renderControl` branch emits, then commits one or more key/value writes.
|
|
117
|
+
*/
|
|
118
|
+
createChangeHandler({ key, trait, type, }: {
|
|
119
|
+
key: string;
|
|
120
|
+
trait: PropertyConfig;
|
|
121
|
+
type: ControlValueType;
|
|
122
|
+
}): (newValue: unknown, ...args: unknown[]) => Promise<void>;
|
|
123
|
+
/**
|
|
124
|
+
* Reads the consumer's live state and fills in defaults.
|
|
125
|
+
*
|
|
126
|
+
* Deliberately a getter, invoked at each read site: the default input branch validates
|
|
127
|
+
* against `blockAttributes` after an `await`, so snapshotting the context into a local
|
|
128
|
+
* would turn a live read into a stale one.
|
|
129
|
+
*/
|
|
130
|
+
private get context();
|
|
131
|
+
private handleConfigChange;
|
|
132
|
+
private handleAttributeChange;
|
|
133
|
+
/** Claims the next request slot for `srcKey`; call before the first await. */
|
|
134
|
+
private claimSrcResolveVersion;
|
|
135
|
+
/**
|
|
136
|
+
* Resolves a format URL and returns it only if no newer request for the same
|
|
137
|
+
* `srcKey` was claimed while this one was in flight.
|
|
138
|
+
*
|
|
139
|
+
* The version must be claimed by the caller before its first await: the
|
|
140
|
+
* transformation, format and manual-format commits each suspend on the host
|
|
141
|
+
* update, so a confirmation that pauses there would otherwise claim a newer
|
|
142
|
+
* version on resume and overwrite the confirmation that already committed.
|
|
143
|
+
*/
|
|
144
|
+
private resolveLatestAssetFormatSrc;
|
|
145
|
+
/**
|
|
146
|
+
* Resolves the delivery URL to persist for an asset under a given format.
|
|
147
|
+
*
|
|
148
|
+
* A blank `format` means `Auto`, which is what a reset leaves behind: the proxy is then
|
|
149
|
+
* derived from the asset's own extension and size (`resolveAutoFormat`), matching what
|
|
150
|
+
* the block computes at runtime. Without this the reset would keep whichever URL the
|
|
151
|
+
* previous hand-picked format wrote.
|
|
152
|
+
*
|
|
153
|
+
* `TRX` proxies serve the asset's original file. When that file is not something a
|
|
154
|
+
* browser can display — its extension says so, or its doc type does — fall back to the
|
|
155
|
+
* `TR1` transformation proxy, which is always transcoded to a raster format. Mirrors the
|
|
156
|
+
* same fallback in `FetchImageController` (used by the gallery/timeline blocks) and
|
|
157
|
+
* `cx-asset-transformation-dialog`.
|
|
158
|
+
*/
|
|
159
|
+
private resolveAssetFormatSrc;
|
|
160
|
+
/** Resolves the URL and intrinsic ratio from the same selected media field. */
|
|
161
|
+
resolveAssetFormat(recordId: string, format: string): Promise<{
|
|
162
|
+
aspectRatio: number;
|
|
163
|
+
src: string;
|
|
164
|
+
}>;
|
|
165
|
+
private getResolvedImage;
|
|
166
|
+
renderControl({ blockAttributes, container, currentValue, disabled, handleChange, key, label, trait, }: {
|
|
167
|
+
blockAttributes: Record<string, any>;
|
|
168
|
+
container?: Ref<HTMLElement>;
|
|
169
|
+
currentValue: unknown;
|
|
170
|
+
disabled?: boolean;
|
|
171
|
+
handleChange: (newValue: unknown, ...args: unknown[]) => Promise<void>;
|
|
172
|
+
key: string;
|
|
173
|
+
label?: string | false;
|
|
174
|
+
trait: PropertyConfig;
|
|
175
|
+
}): import('lit').TemplateResult<1>;
|
|
176
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Styles for the markup that `ControlRenderer.renderControl()` emits.
|
|
3
|
+
*
|
|
4
|
+
* Every consumer of `ControlRenderer` must include this sheet in its `static styles`,
|
|
5
|
+
* otherwise the shared controls render unstyled. The `config-form__*` class prefix is kept
|
|
6
|
+
* from when these rules lived in `config-form.styles.ts` so the moved markup is untouched.
|
|
7
|
+
*/
|
|
8
|
+
declare const _default: import('lit').CSSResult;
|
|
9
|
+
export default _default;
|
|
@@ -1,24 +1,56 @@
|
|
|
1
1
|
import { default as CxButton } from '../../../atoms/src/components/button/button.ts';
|
|
2
|
+
import { default as CxButtonGroup } from '../../../atoms/src/components/button-group/button-group.ts';
|
|
3
|
+
import { default as CxCard } from '../../../atoms/src/components/card/card.ts';
|
|
4
|
+
import { default as CxCheckbox } from '../../../atoms/src/components/checkbox/checkbox.ts';
|
|
2
5
|
import { default as CxDialog } from '../../../atoms/src/components/dialog/dialog.ts';
|
|
6
|
+
import { default as CxDivider } from '../../../atoms/src/components/divider/divider.ts';
|
|
7
|
+
import { default as CxDropdown } from '../../../atoms/src/components/dropdown/dropdown.ts';
|
|
3
8
|
import { default as CxGrid } from '../../../atoms/src/components/grid/grid.ts';
|
|
4
9
|
import { default as CxGridItem } from '../../../atoms/src/components/grid-item/grid-item.ts';
|
|
10
|
+
import { default as CxIcon } from '../../../atoms/src/components/icon/icon.ts';
|
|
5
11
|
import { default as CxInput } from '../../../atoms/src/components/input/input.ts';
|
|
6
12
|
import { default as CxLineClamp } from '../../../atoms/src/components/line-clamp/line-clamp.ts';
|
|
13
|
+
import { default as CxMenu } from '../../../atoms/src/components/menu/menu.ts';
|
|
14
|
+
import { default as CxMenuItem } from '../../../atoms/src/components/menu-item/menu-item.ts';
|
|
7
15
|
import { default as CxOption } from '../../../atoms/src/components/option/option.ts';
|
|
8
16
|
import { default as CxRadio } from '../../../atoms/src/components/radio/radio.ts';
|
|
17
|
+
import { default as CxRadioCard } from '../../../atoms/src/components/radio-card/radio-card.ts';
|
|
9
18
|
import { default as CxRadioGroup } from '../../../atoms/src/components/radio-group/radio-group.ts';
|
|
10
19
|
import { default as CxSelect } from '../../../atoms/src/components/select/select.ts';
|
|
11
20
|
import { default as CxSpace } from '../../../atoms/src/components/space/space.ts';
|
|
21
|
+
import { default as CxSwitch } from '../../../atoms/src/components/switch/switch.ts';
|
|
12
22
|
import { default as CxTab } from '../../../atoms/src/components/tab/tab.ts';
|
|
13
23
|
import { default as CxTabGroup } from '../../../atoms/src/components/tab-group/tab-group.ts';
|
|
14
24
|
import { default as CxTabPanel } from '../../../atoms/src/components/tab-panel/tab-panel.ts';
|
|
25
|
+
import { default as CxTextarea } from '../../../atoms/src/components/textarea/textarea.ts';
|
|
26
|
+
import { default as CxTooltip } from '../../../atoms/src/components/tooltip/tooltip.ts';
|
|
15
27
|
import { default as CxTypography } from '../../../atoms/src/components/typography/typography.ts';
|
|
28
|
+
import { default as CxVisuallyHidden } from '../../../atoms/src/components/visually-hidden/visually-hidden.ts';
|
|
16
29
|
import { default as CortexElement } from '../../../base/src/cortex-element.ts';
|
|
30
|
+
import { default as CxAssetFormatPicker } from '../../../molecules/src/asset-format-picker/asset-format-picker.ts';
|
|
17
31
|
import { default as CxAssetPicker } from '../../../molecules/src/asset-picker/asset-picker.ts';
|
|
32
|
+
import { default as CxBicolorPicker } from '../../../molecules/src/bicolor-picker/bicolor-picker.ts';
|
|
33
|
+
import { default as CxBorderInputGroup } from '../../../molecules/src/border-input-group/border-input-group.ts';
|
|
34
|
+
import { default as CxConfirmPopover } from '../../../molecules/src/confirm-popover/confirm-popover.ts';
|
|
35
|
+
import { default as CxCornerPositionInputGroup } from '../../../molecules/src/corner-position-input-group/corner-position-input-group.ts';
|
|
36
|
+
import { default as CxDownloadFormatPicker } from '../../../molecules/src/download-format-picker/download-format-picker.ts';
|
|
18
37
|
import { default as CxDynamicSelect } from '../../../molecules/src/dynamic-select/dynamic-select.ts';
|
|
38
|
+
import { default as CxFontPicker } from '../../../molecules/src/font-picker/font-picker.ts';
|
|
39
|
+
import { default as CxIconPicker } from '../../../molecules/src/icon-picker/icon-picker.ts';
|
|
40
|
+
import { default as CxPaddingInputGroup } from '../../../molecules/src/padding-input-group/padding-input-group.ts';
|
|
41
|
+
import { default as CxPositionPicker } from '../../../molecules/src/position-picker/position-picker.ts';
|
|
42
|
+
import { default as CxShadowInputGroup } from '../../../molecules/src/shadow-input-group/shadow-input-group.ts';
|
|
43
|
+
import { default as CxSizeInputGroup } from '../../../molecules/src/size-input-group/size-input-group.ts';
|
|
44
|
+
import { default as CxTypeSubtypeSelect } from '../../../molecules/src/type-subtype-select/type-subtype-select.ts';
|
|
45
|
+
import { default as CxAssetTransformationDialog } from '../asset-transformation-dialog/asset-transformation-dialog.ts';
|
|
19
46
|
import { default as CxTable } from '../../../hybrid/table-core/src/index.ts';
|
|
47
|
+
import { AssetFormatValue } from '../../../types/src/asset-format-picker';
|
|
20
48
|
import { Asset, AssetTypeString } from '../../../types/src/content-builder';
|
|
21
|
-
import { CSSResultGroup } from 'lit';
|
|
49
|
+
import { CSSResultGroup, TemplateResult } from 'lit';
|
|
50
|
+
import { CxColorSwatchPicker } from '../content-builder/components/color-swatch-picker';
|
|
51
|
+
import { CxFolderPicker } from '../content-builder/components/folder-picker';
|
|
52
|
+
import { default as CxGalleryPicker } from '../content-builder/components/gallery-picker/gallery-picker';
|
|
53
|
+
import { default as CxPagePicker } from '../content-builder/components/page-picker/page-picker';
|
|
22
54
|
|
|
23
55
|
export declare const columnDefaults: {
|
|
24
56
|
resizable: boolean;
|
|
@@ -32,37 +64,115 @@ declare enum TabType {
|
|
|
32
64
|
*/
|
|
33
65
|
export default class CxListEditor extends CortexElement {
|
|
34
66
|
static readonly styles: CSSResultGroup;
|
|
67
|
+
/**
|
|
68
|
+
* Mirrors `cx-config-form`'s dependency set, because the add/edit dialog renders its
|
|
69
|
+
* controls through the shared `ControlRenderer` and can therefore emit any control type.
|
|
70
|
+
*
|
|
71
|
+
* Two of the config-form tags are deliberately absent:
|
|
72
|
+
* - `cx-dam-custom-toolbar-buttons-editor` imports `cx-list-editor`, so declaring it here
|
|
73
|
+
* would be a module cycle.
|
|
74
|
+
* - `cx-list-editor` itself, since a list editor nested in its own row dialog has no way
|
|
75
|
+
* to receive `columns` / `sampleItem`.
|
|
76
|
+
*
|
|
77
|
+
* `getColumnTrait()` maps both of those control types to a plain input so a column config
|
|
78
|
+
* naming them degrades predictably instead of rendering an unupgraded element.
|
|
79
|
+
*/
|
|
35
80
|
static readonly dependencies: {
|
|
81
|
+
'cx-asset-format-picker': typeof CxAssetFormatPicker;
|
|
36
82
|
'cx-asset-picker': typeof CxAssetPicker;
|
|
83
|
+
'cx-asset-transformation-dialog': typeof CxAssetTransformationDialog;
|
|
84
|
+
'cx-bicolor-picker': typeof CxBicolorPicker;
|
|
85
|
+
'cx-border-input-group': typeof CxBorderInputGroup;
|
|
37
86
|
'cx-button': typeof CxButton;
|
|
87
|
+
'cx-button-group': typeof CxButtonGroup;
|
|
88
|
+
'cx-card': typeof CxCard;
|
|
89
|
+
'cx-checkbox': typeof CxCheckbox;
|
|
90
|
+
'cx-color-swatch-picker': typeof CxColorSwatchPicker;
|
|
91
|
+
'cx-confirm-popover': typeof CxConfirmPopover;
|
|
92
|
+
'cx-corner-position-input-group': typeof CxCornerPositionInputGroup;
|
|
38
93
|
'cx-dialog': typeof CxDialog;
|
|
94
|
+
'cx-divider': typeof CxDivider;
|
|
95
|
+
'cx-download-format-picker': typeof CxDownloadFormatPicker;
|
|
96
|
+
'cx-dropdown': typeof CxDropdown;
|
|
39
97
|
'cx-dynamic-select': typeof CxDynamicSelect;
|
|
98
|
+
'cx-folder-picker': typeof CxFolderPicker;
|
|
99
|
+
'cx-font-picker': typeof CxFontPicker;
|
|
100
|
+
'cx-gallery-picker': typeof CxGalleryPicker;
|
|
40
101
|
'cx-grid': typeof CxGrid;
|
|
41
102
|
'cx-grid-item': typeof CxGridItem;
|
|
103
|
+
'cx-icon': typeof CxIcon;
|
|
104
|
+
'cx-icon-picker': typeof CxIconPicker;
|
|
42
105
|
'cx-input': typeof CxInput;
|
|
43
106
|
'cx-line-clamp': typeof CxLineClamp;
|
|
107
|
+
'cx-menu': typeof CxMenu;
|
|
108
|
+
'cx-menu-item': typeof CxMenuItem;
|
|
44
109
|
'cx-option': typeof CxOption;
|
|
110
|
+
'cx-padding-input-group': typeof CxPaddingInputGroup;
|
|
111
|
+
'cx-page-picker': typeof CxPagePicker;
|
|
112
|
+
'cx-position-picker': typeof CxPositionPicker;
|
|
45
113
|
'cx-radio': typeof CxRadio;
|
|
114
|
+
'cx-radio-card': typeof CxRadioCard;
|
|
46
115
|
'cx-radio-group': typeof CxRadioGroup;
|
|
47
116
|
'cx-select': typeof CxSelect;
|
|
117
|
+
'cx-shadow-input-group': typeof CxShadowInputGroup;
|
|
118
|
+
'cx-size-input-group': typeof CxSizeInputGroup;
|
|
48
119
|
'cx-space': typeof CxSpace;
|
|
120
|
+
'cx-switch': typeof CxSwitch;
|
|
49
121
|
'cx-tab': typeof CxTab;
|
|
50
122
|
'cx-tab-group': typeof CxTabGroup;
|
|
51
123
|
'cx-tab-panel': typeof CxTabPanel;
|
|
52
124
|
'cx-table': typeof CxTable;
|
|
125
|
+
'cx-textarea': typeof CxTextarea;
|
|
126
|
+
'cx-tooltip': typeof CxTooltip;
|
|
127
|
+
'cx-type-subtype-select': typeof CxTypeSubtypeSelect;
|
|
53
128
|
'cx-typography': typeof CxTypography;
|
|
129
|
+
'cx-visually-hidden': typeof CxVisuallyHidden;
|
|
54
130
|
};
|
|
131
|
+
/**
|
|
132
|
+
* Control types the shared renderer supports but this component cannot host: both render a
|
|
133
|
+
* `cx-list-editor`, which would nest a list editor inside its own row dialog, and the
|
|
134
|
+
* toolbar-buttons editor imports this module so it cannot be a dependency here.
|
|
135
|
+
*/
|
|
136
|
+
private static readonly UNSUPPORTED_CONTROL_TYPES;
|
|
55
137
|
private readonly localize;
|
|
138
|
+
/**
|
|
139
|
+
* Renders the add/edit dialog's controls. Shared with `cx-config-form` so every
|
|
140
|
+
* content-builder control type is implemented once.
|
|
141
|
+
*
|
|
142
|
+
* `commit` collapses the renderer's attribute / style / property distinction: an item row
|
|
143
|
+
* is a single flat record, so every write lands on `editedItem` under its own key.
|
|
144
|
+
*
|
|
145
|
+
* Values are stored as the renderer emits them, without stringifying. That keeps a
|
|
146
|
+
* `switch` column a real boolean, which is what lets the renderer's checked state fall
|
|
147
|
+
* through to plain truthiness instead of needing `checkedValue` / `uncheckedValue`.
|
|
148
|
+
*/
|
|
149
|
+
private readonly controlRenderer;
|
|
56
150
|
dialog: CxDialog;
|
|
57
151
|
table: CxTable;
|
|
58
|
-
|
|
152
|
+
/**
|
|
153
|
+
* The rows being edited.
|
|
154
|
+
*
|
|
155
|
+
* Field values keep whatever JSON type they were authored or edited with — a `switch`
|
|
156
|
+
* column round-trips a real boolean, not the string `'true'`. The attribute form is JSON,
|
|
157
|
+
* so the type survives serializing to a block attribute and parsing back.
|
|
158
|
+
*/
|
|
159
|
+
data: Array<Record<string, unknown>>;
|
|
59
160
|
canAdd: boolean;
|
|
60
161
|
addDialogLabel: string;
|
|
61
162
|
editDialogLabel: string;
|
|
62
163
|
displayField: string;
|
|
63
164
|
descriptionField: string;
|
|
64
165
|
addItemText: string;
|
|
65
|
-
sampleItem: Record<string,
|
|
166
|
+
sampleItem: Record<string, unknown>;
|
|
167
|
+
/**
|
|
168
|
+
* Values from the surrounding scope, keyed by column `field`, shown when an item has not
|
|
169
|
+
* overridden that field. For the content builder these are the block's own styles and
|
|
170
|
+
* attributes, so a section's controls start out showing what the block applies to it.
|
|
171
|
+
*
|
|
172
|
+
* Display only: nothing here is written into the item. The item stays unset until the user
|
|
173
|
+
* changes the control, which is what keeps it inheriting when the block value later changes.
|
|
174
|
+
*/
|
|
175
|
+
inheritedValues: Record<string, unknown>;
|
|
66
176
|
useEvents: boolean;
|
|
67
177
|
sortable: boolean;
|
|
68
178
|
loadingEvent: string;
|
|
@@ -89,11 +199,48 @@ export default class CxListEditor extends CortexElement {
|
|
|
89
199
|
* @default undefined
|
|
90
200
|
*/
|
|
91
201
|
onRequestAsset: ((type: AssetTypeString, multiple?: boolean, accepts?: string[]) => Promise<Asset | Record<string, Asset>>) | undefined;
|
|
92
|
-
|
|
202
|
+
/**
|
|
203
|
+
* Base URL forwarded to the dialog's `cx-asset-transformation-dialog`.
|
|
204
|
+
* Only needed when a column uses the `asset-transformation` control.
|
|
205
|
+
*/
|
|
206
|
+
baseUrl: string;
|
|
207
|
+
/**
|
|
208
|
+
* Auth token forwarded to the dialog's `cx-asset-transformation-dialog`.
|
|
209
|
+
* Only needed when a column uses the `asset-transformation` control.
|
|
210
|
+
*/
|
|
211
|
+
token: string;
|
|
212
|
+
/**
|
|
213
|
+
* Restricts the dialog's `cx-folder-picker` to these folders.
|
|
214
|
+
* Only applies when a column sets `folderPickerConfigs.useAllowedFolders`.
|
|
215
|
+
*/
|
|
216
|
+
allowedFolders: string[];
|
|
217
|
+
/**
|
|
218
|
+
* Function forwarded to the dialog's `cx-download-format-picker`.
|
|
219
|
+
* @default undefined
|
|
220
|
+
*/
|
|
221
|
+
onRequestDownloadFormat: ((assetIds: string[], formats?: Record<string, string[]>) => Promise<Record<string, string[]>>) | undefined;
|
|
222
|
+
/**
|
|
223
|
+
* Function forwarded to the dialog's `cx-asset-format-picker`.
|
|
224
|
+
* @default undefined
|
|
225
|
+
*/
|
|
226
|
+
onRequestAssetFormat: ((assetId: string, value?: AssetFormatValue) => Promise<AssetFormatValue | null | undefined>) | undefined;
|
|
227
|
+
editedItem: Record<string, unknown> | null;
|
|
93
228
|
isAdding: boolean;
|
|
229
|
+
/**
|
|
230
|
+
* True once the add/edit dialog has finished opening. The `color-swatch-picker` control
|
|
231
|
+
* defers loading its table until then, so it must be threaded into the renderer context.
|
|
232
|
+
*/
|
|
233
|
+
private isDialogAfterShow;
|
|
94
234
|
private columnsMap;
|
|
95
235
|
private sortedEntries;
|
|
96
236
|
private translatableControls;
|
|
237
|
+
/**
|
|
238
|
+
* `columns` adapted to traits, rebuilt only when `columns` changes.
|
|
239
|
+
*
|
|
240
|
+
* The audio/video-picker controls look up a sibling `asset-format-picker` trait, so the
|
|
241
|
+
* renderer needs the whole set. Building it per read would be quadratic in column count.
|
|
242
|
+
*/
|
|
243
|
+
private columnTraits;
|
|
97
244
|
private disableCloseConfigDialog;
|
|
98
245
|
get tabs(): TabType[];
|
|
99
246
|
handleColumnsChange(): void;
|
|
@@ -108,9 +255,37 @@ export default class CxListEditor extends CortexElement {
|
|
|
108
255
|
private handleTableRowMoved;
|
|
109
256
|
private handleAssetRequestStatus;
|
|
110
257
|
handleLoadingEventChange(): Promise<void>;
|
|
111
|
-
private
|
|
258
|
+
private handleDialogAfterShow;
|
|
259
|
+
private handleDialogAfterHide;
|
|
260
|
+
/**
|
|
261
|
+
* Adapts one column config into the `PropertyConfig` the shared renderer consumes.
|
|
262
|
+
*
|
|
263
|
+
* The column is spread through untouched, so a column can set any renderer option
|
|
264
|
+
* (`options`, `api`, `clearable`, `selectConfigs`, …) directly. Only the fields the
|
|
265
|
+
* list editor has to own are overridden.
|
|
266
|
+
*/
|
|
267
|
+
private getColumnTrait;
|
|
268
|
+
/**
|
|
269
|
+
* Evaluates a column's `show`, which is either a literal or a predicate over the item being
|
|
270
|
+
* edited — the same contract `cx-config-form` uses for block traits. Because this runs from
|
|
271
|
+
* the `editedItem` watcher, toggling one control re-evaluates the rest.
|
|
272
|
+
*/
|
|
273
|
+
private isColumnVisible;
|
|
274
|
+
/**
|
|
275
|
+
* Resolves what a column's control displays: the item's own value, else the inherited
|
|
276
|
+
* value from the surrounding scope, else the column default.
|
|
277
|
+
*
|
|
278
|
+
* `undefined` and `''` count as not overridden — an emptied control means "inherit". A
|
|
279
|
+
* `false` from a switch does not, so the check is explicit rather than a falsy test.
|
|
280
|
+
*/
|
|
281
|
+
private getColumnValue;
|
|
282
|
+
private renderColumnControl;
|
|
283
|
+
/** Renders the children of a `group` column, which are traits rather than columns. */
|
|
284
|
+
private renderGroupChildren;
|
|
285
|
+
/** A horizontal group child's width as a percentage, or 0 when it has none. */
|
|
286
|
+
private resolveChildWidth;
|
|
112
287
|
private renderControls;
|
|
113
|
-
render():
|
|
288
|
+
render(): TemplateResult<1>;
|
|
114
289
|
}
|
|
115
290
|
declare global {
|
|
116
291
|
interface HTMLElementTagNameMap {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Node } from '@tiptap/core';
|
|
2
|
+
|
|
3
|
+
/** Marks the span in the saved HTML so the node survives a round-trip. */
|
|
4
|
+
declare const METAFIELD_ATTRIBUTE = "data-metafield";
|
|
5
|
+
/**
|
|
6
|
+
* An inline atom holding a placeholder token. It reads as one unit — a single
|
|
7
|
+
* backspace removes the whole chip — while still accepting text formatting,
|
|
8
|
+
* since marks are allowed by the parent node, not by the atom itself.
|
|
9
|
+
*/
|
|
10
|
+
declare const Metafield: Node<any, any>;
|
|
11
|
+
export default Metafield;
|
|
12
|
+
export { METAFIELD_ATTRIBUTE };
|
|
@@ -10,4 +10,4 @@ import { Schema } from '@tiptap/pm/model';
|
|
|
10
10
|
* Constructs the model cannot represent are not dropped: `html_block` and `html_inline` hold their
|
|
11
11
|
* source verbatim and are replayed on the way out.
|
|
12
12
|
*/
|
|
13
|
-
export declare const markdownSchema: Schema<"image" | "
|
|
13
|
+
export declare const markdownSchema: Schema<"image" | "blockquote" | "table" | "text" | "heading" | "paragraph" | "frontmatter" | "doc" | "bullet_list" | "code_block" | "horizontal_rule" | "list_item" | "ordered_list" | "table_row" | "table_cell" | "table_header" | "hard_break" | "html_block" | "html_inline", "link" | "code" | "em" | "strong" | "strike">;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseVariant } from './index.ts';
|
|
2
2
|
|
|
3
|
-
export type ButtonVariant = BaseVariant | 'default' | 'text' | 'tertiary' | 'custom';
|
|
3
|
+
export type ButtonVariant = BaseVariant | 'default' | 'text' | 'tertiary' | 'outline' | 'custom';
|
|
4
4
|
export type ButtonCaretDirection = 'up' | 'down' | 'left' | 'right';
|
|
5
5
|
export declare enum ButtonWidthType {
|
|
6
6
|
Adaptive = "adaptive",
|
|
@@ -5,7 +5,63 @@ export declare enum CxColorSwatchGroupVariant {
|
|
|
5
5
|
Grid = "grid",
|
|
6
6
|
Table = "table"
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* How a table column claims horizontal space: share the free space with the
|
|
10
|
+
* other flexible columns, or shrink to its own content.
|
|
11
|
+
*/
|
|
12
|
+
export declare enum CxColorSwatchGroupColumnWidthMode {
|
|
13
|
+
FillContainer = "fill-container",
|
|
14
|
+
HugContents = "hug-contents"
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Horizontal alignment of a table column's header and cells. Tabulator only
|
|
18
|
+
* supports these three values, so `justify` is intentionally absent.
|
|
19
|
+
*/
|
|
20
|
+
export declare enum CxColorSwatchGroupColumnAlignment {
|
|
21
|
+
Center = "center",
|
|
22
|
+
Left = "left",
|
|
23
|
+
Right = "right"
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Optional table chrome that can be toggled off from the block settings.
|
|
27
|
+
*/
|
|
28
|
+
export declare enum CxColorSwatchGroupElement {
|
|
29
|
+
ColumnTitles = "column-titles",
|
|
30
|
+
PaletteName = "palette-name",
|
|
31
|
+
SeparatorLine = "separator-line"
|
|
32
|
+
}
|
|
8
33
|
export type PaletteGroup = {
|
|
9
34
|
colors: ColorSwatchData[];
|
|
10
35
|
palette: string;
|
|
11
36
|
};
|
|
37
|
+
/**
|
|
38
|
+
* One author-declared table column, shared by the Custom columns list and the
|
|
39
|
+
* color dialog's metadata inputs.
|
|
40
|
+
*
|
|
41
|
+
* `id` is the stable key each color stores its value under in
|
|
42
|
+
* `ColorSwatchData.metadata`, so renaming a column keeps its values. An unset
|
|
43
|
+
* presentation field means "inherit the block's Content font group".
|
|
44
|
+
*/
|
|
45
|
+
export type ColorSwatchCustomColumn = {
|
|
46
|
+
alignment?: CxColorSwatchGroupColumnAlignment;
|
|
47
|
+
color?: string;
|
|
48
|
+
/** Whether `minWidth` / `maxWidth` apply, mirroring the built-in columns' toggle. */
|
|
49
|
+
constraints?: boolean;
|
|
50
|
+
fontFamily?: string;
|
|
51
|
+
fontSize?: string;
|
|
52
|
+
fontStyle?: string;
|
|
53
|
+
fontWeight?: string;
|
|
54
|
+
id: string;
|
|
55
|
+
/** CSS lengths as authored (`'130px'`), the same shape the px-masked inputs emit. */
|
|
56
|
+
maxWidth?: string;
|
|
57
|
+
minWidth?: string;
|
|
58
|
+
name: string;
|
|
59
|
+
widthMode?: CxColorSwatchGroupColumnWidthMode;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* What a custom column starts out as. Both creation paths — the Add column
|
|
63
|
+
* dialog and a free-form metadata pair — spread this, so a column behaves the
|
|
64
|
+
* same however it was born. `fontSize` matches the block's Content group
|
|
65
|
+
* (`--cx-font-size-large`), which the column would have rendered at anyway.
|
|
66
|
+
*/
|
|
67
|
+
export declare const DEFAULT_CUSTOM_COLUMN: Omit<ColorSwatchCustomColumn, 'id' | 'name'>;
|
|
@@ -3,12 +3,34 @@ export declare enum CxColorSwatchVariant {
|
|
|
3
3
|
GridItem = "grid-item",
|
|
4
4
|
Oval = "oval"
|
|
5
5
|
}
|
|
6
|
+
/** Whether a code label and its value share a line or stack. */
|
|
7
|
+
export declare enum CxColorSwatchCodeAlignment {
|
|
8
|
+
SameLine = "same-line",
|
|
9
|
+
SeparateLine = "separate-line"
|
|
10
|
+
}
|
|
11
|
+
/** Separator between the numeric parts of an RGB / CMYK code. */
|
|
12
|
+
export declare enum CxColorSwatchCodeSeparator {
|
|
13
|
+
Comma = "comma",
|
|
14
|
+
Slash = "slash"
|
|
15
|
+
}
|
|
16
|
+
/** Which prefix, if any, a HEX code keeps. */
|
|
17
|
+
export declare enum CxColorSwatchHexFormat {
|
|
18
|
+
LeadingHash = "leading-hash",
|
|
19
|
+
LeadingHex = "leading-hex",
|
|
20
|
+
None = "none"
|
|
21
|
+
}
|
|
6
22
|
export type ColorSwatchData = {
|
|
7
23
|
[key: `name-${string}`]: string;
|
|
8
24
|
cmyk?: string;
|
|
9
25
|
color: string;
|
|
10
26
|
hex?: string;
|
|
11
27
|
id: string;
|
|
28
|
+
/**
|
|
29
|
+
* Custom column values, keyed by `ColorSwatchCustomColumn.id`. Keys with no
|
|
30
|
+
* matching column are kept but not rendered, so deleting a column and adding
|
|
31
|
+
* it back restores its values.
|
|
32
|
+
*/
|
|
33
|
+
metadata?: Record<string, string>;
|
|
12
34
|
name?: string;
|
|
13
35
|
palette?: string;
|
|
14
36
|
pms?: string;
|
|
@@ -2,9 +2,22 @@ export declare enum ColumnTriggerMode {
|
|
|
2
2
|
Hover = "hover",
|
|
3
3
|
Manual = "manual"
|
|
4
4
|
}
|
|
5
|
+
/**
|
|
6
|
+
* Column-level override of the container's width setting.
|
|
7
|
+
* `Default` keeps inheriting from the column group.
|
|
8
|
+
*/
|
|
9
|
+
export declare enum ColumnWidthMode {
|
|
10
|
+
Adaptive = "adaptive",
|
|
11
|
+
Default = "default",
|
|
12
|
+
Fill = "fill",
|
|
13
|
+
Fit = "fit",
|
|
14
|
+
Fixed = "fixed",
|
|
15
|
+
PageWidth = "page-width"
|
|
16
|
+
}
|
|
5
17
|
export declare enum ColumnWidthType {
|
|
6
18
|
Fill = "fill",
|
|
7
19
|
Fit = "fit",
|
|
8
20
|
Fixed = "fixed",
|
|
21
|
+
PageWidth = "page-width",
|
|
9
22
|
Relative = "relative"
|
|
10
23
|
}
|