@orangelogic/orange-dam-content-browser-sdk 2.4.8 → 2.4.9

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 (26) hide show
  1. package/build/GlobalConfigContext.d.ts +4 -0
  2. package/build/OrangeDAMContentBrowserSDK.min.js +738 -337
  3. package/build/api/asset/asset.d.ts +2 -1
  4. package/build/api/asset/asset.types.d.ts +9 -0
  5. package/build/components/content-browser/content-browser.d.ts +73 -2
  6. package/build/components/content-browser-asset-card/content-browser-asset-card.d.ts +25 -1
  7. package/build/components/content-browser-control-bar/content-browser-control-bar.d.ts +1 -0
  8. package/build/components/content-browser-control-view/content-browser-control-view.d.ts +5 -2
  9. package/build/components/content-browser-format-dialog/content-browser-format-dialog.d.ts +27 -1
  10. package/build/components/content-browser-grid/content-browser-grid.d.ts +5 -1
  11. package/build/components/content-browser-table/column-layout.d.ts +29 -0
  12. package/build/components/content-browser-table/content-browser-table.d.ts +302 -0
  13. package/build/components/content-browser-table/content-browser-table.styles.d.ts +2 -0
  14. package/build/content-browser.mjs +2506 -450
  15. package/build/events/cx-content-browser-control-view-change.d.ts +2 -2
  16. package/build/events/cx-content-browser-request-change.d.ts +2 -2
  17. package/build/events/cx-content-browser-table-column-resize.d.ts +26 -0
  18. package/build/events/index.d.ts +1 -0
  19. package/build/index.d.ts +40 -2
  20. package/build/index.html +4 -0
  21. package/build/index.mjs +2531 -635
  22. package/build/tools/fetch-and-merge-assets.d.ts +15 -3
  23. package/build/types/asset.d.ts +5 -0
  24. package/build/types/content-browser.d.ts +69 -0
  25. package/build/utils/table-column-widths.d.ts +5 -0
  26. package/package.json +2 -2
@@ -1,11 +1,13 @@
1
1
  import CortexElement from '../base/element';
2
- import { GetAssetLinksRequest, GetAvailableExtensionsResponse } from '../api/asset/asset.types';
2
+ import { GetAssetLinksRequest, GetAssetsResponse, GetAvailableExtensionsResponse } from '../api/asset/asset.types';
3
3
  import { Asset, GetAssetsRequest, MediaType } from '../types/asset';
4
4
  import { UserInfo } from '../types/auth';
5
5
  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
  bearerToken: string;
@@ -30,6 +32,8 @@ export declare class FetchAndMergeAssetsController implements ReactiveController
30
32
  private facets;
31
33
  private items;
32
34
  private totalCount;
35
+ /** The requested fields, spelled as Cortex sent them, that the user cannot read on the rows in `items`. */
36
+ private unreadableFields;
33
37
  private lastRequest;
34
38
  /** The resolved request of the last search that got an error. A retry sends it again. */
35
39
  private failedRequest;
@@ -48,6 +52,7 @@ export declare class FetchAndMergeAssetsController implements ReactiveController
48
52
  private resolvePendingTokenRefresh;
49
53
  private readonly tokenRefreshTimeoutMs;
50
54
  private readonly availableDocTypes;
55
+ private additionalFields;
51
56
  private readonly defaultSearchText;
52
57
  private readonly defaultSelectedFacets;
53
58
  private readonly defaultSortOrderName;
@@ -56,7 +61,7 @@ export declare class FetchAndMergeAssetsController implements ReactiveController
56
61
  private readonly defaultIsSeeThrough;
57
62
  private requestInterceptorId;
58
63
  private responseInterceptorId;
59
- constructor(host: CortexElement, { availableDocTypes, baseUrl, bearerToken, defaultFolderId, defaultIsSeeThrough, defaultSearchText, defaultSelectedFacets, defaultSortDirection, defaultSortOrderName, token, useSession, useSiteSession, }: FetchAndMergeAssetsControllerOptions);
64
+ constructor(host: CortexElement, { additionalFields, availableDocTypes, baseUrl, bearerToken, defaultFolderId, defaultIsSeeThrough, defaultSearchText, defaultSelectedFacets, defaultSortDirection, defaultSortOrderName, token, useSession, useSiteSession, }: FetchAndMergeAssetsControllerOptions);
60
65
  private waitForNewToken;
61
66
  /**
62
67
  * Site-session mode decides the transport (cookies on the Cortex origin vs. Token/UseSession
@@ -68,13 +73,19 @@ export declare class FetchAndMergeAssetsController implements ReactiveController
68
73
  * step with the UI instead of serving requests through the mode the controller was built with.
69
74
  */
70
75
  updateSiteSession(useSiteSession: boolean, baseUrl: string, token: string, useSession: string, bearerToken: string): void;
76
+ /**
77
+ * Table columns are host configuration and can be reconfigured after mount, unlike the rest of
78
+ * these options — every later fetch must ask for the current field list, not the one that
79
+ * happened to be set when the controller was constructed.
80
+ */
81
+ updateAdditionalFields(additionalFields: string[]): void;
71
82
  updateAuth(token: string, useSession: string, bearerToken: string): void;
72
83
  private fetchInitialData;
73
84
  private _debounceTimeout;
74
85
  private _debouncePromise;
75
86
  private _debounceResolve;
76
87
  private mapAvailableExtensions;
