@orangelogic/orange-dam-content-browser-sdk 2.3.6 → 2.3.7-table-view-beta-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. package/build/GlobalConfigContext.d.ts +3 -0
  2. package/build/OrangeDAMContentBrowserSDK.min.js +782 -326
  3. package/build/api/asset/asset.d.ts +2 -1
  4. package/build/components/content-browser/content-browser.d.ts +37 -2
  5. package/build/components/content-browser-asset-card/content-browser-asset-card.d.ts +17 -1
  6. package/build/components/content-browser-control-bar/content-browser-control-bar.d.ts +1 -0
  7. package/build/components/content-browser-control-view/content-browser-control-view.d.ts +5 -2
  8. package/build/components/content-browser-format-dialog/content-browser-format-dialog.d.ts +27 -1
  9. package/build/components/content-browser-grid/content-browser-grid.d.ts +5 -1
  10. package/build/components/content-browser-grid/scroll-anchor-controller.d.ts +12 -1
  11. package/build/components/content-browser-table/content-browser-table.d.ts +178 -0
  12. package/build/components/content-browser-table/content-browser-table.styles.d.ts +2 -0
  13. package/build/content-browser.mjs +1725 -474
  14. package/build/events/cx-content-browser-control-view-change.d.ts +2 -2
  15. package/build/events/cx-content-browser-request-change.d.ts +2 -2
  16. package/build/events/cx-content-browser-table-column-resize.d.ts +16 -0
  17. package/build/events/index.d.ts +1 -0
  18. package/build/index.d.ts +29 -2
  19. package/build/index.html +4 -0
  20. package/build/index.mjs +1694 -425
  21. package/build/tools/fetch-and-merge-assets.d.ts +10 -1
  22. package/build/types/asset.d.ts +5 -0
  23. package/build/types/content-browser.d.ts +53 -0
  24. package/package.json +1 -1
@@ -6,6 +6,8 @@ import { Facet, SortOrder } from '../types/content-browser';
6
6
  import { GetFolderRequest } from '../types/folder';
7
7
  import type { ReactiveController } from 'lit';
8
8
  type FetchAndMergeAssetsControllerOptions = {
9
+ /** Cortex fields the table-view columns read, requested on every search alongside the fixed set. */
10
+ additionalFields?: string[];
9
11
  availableDocTypes: string[];
10
12
  baseUrl: string;
11
13
  defaultFolderId: string;
@@ -44,6 +46,7 @@ export declare class FetchAndMergeAssetsController implements ReactiveController
44
46
  private resolvePendingTokenRefresh;
45
47
  private readonly tokenRefreshTimeoutMs;
46
48
  private readonly availableDocTypes;
49
+ private additionalFields;
47
50
  private readonly defaultSearchText;
48
51
  private readonly defaultSelectedFacets;
49
52
  private readonly defaultSortOrderName;
@@ -52,7 +55,7 @@ export declare class FetchAndMergeAssetsController implements ReactiveController
52
55
  private readonly defaultIsSeeThrough;
53
56
  private requestInterceptorId;
54
57
  private responseInterceptorId;
55
- constructor(host: CortexElement, { availableDocTypes, baseUrl, defaultFolderId, defaultIsSeeThrough, defaultSearchText, defaultSelectedFacets, defaultSortDirection, defaultSortOrderName, token, useSession, useSiteSession, }: FetchAndMergeAssetsControllerOptions);
58
+ constructor(host: CortexElement, { additionalFields, availableDocTypes, baseUrl, defaultFolderId, defaultIsSeeThrough, defaultSearchText, defaultSelectedFacets, defaultSortDirection, defaultSortOrderName, token, useSession, useSiteSession, }: FetchAndMergeAssetsControllerOptions);
56
59
  private waitForNewToken;
57
60
  /**
58
61
  * Site-session mode decides the transport (cookies on the Cortex origin vs. Token/UseSession
@@ -64,6 +67,12 @@ export declare class FetchAndMergeAssetsController implements ReactiveController
64
67
  * step with the UI instead of serving requests through the mode the controller was built with.
65
68
  */
66
69
  updateSiteSession(useSiteSession: boolean, baseUrl: string, token: string, useSession: string): void;
70
+ /**
71
+ * Table columns are host configuration and can be reconfigured after mount, unlike the rest of
72
+ * these options — every later fetch must ask for the current field list, not the one that
73
+ * happened to be set when the controller was constructed.
74
+ */
75
+ updateAdditionalFields(additionalFields: string[]): void;
67
76
  updateAuth(token: string, useSession: string): void;
68
77
  private fetchInitialData;
69
78
  private _debounceTimeout;
@@ -80,6 +80,11 @@ export type GetAssetLinksRequest = {
80
80
  useRepresentative?: boolean;
81
81
  };
82
82
  export type GetAssetsRequest = {
83
+ /**
84
+ * Extra Cortex fields to request alongside the fixed set, returned on each item under the field
85
+ * name as sent. Used by the table view to resolve host-configured columns.
86
+ */
87
+ fields?: string[];
83
88
  folderId?: string;
84
89
  isSeeThrough?: boolean;
85
90
  limitedToDocTypes?: string[];
@@ -39,6 +39,34 @@ export declare enum GridView {
39
39
  Medium = "medium",
40
40
  Small = "small"
41
41
  }
42
+ /**
43
+ * The table layout. `GridView` members are the grid's pixel-width presets, so a layout that is not
44
+ * a grid at all cannot be one of them.
45
+ */
46
+ export declare const TABLE_VIEW = "table";
47
+ /** What the content browser is currently rendering: one of the grid size presets, or the table. */
48
+ export type ContentBrowserView = GridView | typeof TABLE_VIEW;
49
+ export type TableColumnAlign = 'center' | 'left' | 'right';
50
+ /**
51
+ * One column of the table view. The host owns the column set: the SDK ships the mechanism and no
52
+ * default column list, so nothing here is guessed from the asset's doc type.
53
+ */
54
+ export type TableColumn = {
55
+ /** Horizontal alignment of the cell text. Default `left`. */
56
+ align?: TableColumnAlign;
57
+ /**
58
+ * Cortex field the column reads, e.g. `CoreField.Identifier` or `Dell.Snippet`. It is appended to
59
+ * the field list of the same search call the grid uses, so what a given caller gets back is decided
60
+ * server-side — the SDK neither filters nor resolves fields of its own.
61
+ */
62
+ field: string;
63
+ /** Lines a cell shows before the text is clamped. Default 1. */
64
+ lines?: number;
65
+ /** Column header text. */
66
+ title: string;
67
+ /** CSS grid track for the column, e.g. `200px`, `2fr`, `minmax(120px, 1fr)`. Default `minmax(0, 1fr)`. */
68
+ width?: string;
69
+ };
42
70
  export declare const ASSET_SIZE: {
43
71
  small: {
44
72
  maxWidth: number;
@@ -113,6 +141,31 @@ export type FocusMode = {
113
141
  value: string;
114
142
  };
115
143
  export type DefaultFocusMode = 'manual' | 'center';
144
+ /**
145
+ * Import behaviour when the host would rather not show the format picker.
146
+ *
147
+ * - `false` — the format dialog opens as usual.
148
+ * - `true` — insert with the first available format, without showing the dialog.
149
+ * - a format name — insert with that format, matched case-insensitively against a proxy's
150
+ * `proxyName` or `proxyLabel`. A name matching nothing opens the dialog as usual.
151
+ */
152
+ export type AutoSelectFormat = boolean | string;
153
+ /**
154
+ * React 19 sets a hyphenated prop as an attribute rather than a property, so the union has to
155
+ * survive a round trip through a string: `"true"`/`"false"` are the booleans, anything else is a
156
+ * format name. A bare attribute means `true`, matching how a boolean attribute normally reads.
157
+ */
158
+ export declare const autoSelectFormatConverter: {
159
+ fromAttribute: (value: string | null) => AutoSelectFormat;
160
+ toAttribute: (value: AutoSelectFormat) => string | null;
161
+ };
162
+ /**
163
+ * Whether `autoSelectFormat` is switched on at all — a blank string is off, not a format named " ".
164
+ *
165
+ * Config-level, not per-asset: it says the host has asked to skip the picker, not that this
166
+ * particular asset will skip it. A named format that no proxy matches still opens the dialog.
167
+ */
168
+ export declare function isAutoSelectFormatActive(value: AutoSelectFormat): boolean;
116
169
  export type CtaTextTransform = 'none' | 'uppercase' | 'lowercase' | 'capitalize';
117
170
  export declare enum ContentBrowserFormatDialogVariant {
118
171
  Dialog = "dialog",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orangelogic/orange-dam-content-browser-sdk",
3
- "version": "2.3.6",
3
+ "version": "2.3.7-table-view-beta-2",
4
4
  "description": "OrangeDAM Content Browser SDK source code",
5
5
  "main": "./build/OrangeDAMContentBrowserSDK.min.js",
6
6
  "module": "./build/index.mjs",