77
- fetchAssets(request: GetAssetsRequest): Promise<import("../api/asset/asset.types").GetAssetsResponse>;
88
+ fetchAssets(request: GetAssetsRequest): Promise<GetAssetsResponse>;
78
89
  fetchFolders(request: GetFolderRequest): Promise<import("../types/folder").GetFolderResponse>;
79
90
  /** Sends the last search that got an error again, with the same page and controls. */
80
91
  retrySearch(): Promise<void>;
@@ -150,6 +161,7 @@ export declare class FetchAndMergeAssetsController implements ReactiveController
150
161
  searchError: boolean;
151
162
  sortOrders: Record<string, SortOrder[]>;
152
163
  totalCount: number;
164
+ unreadableFields: string[];
153
165
  userInfo: UserInfo | null;
154
166
  };
155
167
  hostConnected(): void;
@@ -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,37 @@ 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
+ /** @deprecated Ignored. The table fits each column to its content, and the user resizes it. */
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. Surrounding whitespace
61
+ * is trimmed, and the trimmed name is what the duplicate-column check compares. When Cortex flags
62
+ * the field as one the user cannot read, the table does not show the column, as the DAM does. The
63
+ * field stays in the request, so that the next response can flag it again.
64
+ */
65
+ field: string;
66
+ /** @deprecated Ignored. The table fits each column to its content, and the user resizes it. */
67
+ lines?: number;
68
+ /** Column header text. */
69
+ title: string;
70
+ /** @deprecated Ignored. The table fits each column to its content, and the user resizes it. */
71
+ width?: string;
72
+ };
42
73
  export declare const ASSET_SIZE: {
43
74
  small: {
44
75
  maxWidth: number;
@@ -113,8 +144,46 @@ export type FocusMode = {
113
144
  value: string;
114
145
  };
115
146
  export type DefaultFocusMode = 'manual' | 'center';
147
+ /**
148
+ * Import behaviour when the host would rather not show the format picker.
149
+ *
150
+ * - `false` — the format dialog opens as usual.
151
+ * - `true` — insert with the first available format, without showing the dialog.
152
+ * - a format name — insert with that format, matched case-insensitively against a proxy's
153
+ * `proxyName` or `proxyLabel`. A name matching nothing opens the dialog as usual.
154
+ */
155
+ export type AutoSelectFormat = boolean | string;
156
+ /**
157
+ * Serves markup hosts: `<cx-content-browser auto-select-format="WEB">`. The union has to survive a
158
+ * round trip through a string, so `"true"`/`"false"` are the booleans and anything else is a format
159
+ * name; a bare attribute means `true`, matching how a boolean attribute normally reads.
160
+ *
161
+ * React hosts bypass this entirely — `CortexElement.createProperty` aliases the attribute name onto
162
+ * the prototype, so react-dom finds `'auto-select-format' in element` and assigns the property with
163
+ * its real type rather than setting an attribute.
164
+ */
165
+ export declare const autoSelectFormatConverter: {
166
+ fromAttribute: (value: string | null) => AutoSelectFormat;
167
+ toAttribute: (value: AutoSelectFormat) => string | null;
168
+ };
169
+ /**
170
+ * Whether `autoSelectFormat` is switched on at all — a blank string is off, not a format named " ".
171
+ *
172
+ * Config-level, not per-asset: it says the host has asked to skip the picker, not that this
173
+ * particular asset will skip it. A named format that no proxy matches still opens the dialog.
174
+ */
175
+ export declare function isAutoSelectFormatActive(value: AutoSelectFormat): boolean;
116
176
  export type CtaTextTransform = 'none' | 'uppercase' | 'lowercase' | 'capitalize';
177
+ /**
178
+ * Where the table shows the row action: at the right edge of the host (`host-edge`), or at the end
179
+ * of the last data column (`row-end`).
180
+ */
181
+ export type TableRowActionPosition = 'host-edge' | 'row-end';
182
+ /** Reads a row action position. Any value other than `row-end` gives `host-edge`. */
183
+ export declare function toTableRowActionPosition(value: unknown): TableRowActionPosition;
117
184
  export declare enum ContentBrowserFormatDialogVariant {
118
185
  Dialog = "dialog",
119
186
  Drawer = "drawer"
120
187
  }
188
+ /** Two Cortex field names name one field when these keys are equal: the table trims and ignores case. */
189
+ export declare function toFieldKey(field: string): string;
@@ -0,0 +1,5 @@
1
+ export type TableColumnWidths = Record<string, number>;
2
+ /** A site URL with and without a trailing slash gives the same key. */
3
+ export declare function tableColumnWidthsKey(siteUrl: string): string;
4
+ export declare function readTableColumnWidths(siteUrl: string): Promise<TableColumnWidths>;
5
+ export declare function writeTableColumnWidth(siteUrl: string, field: string, width: number | undefined): Promise<TableColumnWidths>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orangelogic/orange-dam-content-browser-sdk",
3
- "version": "2.4.8",
3
+ "version": "2.4.9",
4
4
  "description": "OrangeDAM Content Browser SDK source code",
5
5
  "main": "./build/OrangeDAMContentBrowserSDK.min.js",
6
6
  "module": "./build/index.mjs",
@@ -93,7 +93,7 @@
93
93
  "dependencies": {
94
94
  "@lit-labs/virtualizer": "^2.1.1",
95
95
  "@open-wc/testing": "^4.0.0",
96
- "@orangelogic/design-system": "3.40.0",
96
+ "@orangelogic/design-system": "3.56.0",
97
97
  "@reduxjs/toolkit": "^2.11.2",
98
98
  "@types/node": "^20.4.8",
99
99
  "@types/react": "^19.0.8",