@richardmcquiston01/dashboard-widgets-toolkit 0.15.0 → 0.16.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.
@@ -931,6 +931,11 @@ interface WidgetDefinition {
931
931
  readonly defaultView?: string;
932
932
  /** What the base view is called in the View field. Default: its kind's name. */
933
933
  readonly baseViewLabel?: string;
934
+ /**
935
+ * Set on a clone (see `clones.ts`): the key of the widget it copies. Its
936
+ * data comes from that widget's provider. Authors never set it.
937
+ */
938
+ readonly sourceKey?: string;
934
939
  }
935
940
  /** What a viewer may not do to a locked widget. */
936
941
  interface WidgetLock {
@@ -942,6 +947,8 @@ interface WidgetLock {
942
947
  readonly minimize?: boolean;
943
948
  /** Can't be given a title, width or option values of the viewer's own. */
944
949
  readonly options?: boolean;
950
+ /** Can't be duplicated into a clone. */
951
+ readonly clone?: boolean;
945
952
  }
946
953
  /** `WidgetLock` with every default filled in. */
947
954
  type ResolvedWidgetLock = Required<WidgetLock>;
@@ -961,70 +968,63 @@ declare function sortDefinitions<D extends WidgetDefinition>(definitions: readon
961
968
  /** Whether a widget is active and visible to someone with these roles. */
962
969
  declare function isWidgetVisibleTo(definition: WidgetDefinition, roles: readonly string[] | undefined): boolean;
963
970
 
964
- /** The parts of a widget definition that decide its place in a grid. */
965
- interface GridItem {
971
+ /**
972
+ * Clones: copies of a widget a viewer made to keep it twice with different
973
+ * settings (another view, width or option values). A clone is stored as
974
+ * `{ key, from }` in `layout.clones`, its settings under its own key in
975
+ * `layout.settings`, and it shares the original's provider. Pure functions,
976
+ * no I/O.
977
+ */
978
+
979
+ /** A widget the viewer made from another. */
980
+ interface WidgetClone {
981
+ /** Unique across definitions and clones: `from#1`, `from#2`, ... */
966
982
  readonly key: string;
967
- readonly defaultSize?: WidgetSize;
968
- readonly fill?: WidgetFill;
969
- readonly width?: number;
983
+ /** The original's key. Always an original, never another clone. */
984
+ readonly from: string;
970
985
  }
971
- /** Columns in a grid that uses widget `width`. */
972
- declare const WIDTH_COLUMNS = 12;
973
- /** Smallest and largest `width`, in twelfths of a row. */
974
- declare const MIN_WIDGET_WIDTH = 2;
975
- declare const MAX_WIDGET_WIDTH = 12;
976
- /** Whether `value` is a valid widget `width`: an integer from 2 to 12. */
977
- declare function isWidgetWidth(value: unknown): value is number;
978
- /** The width (in twelfths) a `defaultSize` stands for. Default `medium`. */
979
- declare function widthForSize(size: WidgetSize | undefined): number;
980
- /** The 12-column width of an item: its `width`, else from its size. */
981
- declare function itemWidth(item: GridItem): number;
982
- /** Whether a grid of `items` should use 12 columns (any item sets `width`). */
983
- declare function usesWidthColumns(items: readonly GridItem[]): boolean;
984
- /** Whether the widget should take the columns left over in its row. */
985
- declare function fillsWidth(fill: WidgetFill | undefined): boolean;
986
- /** Whether the widget should stretch to the height of its row. */
987
- declare function fillsHeight(fill: WidgetFill | undefined): boolean;
988
986
  /**
989
- * Columns a size takes in a grid of `columns` tracks: `large` spans
990
- * `largeSpan` (default 2), `full` spans every column, anything else one.
987
+ * Most clones `parseLayout` keeps: a safety ceiling against malformed or
988
+ * hostile JSON, not a product limit (a page's capacity is the real limit).
991
989
  */
992
- declare function baseColumnSpan(size: WidgetSize | undefined, columns: number, largeSpan?: number): number;
993
- /**
994
- * Places `items` in a grid of `columns` tracks the way a sparse grid
995
- * auto-places them (left to right, wrapping to a new row when an item does
996
- * not fit), then gives the columns left over in each row to the items that
997
- * `fill` their width, shared evenly (earlier items get the remainder).
998
- *
999
- * Returns the column span for each width-filling item, keyed by `key`. Items
1000
- * that do not fill width keep their normal size and are not in the map.
1001
- */
1002
- declare function fillColumnSpans(items: readonly GridItem[], columns: number, largeSpan?: number): Map<string, number>;
990
+ declare const MAX_PARSED_CLONES = 500;
991
+ /** What these functions need from a definition. */
992
+ type CloneItem = Pick<WidgetDefinition, 'key'> & Partial<Pick<WidgetDefinition, 'title' | 'locked' | 'sourceKey'>>;
993
+ /** Options for the clone functions. */
994
+ interface CloneOptions {
995
+ /** Keep clones that a widget's `locked.clone` forbids (an administrator). */
996
+ readonly overrideLocks?: boolean;
997
+ }
1003
998
  /**
1004
- * Like `fillColumnSpans` for a 12-column grid: each item starts at its
1005
- * `width` (see `itemWidth`) and width-fillers share the leftover twelfths.
999
+ * Reads the `clones` field of a saved layout. Anything malformed is dropped
1000
+ * (wrong types, empty or repeated keys, a clone of itself). Returns undefined
1001
+ * when nothing usable is left.
1006
1002
  */
1007
- declare function fillWidthSpans(items: readonly GridItem[]): Map<string, number>;
1008
- /** One row of a placed grid: the widgets in it and their final column spans. */
1009
- interface PlacedRow {
1010
- readonly keys: readonly string[];
1011
- /** Column spans, in `keys` order, after width-fillers took the leftovers. */
1012
- readonly spans: readonly number[];
1013
- }
1003
+ declare function parseClones(raw: unknown): readonly WidgetClone[] | undefined;
1004
+ /** The JSON-ready form of `layout.clones`; undefined when there are none. */
1005
+ declare function serializeClones(clones: readonly WidgetClone[] | undefined): WidgetClone[] | undefined;
1006
+ /** The number in a clone key (`orders#3` is 3), or undefined. */
1007
+ declare function cloneNumber(key: string): number | undefined;
1014
1008
  /**
1015
- * The rows `items` occupy in a 12-column grid, exactly as `fillWidthSpans`
1016
- * places them: left to right, a widget that doesn't fit in the rest of a row
1017
- * starts the next row whole (a widget is never split), and width-fillers then
1018
- * grow into the leftover columns. Growth never changes how many rows there
1019
- * are.
1009
+ * The clones that can exist for these definitions: the original is a real
1010
+ * widget (not itself a clone), the key doesn't shadow another widget, and the
1011
+ * original's `locked.clone` allows it. Returns the same array when nothing is
1012
+ * dropped. Clones already present as definitions (see `withClones`) count as
1013
+ * valid, so the function is idempotent.
1020
1014
  */
1021
- declare function placeRows(items: readonly GridItem[]): readonly PlacedRow[];
1015
+ declare function cleanClones<D extends CloneItem>(definitions: readonly D[], clones: readonly WidgetClone[] | undefined, options?: CloneOptions): readonly WidgetClone[] | undefined;
1022
1016
  /**
1023
- * How many of `items`, in order, fit in `maxRows` rows of a 12-column grid.
1024
- * Placement is left to right, so this is the length of the longest prefix
1025
- * whose rows number at most `maxRows`.
1017
+ * The definitions with each clone added right after its original. A clone's
1018
+ * definition copies the original's, with its own key, `sourceKey` set to the
1019
+ * original, the title "Original (#n)" and no locks (a clone is the viewer's
1020
+ * to move, hide and delete). Settings still apply on top (`effectiveDefinitions`).
1021
+ * Pass the result to `useWidgets` so clones load, and to the settings and
1022
+ * layout functions. Idempotent; returns the same array when there are no
1023
+ * clones to add.
1026
1024
  */
1027
- declare function fitCount(items: readonly GridItem[], maxRows: number): number;
1025
+ declare function withClones<D extends CloneItem>(definitions: readonly D[], layout: {
1026
+ readonly clones?: readonly WidgetClone[];
1027
+ }, options?: CloneOptions): readonly D[];
1028
1028
 
1029
1029
  /**
1030
1030
  * A viewer's own choices for a widget: a title, a width and values for the
@@ -1192,6 +1192,12 @@ interface DashboardLayout {
1192
1192
  * widget key. See `settings.ts`. Absent when they chose nothing.
1193
1193
  */
1194
1194
  readonly settings?: LayoutSettings;
1195
+ /**
1196
+ * Widgets the viewer made from others, as `{ key, from }`. Their settings
1197
+ * live in `settings` under their own key. See `clones.ts`. Absent when
1198
+ * there are none.
1199
+ */
1200
+ readonly clones?: readonly WidgetClone[];
1195
1201
  }
1196
1202
  /** One page of a paged layout: the same lists as a layout, plus a name. */
1197
1203
  interface LayoutPage {
@@ -1290,6 +1296,71 @@ interface EnforceLocksOptions {
1290
1296
  */
1291
1297
  declare function enforceLocks<T extends LayoutItem>(definitions: readonly T[], layout: DashboardLayout, options?: EnforceLocksOptions): DashboardLayout;
1292
1298
 
1299
+ /** The parts of a widget definition that decide its place in a grid. */
1300
+ interface GridItem {
1301
+ readonly key: string;
1302
+ readonly defaultSize?: WidgetSize;
1303
+ readonly fill?: WidgetFill;
1304
+ readonly width?: number;
1305
+ }
1306
+ /** Columns in a grid that uses widget `width`. */
1307
+ declare const WIDTH_COLUMNS = 12;
1308
+ /** Smallest and largest `width`, in twelfths of a row. */
1309
+ declare const MIN_WIDGET_WIDTH = 2;
1310
+ declare const MAX_WIDGET_WIDTH = 12;
1311
+ /** Whether `value` is a valid widget `width`: an integer from 2 to 12. */
1312
+ declare function isWidgetWidth(value: unknown): value is number;
1313
+ /** The width (in twelfths) a `defaultSize` stands for. Default `medium`. */
1314
+ declare function widthForSize(size: WidgetSize | undefined): number;
1315
+ /** The 12-column width of an item: its `width`, else from its size. */
1316
+ declare function itemWidth(item: GridItem): number;
1317
+ /** Whether a grid of `items` should use 12 columns (any item sets `width`). */
1318
+ declare function usesWidthColumns(items: readonly GridItem[]): boolean;
1319
+ /** Whether the widget should take the columns left over in its row. */
1320
+ declare function fillsWidth(fill: WidgetFill | undefined): boolean;
1321
+ /** Whether the widget should stretch to the height of its row. */
1322
+ declare function fillsHeight(fill: WidgetFill | undefined): boolean;
1323
+ /**
1324
+ * Columns a size takes in a grid of `columns` tracks: `large` spans
1325
+ * `largeSpan` (default 2), `full` spans every column, anything else one.
1326
+ */
1327
+ declare function baseColumnSpan(size: WidgetSize | undefined, columns: number, largeSpan?: number): number;
1328
+ /**
1329
+ * Places `items` in a grid of `columns` tracks the way a sparse grid
1330
+ * auto-places them (left to right, wrapping to a new row when an item does
1331
+ * not fit), then gives the columns left over in each row to the items that
1332
+ * `fill` their width, shared evenly (earlier items get the remainder).
1333
+ *
1334
+ * Returns the column span for each width-filling item, keyed by `key`. Items
1335
+ * that do not fill width keep their normal size and are not in the map.
1336
+ */
1337
+ declare function fillColumnSpans(items: readonly GridItem[], columns: number, largeSpan?: number): Map<string, number>;
1338
+ /**
1339
+ * Like `fillColumnSpans` for a 12-column grid: each item starts at its
1340
+ * `width` (see `itemWidth`) and width-fillers share the leftover twelfths.
1341
+ */
1342
+ declare function fillWidthSpans(items: readonly GridItem[]): Map<string, number>;
1343
+ /** One row of a placed grid: the widgets in it and their final column spans. */
1344
+ interface PlacedRow {
1345
+ readonly keys: readonly string[];
1346
+ /** Column spans, in `keys` order, after width-fillers took the leftovers. */
1347
+ readonly spans: readonly number[];
1348
+ }
1349
+ /**
1350
+ * The rows `items` occupy in a 12-column grid, exactly as `fillWidthSpans`
1351
+ * places them: left to right, a widget that doesn't fit in the rest of a row
1352
+ * starts the next row whole (a widget is never split), and width-fillers then
1353
+ * grow into the leftover columns. Growth never changes how many rows there
1354
+ * are.
1355
+ */
1356
+ declare function placeRows(items: readonly GridItem[]): readonly PlacedRow[];
1357
+ /**
1358
+ * How many of `items`, in order, fit in `maxRows` rows of a 12-column grid.
1359
+ * Placement is left to right, so this is the length of the longest prefix
1360
+ * whose rows number at most `maxRows`.
1361
+ */
1362
+ declare function fitCount(items: readonly GridItem[], maxRows: number): number;
1363
+
1293
1364
  /**
1294
1365
  * Pages of widgets: a dashboard split into pages, like the home screens of a
1295
1366
  * phone. Each page is a small layout (order, hidden, minimized) with a name
@@ -1591,4 +1662,4 @@ interface LayoutPersistence {
1591
1662
  */
1592
1663
  declare function createLayoutPersistence(adapter: StorageAdapter, options?: LayoutPersistenceOptions): LayoutPersistence;
1593
1664
 
1594
- export { type DateRangeOption as $, type AlertListWidgetData as A, type BarListWidgetData as B, type CachedPayload as C, type DashboardWidget as D, type ColorOption as E, type ColumnsOption as F, type GraphWidgetData as G, type ConflictPolicy as H, type ConvertViewOptions as I, DATE_RANGE_PRESETS as J, type KpiWidgetData as K, type Locale as L, DEFAULT_COMPARISON_LABEL as M, type NiceDomain as N, type OptionValues as O, type PageItem as P, DEFAULT_CURRENCY as Q, type ResolvedTableControls as R, type StoreScope as S, type TableWidgetData as T, DEFAULT_DETAIL_PAGE_SIZE as U, DEFAULT_EMPTY_TEXT as V, type WidgetSize as W, DEFAULT_MAX_LAYOUT_BYTES as X, DEFAULT_PAGE_KEY as Y, DEFAULT_PAGE_ROWS as Z, DETAIL_MODES as _, type WidgetFill as a, type StoreResult as a$, type DateRangePreset as a0, type DeltaDirection as a1, type DeltaSentiment as a2, type DetailCell as a3, type DetailColumn as a4, type DetailMode as a5, type DetailPage as a6, type DetailProvider as a7, type DetailProviders as a8, EMPTY_LAYOUT as a9, MAX_WIDGET_TITLE_LENGTH as aA, MAX_WIDGET_VIEWS as aB, MAX_WIDGET_WIDTH as aC, MIN_WIDGET_WIDTH as aD, type NormalizeSettingsOptions as aE, type NumberOption as aF, OPTION_KEY_PATTERN as aG, type Ok as aH, type OkWidget as aI, type OptionContext as aJ, type OptionValue as aK, type PageOptions as aL, type PageRoom as aM, type PlacedRow as aN, type ProviderOptions as aO, type ResolvedDetailOptions as aP, type ResolvedWidget as aQ, type ResolvedWidgetLock as aR, type RetryOptions as aS, type SaveOptions as aT, type SavedLayout as aU, type SettingsItem as aV, type SortDirection as aW, type SortOption as aX, type StorageAdapter as aY, type StorageLogEvent as aZ, type StoreErrorCode as a_, type EmptyWidget as aa, type EncodingOptions as ab, type EnforceLocksOptions as ac, type Err as ad, type ErrorWidget as ae, type FormatOptions as af, type GraphPoint as ag, type GraphSeries as ah, type GridItem as ai, type KpiDelta as aj, type KpiDeltaOptions as ak, LAYOUT_ENVELOPE_VERSION as al, type LayoutItem as am, type LayoutPage as an, type LayoutPersistenceOptions as ao, type LayoutSettings as ap, type LoadedLayout as aq, type LoadingWidget as ar, MAX_DETAIL_PAGE_SIZE as as, MAX_GRAPH_SERIES as at, MAX_PAGE_ROWS as au, MAX_PAGE_TITLE_LENGTH as av, MAX_PARSED_PAGES as aw, MAX_PARSED_SETTINGS as ax, MAX_TEXT_OPTION_LENGTH as ay, MAX_WIDGET_OPTIONS as az, type WidgetDefinition as b, isFlexible as b$, type StoredValue as b0, type TableCell as b1, type TableColumn as b2, type TextOption as b3, VALUE_FORMATS as b4, VIEW_CONVERSIONS as b5, type ValueFormat as b6, type ViewConversion as b7, type ViewsItem as b8, WIDGET_FILLS as b9, defaultOptionValue as bA, defineWidget as bB, deriveDetailData as bC, describeUnknownError as bD, effectiveDefinitions as bE, effectiveViewKey as bF, emptyTextFor as bG, emptyWidget as bH, enforceLocks as bI, err as bJ, failedWidget as bK, fillColumnSpans as bL, fillWidthSpans as bM, fillsHeight as bN, fillsWidth as bO, finalizeWidget as bP, findView as bQ, fitCount as bR, formatCount as bS, formatPercentChange as bT, formatValue as bU, hasPages as bV, hasViews as bW, hiddenWidgets as bX, hideWidget as bY, isClientApplied as bZ, isColumnKeyFor as b_, WIDGET_KINDS as ba, WIDGET_OPTION_TYPES as bb, WIDGET_SIZES as bc, WIDTH_COLUMNS as bd, type WidgetCache as be, type WidgetDataOf as bf, type WidgetDetailOptions as bg, type WidgetEmptyState as bh, type WidgetLock as bi, type WidgetOption as bj, type WidgetProvider as bk, type WidgetStatus as bl, type WidgetTableControls as bm, type WidgetView as bn, addPage as bo, applyClientOptions as bp, applySettings as bq, applyView as br, assignPages as bs, baseColumnSpan as bt, cacheKeyFor as bu, clearWidgetSettings as bv, coerceOptionValue as bw, convertView as bx, createLayoutPersistence as by, defaultDetailQuery as bz, type DetailProviderOptions as c, setWidgetSettings as c$, isHidden as c0, isIsoInterval as c1, isMinimized as c2, isOptionsLocked as c3, isTitleInUse as c4, isWidgetEmptyState as c5, isWidgetKind as c6, isWidgetVisibleTo as c7, isWidgetWidth as c8, itemWidth as c9, pageWidgets as cA, parseDetailQuery as cB, parseLayout as cC, parseSettings as cD, parseSortValue as cE, percentChange as cF, placeRows as cG, pruneLayout as cH, queryRows as cI, readOnly as cJ, removePage as cK, renamePage as cL, resolveDateRange as cM, resolveDetailOptions as cN, resolveOptionValues as cO, resolvePageKey as cP, resolvePayload as cQ, resolveTableControls as cR, resolveWidget as cS, resolveWidgetLock as cT, resolveWidgetUnapplied as cU, resolveWidgets as cV, restoreWidget as cW, sameOptionValues as cX, serializeDetailQuery as cY, serializeLayout as cZ, serializeSettings as c_, kindLabel as ca, kpiDelta as cb, labelStride as cc, loadingWidgets as cd, memoryAdapter as ce, minimizeWidget as cf, movePage as cg, moveWidget as ch, moveWidgetBy as ci, moveWidgetDown as cj, moveWidgetToPage as ck, moveWidgetUp as cl, nextPageKey as cm, niceDomain as cn, niceStep as co, normalizeLayout as cp, normalizeSettings as cq, normalizeTitle as cr, ok as cs, optionValuesFor as ct, optionValuesFromLayout as cu, optionsCacheSuffix as cv, pageLayout as cw, pageList as cx, pageOf as cy, pageRoom as cz, type DetailData as d, shareOf as d0, showWidget as d1, sortDefinitions as d2, sortFromOptions as d3, tableDetailData as d4, toggleHidden as d5, toggleMinimized as d6, usesWidthColumns as d7, utf8Length as d8, validateDetailData as d9, viewChoices as da, viewKind as db, viewNote as dc, visibleWidgets as dd, widgetOptionValues as de, widgetsFor as df, widthForSize as dg, widthRange as dh, widthShareLabel as di, withEncoding as dj, withFallback as dk, withLogging as dl, withPageLayout as dm, withPrefix as dn, withReadCache as dp, withRetry as dq, type DetailQuery as e, type DashboardLayout as f, type WidgetViewerSettings as g, type WidgetSettingsPatch as h, type GaugeWidgetData as i, type DetailSort as j, type TextWidgetData as k, type WidgetData as l, type LayoutPersistence as m, type NormalizeOptions as n, type ResolveOptions as o, type WidgetContext as p, type WidgetProviders as q, type Result as r, type WidgetKind as s, type WidgetPayload as t, type AddPageOptions as u, type AlertListItem as v, BASE_VIEW_KEY as w, type BarListItem as x, type BooleanOption as y, type ChoiceOption as z };
1665
+ export { DEFAULT_MAX_LAYOUT_BYTES as $, type AlertListWidgetData as A, type BarListWidgetData as B, type CloneOptions as C, type DashboardWidget as D, type BooleanOption as E, type CachedPayload as F, type GraphWidgetData as G, type ChoiceOption as H, type CloneItem as I, type ColorOption as J, type KpiWidgetData as K, type Locale as L, type ColumnsOption as M, type NiceDomain as N, type OptionValues as O, type PageItem as P, type ConflictPolicy as Q, type ResolvedTableControls as R, type StoreScope as S, type TableWidgetData as T, type ConvertViewOptions as U, DATE_RANGE_PRESETS as V, type WidgetSize as W, DEFAULT_COMPARISON_LABEL as X, DEFAULT_CURRENCY as Y, DEFAULT_DETAIL_PAGE_SIZE as Z, DEFAULT_EMPTY_TEXT as _, type WidgetFill as a, type SortOption as a$, DEFAULT_PAGE_KEY as a0, DEFAULT_PAGE_ROWS as a1, DETAIL_MODES as a2, type DateRangeOption as a3, type DateRangePreset as a4, type DeltaDirection as a5, type DeltaSentiment as a6, type DetailCell as a7, type DetailColumn as a8, type DetailMode as a9, MAX_PARSED_CLONES as aA, MAX_PARSED_PAGES as aB, MAX_PARSED_SETTINGS as aC, MAX_TEXT_OPTION_LENGTH as aD, MAX_WIDGET_OPTIONS as aE, MAX_WIDGET_TITLE_LENGTH as aF, MAX_WIDGET_VIEWS as aG, MAX_WIDGET_WIDTH as aH, MIN_WIDGET_WIDTH as aI, type NormalizeSettingsOptions as aJ, type NumberOption as aK, OPTION_KEY_PATTERN as aL, type Ok as aM, type OkWidget as aN, type OptionContext as aO, type OptionValue as aP, type PageRoom as aQ, type PlacedRow as aR, type ProviderOptions as aS, type ResolvedDetailOptions as aT, type ResolvedWidget as aU, type ResolvedWidgetLock as aV, type RetryOptions as aW, type SaveOptions as aX, type SavedLayout as aY, type SettingsItem as aZ, type SortDirection as a_, type DetailPage as aa, type DetailProvider as ab, type DetailProviders as ac, EMPTY_LAYOUT as ad, type EmptyWidget as ae, type EncodingOptions as af, type EnforceLocksOptions as ag, type Err as ah, type ErrorWidget as ai, type FormatOptions as aj, type GraphPoint as ak, type GraphSeries as al, type GridItem as am, type KpiDelta as an, type KpiDeltaOptions as ao, LAYOUT_ENVELOPE_VERSION as ap, type LayoutItem as aq, type LayoutPage as ar, type LayoutPersistenceOptions as as, type LayoutSettings as at, type LoadedLayout as au, type LoadingWidget as av, MAX_DETAIL_PAGE_SIZE as aw, MAX_GRAPH_SERIES as ax, MAX_PAGE_ROWS as ay, MAX_PAGE_TITLE_LENGTH as az, type WidgetDefinition as b, hasPages as b$, type StorageAdapter as b0, type StorageLogEvent as b1, type StoreErrorCode as b2, type StoreResult as b3, type StoredValue as b4, type TableCell as b5, type TableColumn as b6, type TextOption as b7, VALUE_FORMATS as b8, VIEW_CONVERSIONS as b9, clearWidgetSettings as bA, cloneNumber as bB, coerceOptionValue as bC, convertView as bD, createLayoutPersistence as bE, defaultDetailQuery as bF, defaultOptionValue as bG, defineWidget as bH, deriveDetailData as bI, describeUnknownError as bJ, effectiveDefinitions as bK, effectiveViewKey as bL, emptyTextFor as bM, emptyWidget as bN, enforceLocks as bO, err as bP, failedWidget as bQ, fillColumnSpans as bR, fillWidthSpans as bS, fillsHeight as bT, fillsWidth as bU, finalizeWidget as bV, findView as bW, fitCount as bX, formatCount as bY, formatPercentChange as bZ, formatValue as b_, type ValueFormat as ba, type ViewConversion as bb, type ViewsItem as bc, WIDGET_FILLS as bd, WIDGET_KINDS as be, WIDGET_OPTION_TYPES as bf, WIDGET_SIZES as bg, WIDTH_COLUMNS as bh, type WidgetCache as bi, type WidgetDataOf as bj, type WidgetDetailOptions as bk, type WidgetEmptyState as bl, type WidgetLock as bm, type WidgetOption as bn, type WidgetProvider as bo, type WidgetStatus as bp, type WidgetTableControls as bq, type WidgetView as br, addPage as bs, applyClientOptions as bt, applySettings as bu, applyView as bv, assignPages as bw, baseColumnSpan as bx, cacheKeyFor as by, cleanClones as bz, type DetailProviderOptions as c, resolveWidgetUnapplied as c$, hasViews as c0, hiddenWidgets as c1, hideWidget as c2, isClientApplied as c3, isColumnKeyFor as c4, isFlexible as c5, isHidden as c6, isIsoInterval as c7, isMinimized as c8, isOptionsLocked as c9, optionValuesFromLayout as cA, optionsCacheSuffix as cB, pageLayout as cC, pageList as cD, pageOf as cE, pageRoom as cF, pageWidgets as cG, parseClones as cH, parseDetailQuery as cI, parseLayout as cJ, parseSettings as cK, parseSortValue as cL, percentChange as cM, placeRows as cN, pruneLayout as cO, queryRows as cP, readOnly as cQ, removePage as cR, renamePage as cS, resolveDateRange as cT, resolveDetailOptions as cU, resolveOptionValues as cV, resolvePageKey as cW, resolvePayload as cX, resolveTableControls as cY, resolveWidget as cZ, resolveWidgetLock as c_, isTitleInUse as ca, isWidgetEmptyState as cb, isWidgetKind as cc, isWidgetVisibleTo as cd, isWidgetWidth as ce, itemWidth as cf, kindLabel as cg, kpiDelta as ch, labelStride as ci, loadingWidgets as cj, memoryAdapter as ck, minimizeWidget as cl, movePage as cm, moveWidget as cn, moveWidgetBy as co, moveWidgetDown as cp, moveWidgetToPage as cq, moveWidgetUp as cr, nextPageKey as cs, niceDomain as ct, niceStep as cu, normalizeLayout as cv, normalizeSettings as cw, normalizeTitle as cx, ok as cy, optionValuesFor as cz, type DetailData as d, resolveWidgets as d0, restoreWidget as d1, sameOptionValues as d2, serializeClones as d3, serializeDetailQuery as d4, serializeLayout as d5, serializeSettings as d6, setWidgetSettings as d7, shareOf as d8, showWidget as d9, sortDefinitions as da, sortFromOptions as db, tableDetailData as dc, toggleHidden as dd, toggleMinimized as de, usesWidthColumns as df, utf8Length as dg, validateDetailData as dh, viewChoices as di, viewKind as dj, viewNote as dk, visibleWidgets as dl, widgetOptionValues as dm, widgetsFor as dn, widthForSize as dp, widthRange as dq, widthShareLabel as dr, withClones as ds, withEncoding as dt, withFallback as du, withLogging as dv, withPageLayout as dw, withPrefix as dx, withReadCache as dy, withRetry as dz, type DetailQuery as e, type DashboardLayout as f, type WidgetViewerSettings as g, type WidgetSettingsPatch as h, type GaugeWidgetData as i, type DetailSort as j, type TextWidgetData as k, type WidgetData as l, type LayoutPersistence as m, type NormalizeOptions as n, type ResolveOptions as o, type WidgetContext as p, type WidgetProviders as q, type PageOptions as r, type Result as s, type WidgetClone as t, type WidgetKind as u, type WidgetPayload as v, type AddPageOptions as w, type AlertListItem as x, BASE_VIEW_KEY as y, type BarListItem as z };
@@ -931,6 +931,11 @@ interface WidgetDefinition {
931
931
  readonly defaultView?: string;
932
932
  /** What the base view is called in the View field. Default: its kind's name. */
933
933
  readonly baseViewLabel?: string;
934
+ /**
935
+ * Set on a clone (see `clones.ts`): the key of the widget it copies. Its
936
+ * data comes from that widget's provider. Authors never set it.
937
+ */
938
+ readonly sourceKey?: string;
934
939
  }
935
940
  /** What a viewer may not do to a locked widget. */
936
941
  interface WidgetLock {
@@ -942,6 +947,8 @@ interface WidgetLock {
942
947
  readonly minimize?: boolean;
943
948
  /** Can't be given a title, width or option values of the viewer's own. */
944
949
  readonly options?: boolean;
950
+ /** Can't be duplicated into a clone. */
951
+ readonly clone?: boolean;
945
952
  }
946
953
  /** `WidgetLock` with every default filled in. */
947
954
  type ResolvedWidgetLock = Required<WidgetLock>;
@@ -961,70 +968,63 @@ declare function sortDefinitions<D extends WidgetDefinition>(definitions: readon
961
968
  /** Whether a widget is active and visible to someone with these roles. */
962
969
  declare function isWidgetVisibleTo(definition: WidgetDefinition, roles: readonly string[] | undefined): boolean;
963
970
 
964
- /** The parts of a widget definition that decide its place in a grid. */
965
- interface GridItem {
971
+ /**
972
+ * Clones: copies of a widget a viewer made to keep it twice with different
973
+ * settings (another view, width or option values). A clone is stored as
974
+ * `{ key, from }` in `layout.clones`, its settings under its own key in
975
+ * `layout.settings`, and it shares the original's provider. Pure functions,
976
+ * no I/O.
977
+ */
978
+
979
+ /** A widget the viewer made from another. */
980
+ interface WidgetClone {
981
+ /** Unique across definitions and clones: `from#1`, `from#2`, ... */
966
982
  readonly key: string;
967
- readonly defaultSize?: WidgetSize;
968
- readonly fill?: WidgetFill;
969
- readonly width?: number;
983
+ /** The original's key. Always an original, never another clone. */
984
+ readonly from: string;
970
985
  }
971
- /** Columns in a grid that uses widget `width`. */
972
- declare const WIDTH_COLUMNS = 12;
973
- /** Smallest and largest `width`, in twelfths of a row. */
974
- declare const MIN_WIDGET_WIDTH = 2;
975
- declare const MAX_WIDGET_WIDTH = 12;
976
- /** Whether `value` is a valid widget `width`: an integer from 2 to 12. */
977
- declare function isWidgetWidth(value: unknown): value is number;
978
- /** The width (in twelfths) a `defaultSize` stands for. Default `medium`. */
979
- declare function widthForSize(size: WidgetSize | undefined): number;
980
- /** The 12-column width of an item: its `width`, else from its size. */
981
- declare function itemWidth(item: GridItem): number;
982
- /** Whether a grid of `items` should use 12 columns (any item sets `width`). */
983
- declare function usesWidthColumns(items: readonly GridItem[]): boolean;
984
- /** Whether the widget should take the columns left over in its row. */
985
- declare function fillsWidth(fill: WidgetFill | undefined): boolean;
986
- /** Whether the widget should stretch to the height of its row. */
987
- declare function fillsHeight(fill: WidgetFill | undefined): boolean;
988
986
  /**
989
- * Columns a size takes in a grid of `columns` tracks: `large` spans
990
- * `largeSpan` (default 2), `full` spans every column, anything else one.
987
+ * Most clones `parseLayout` keeps: a safety ceiling against malformed or
988
+ * hostile JSON, not a product limit (a page's capacity is the real limit).
991
989
  */
992
- declare function baseColumnSpan(size: WidgetSize | undefined, columns: number, largeSpan?: number): number;
993
- /**
994
- * Places `items` in a grid of `columns` tracks the way a sparse grid
995
- * auto-places them (left to right, wrapping to a new row when an item does
996
- * not fit), then gives the columns left over in each row to the items that
997
- * `fill` their width, shared evenly (earlier items get the remainder).
998
- *
999
- * Returns the column span for each width-filling item, keyed by `key`. Items
1000
- * that do not fill width keep their normal size and are not in the map.
1001
- */
1002
- declare function fillColumnSpans(items: readonly GridItem[], columns: number, largeSpan?: number): Map<string, number>;
990
+ declare const MAX_PARSED_CLONES = 500;
991
+ /** What these functions need from a definition. */
992
+ type CloneItem = Pick<WidgetDefinition, 'key'> & Partial<Pick<WidgetDefinition, 'title' | 'locked' | 'sourceKey'>>;
993
+ /** Options for the clone functions. */
994
+ interface CloneOptions {
995
+ /** Keep clones that a widget's `locked.clone` forbids (an administrator). */
996
+ readonly overrideLocks?: boolean;
997
+ }
1003
998
  /**
1004
- * Like `fillColumnSpans` for a 12-column grid: each item starts at its
1005
- * `width` (see `itemWidth`) and width-fillers share the leftover twelfths.
999
+ * Reads the `clones` field of a saved layout. Anything malformed is dropped
1000
+ * (wrong types, empty or repeated keys, a clone of itself). Returns undefined
1001
+ * when nothing usable is left.
1006
1002
  */
1007
- declare function fillWidthSpans(items: readonly GridItem[]): Map<string, number>;
1008
- /** One row of a placed grid: the widgets in it and their final column spans. */
1009
- interface PlacedRow {
1010
- readonly keys: readonly string[];
1011
- /** Column spans, in `keys` order, after width-fillers took the leftovers. */
1012
- readonly spans: readonly number[];
1013
- }
1003
+ declare function parseClones(raw: unknown): readonly WidgetClone[] | undefined;
1004
+ /** The JSON-ready form of `layout.clones`; undefined when there are none. */
1005
+ declare function serializeClones(clones: readonly WidgetClone[] | undefined): WidgetClone[] | undefined;
1006
+ /** The number in a clone key (`orders#3` is 3), or undefined. */
1007
+ declare function cloneNumber(key: string): number | undefined;
1014
1008
  /**
1015
- * The rows `items` occupy in a 12-column grid, exactly as `fillWidthSpans`
1016
- * places them: left to right, a widget that doesn't fit in the rest of a row
1017
- * starts the next row whole (a widget is never split), and width-fillers then
1018
- * grow into the leftover columns. Growth never changes how many rows there
1019
- * are.
1009
+ * The clones that can exist for these definitions: the original is a real
1010
+ * widget (not itself a clone), the key doesn't shadow another widget, and the
1011
+ * original's `locked.clone` allows it. Returns the same array when nothing is
1012
+ * dropped. Clones already present as definitions (see `withClones`) count as
1013
+ * valid, so the function is idempotent.
1020
1014
  */
1021
- declare function placeRows(items: readonly GridItem[]): readonly PlacedRow[];
1015
+ declare function cleanClones<D extends CloneItem>(definitions: readonly D[], clones: readonly WidgetClone[] | undefined, options?: CloneOptions): readonly WidgetClone[] | undefined;
1022
1016
  /**
1023
- * How many of `items`, in order, fit in `maxRows` rows of a 12-column grid.
1024
- * Placement is left to right, so this is the length of the longest prefix
1025
- * whose rows number at most `maxRows`.
1017
+ * The definitions with each clone added right after its original. A clone's
1018
+ * definition copies the original's, with its own key, `sourceKey` set to the
1019
+ * original, the title "Original (#n)" and no locks (a clone is the viewer's
1020
+ * to move, hide and delete). Settings still apply on top (`effectiveDefinitions`).
1021
+ * Pass the result to `useWidgets` so clones load, and to the settings and
1022
+ * layout functions. Idempotent; returns the same array when there are no
1023
+ * clones to add.
1026
1024
  */
1027
- declare function fitCount(items: readonly GridItem[], maxRows: number): number;
1025
+ declare function withClones<D extends CloneItem>(definitions: readonly D[], layout: {
1026
+ readonly clones?: readonly WidgetClone[];
1027
+ }, options?: CloneOptions): readonly D[];
1028
1028
 
1029
1029
  /**
1030
1030
  * A viewer's own choices for a widget: a title, a width and values for the
@@ -1192,6 +1192,12 @@ interface DashboardLayout {
1192
1192
  * widget key. See `settings.ts`. Absent when they chose nothing.
1193
1193
  */
1194
1194
  readonly settings?: LayoutSettings;
1195
+ /**
1196
+ * Widgets the viewer made from others, as `{ key, from }`. Their settings
1197
+ * live in `settings` under their own key. See `clones.ts`. Absent when
1198
+ * there are none.
1199
+ */
1200
+ readonly clones?: readonly WidgetClone[];
1195
1201
  }
1196
1202
  /** One page of a paged layout: the same lists as a layout, plus a name. */
1197
1203
  interface LayoutPage {
@@ -1290,6 +1296,71 @@ interface EnforceLocksOptions {
1290
1296
  */
1291
1297
  declare function enforceLocks<T extends LayoutItem>(definitions: readonly T[], layout: DashboardLayout, options?: EnforceLocksOptions): DashboardLayout;
1292
1298
 
1299
+ /** The parts of a widget definition that decide its place in a grid. */
1300
+ interface GridItem {
1301
+ readonly key: string;
1302
+ readonly defaultSize?: WidgetSize;
1303
+ readonly fill?: WidgetFill;
1304
+ readonly width?: number;
1305
+ }
1306
+ /** Columns in a grid that uses widget `width`. */
1307
+ declare const WIDTH_COLUMNS = 12;
1308
+ /** Smallest and largest `width`, in twelfths of a row. */
1309
+ declare const MIN_WIDGET_WIDTH = 2;
1310
+ declare const MAX_WIDGET_WIDTH = 12;
1311
+ /** Whether `value` is a valid widget `width`: an integer from 2 to 12. */
1312
+ declare function isWidgetWidth(value: unknown): value is number;
1313
+ /** The width (in twelfths) a `defaultSize` stands for. Default `medium`. */
1314
+ declare function widthForSize(size: WidgetSize | undefined): number;
1315
+ /** The 12-column width of an item: its `width`, else from its size. */
1316
+ declare function itemWidth(item: GridItem): number;
1317
+ /** Whether a grid of `items` should use 12 columns (any item sets `width`). */
1318
+ declare function usesWidthColumns(items: readonly GridItem[]): boolean;
1319
+ /** Whether the widget should take the columns left over in its row. */
1320
+ declare function fillsWidth(fill: WidgetFill | undefined): boolean;
1321
+ /** Whether the widget should stretch to the height of its row. */
1322
+ declare function fillsHeight(fill: WidgetFill | undefined): boolean;
1323
+ /**
1324
+ * Columns a size takes in a grid of `columns` tracks: `large` spans
1325
+ * `largeSpan` (default 2), `full` spans every column, anything else one.
1326
+ */
1327
+ declare function baseColumnSpan(size: WidgetSize | undefined, columns: number, largeSpan?: number): number;
1328
+ /**
1329
+ * Places `items` in a grid of `columns` tracks the way a sparse grid
1330
+ * auto-places them (left to right, wrapping to a new row when an item does
1331
+ * not fit), then gives the columns left over in each row to the items that
1332
+ * `fill` their width, shared evenly (earlier items get the remainder).
1333
+ *
1334
+ * Returns the column span for each width-filling item, keyed by `key`. Items
1335
+ * that do not fill width keep their normal size and are not in the map.
1336
+ */
1337
+ declare function fillColumnSpans(items: readonly GridItem[], columns: number, largeSpan?: number): Map<string, number>;
1338
+ /**
1339
+ * Like `fillColumnSpans` for a 12-column grid: each item starts at its
1340
+ * `width` (see `itemWidth`) and width-fillers share the leftover twelfths.
1341
+ */
1342
+ declare function fillWidthSpans(items: readonly GridItem[]): Map<string, number>;
1343
+ /** One row of a placed grid: the widgets in it and their final column spans. */
1344
+ interface PlacedRow {
1345
+ readonly keys: readonly string[];
1346
+ /** Column spans, in `keys` order, after width-fillers took the leftovers. */
1347
+ readonly spans: readonly number[];
1348
+ }
1349
+ /**
1350
+ * The rows `items` occupy in a 12-column grid, exactly as `fillWidthSpans`
1351
+ * places them: left to right, a widget that doesn't fit in the rest of a row
1352
+ * starts the next row whole (a widget is never split), and width-fillers then
1353
+ * grow into the leftover columns. Growth never changes how many rows there
1354
+ * are.
1355
+ */
1356
+ declare function placeRows(items: readonly GridItem[]): readonly PlacedRow[];
1357
+ /**
1358
+ * How many of `items`, in order, fit in `maxRows` rows of a 12-column grid.
1359
+ * Placement is left to right, so this is the length of the longest prefix
1360
+ * whose rows number at most `maxRows`.
1361
+ */
1362
+ declare function fitCount(items: readonly GridItem[], maxRows: number): number;
1363
+
1293
1364
  /**
1294
1365
  * Pages of widgets: a dashboard split into pages, like the home screens of a
1295
1366
  * phone. Each page is a small layout (order, hidden, minimized) with a name
@@ -1591,4 +1662,4 @@ interface LayoutPersistence {
1591
1662
  */
1592
1663
  declare function createLayoutPersistence(adapter: StorageAdapter, options?: LayoutPersistenceOptions): LayoutPersistence;
1593
1664
 
1594
- export { type DateRangeOption as $, type AlertListWidgetData as A, type BarListWidgetData as B, type CachedPayload as C, type DashboardWidget as D, type ColorOption as E, type ColumnsOption as F, type GraphWidgetData as G, type ConflictPolicy as H, type ConvertViewOptions as I, DATE_RANGE_PRESETS as J, type KpiWidgetData as K, type Locale as L, DEFAULT_COMPARISON_LABEL as M, type NiceDomain as N, type OptionValues as O, type PageItem as P, DEFAULT_CURRENCY as Q, type ResolvedTableControls as R, type StoreScope as S, type TableWidgetData as T, DEFAULT_DETAIL_PAGE_SIZE as U, DEFAULT_EMPTY_TEXT as V, type WidgetSize as W, DEFAULT_MAX_LAYOUT_BYTES as X, DEFAULT_PAGE_KEY as Y, DEFAULT_PAGE_ROWS as Z, DETAIL_MODES as _, type WidgetFill as a, type StoreResult as a$, type DateRangePreset as a0, type DeltaDirection as a1, type DeltaSentiment as a2, type DetailCell as a3, type DetailColumn as a4, type DetailMode as a5, type DetailPage as a6, type DetailProvider as a7, type DetailProviders as a8, EMPTY_LAYOUT as a9, MAX_WIDGET_TITLE_LENGTH as aA, MAX_WIDGET_VIEWS as aB, MAX_WIDGET_WIDTH as aC, MIN_WIDGET_WIDTH as aD, type NormalizeSettingsOptions as aE, type NumberOption as aF, OPTION_KEY_PATTERN as aG, type Ok as aH, type OkWidget as aI, type OptionContext as aJ, type OptionValue as aK, type PageOptions as aL, type PageRoom as aM, type PlacedRow as aN, type ProviderOptions as aO, type ResolvedDetailOptions as aP, type ResolvedWidget as aQ, type ResolvedWidgetLock as aR, type RetryOptions as aS, type SaveOptions as aT, type SavedLayout as aU, type SettingsItem as aV, type SortDirection as aW, type SortOption as aX, type StorageAdapter as aY, type StorageLogEvent as aZ, type StoreErrorCode as a_, type EmptyWidget as aa, type EncodingOptions as ab, type EnforceLocksOptions as ac, type Err as ad, type ErrorWidget as ae, type FormatOptions as af, type GraphPoint as ag, type GraphSeries as ah, type GridItem as ai, type KpiDelta as aj, type KpiDeltaOptions as ak, LAYOUT_ENVELOPE_VERSION as al, type LayoutItem as am, type LayoutPage as an, type LayoutPersistenceOptions as ao, type LayoutSettings as ap, type LoadedLayout as aq, type LoadingWidget as ar, MAX_DETAIL_PAGE_SIZE as as, MAX_GRAPH_SERIES as at, MAX_PAGE_ROWS as au, MAX_PAGE_TITLE_LENGTH as av, MAX_PARSED_PAGES as aw, MAX_PARSED_SETTINGS as ax, MAX_TEXT_OPTION_LENGTH as ay, MAX_WIDGET_OPTIONS as az, type WidgetDefinition as b, isFlexible as b$, type StoredValue as b0, type TableCell as b1, type TableColumn as b2, type TextOption as b3, VALUE_FORMATS as b4, VIEW_CONVERSIONS as b5, type ValueFormat as b6, type ViewConversion as b7, type ViewsItem as b8, WIDGET_FILLS as b9, defaultOptionValue as bA, defineWidget as bB, deriveDetailData as bC, describeUnknownError as bD, effectiveDefinitions as bE, effectiveViewKey as bF, emptyTextFor as bG, emptyWidget as bH, enforceLocks as bI, err as bJ, failedWidget as bK, fillColumnSpans as bL, fillWidthSpans as bM, fillsHeight as bN, fillsWidth as bO, finalizeWidget as bP, findView as bQ, fitCount as bR, formatCount as bS, formatPercentChange as bT, formatValue as bU, hasPages as bV, hasViews as bW, hiddenWidgets as bX, hideWidget as bY, isClientApplied as bZ, isColumnKeyFor as b_, WIDGET_KINDS as ba, WIDGET_OPTION_TYPES as bb, WIDGET_SIZES as bc, WIDTH_COLUMNS as bd, type WidgetCache as be, type WidgetDataOf as bf, type WidgetDetailOptions as bg, type WidgetEmptyState as bh, type WidgetLock as bi, type WidgetOption as bj, type WidgetProvider as bk, type WidgetStatus as bl, type WidgetTableControls as bm, type WidgetView as bn, addPage as bo, applyClientOptions as bp, applySettings as bq, applyView as br, assignPages as bs, baseColumnSpan as bt, cacheKeyFor as bu, clearWidgetSettings as bv, coerceOptionValue as bw, convertView as bx, createLayoutPersistence as by, defaultDetailQuery as bz, type DetailProviderOptions as c, setWidgetSettings as c$, isHidden as c0, isIsoInterval as c1, isMinimized as c2, isOptionsLocked as c3, isTitleInUse as c4, isWidgetEmptyState as c5, isWidgetKind as c6, isWidgetVisibleTo as c7, isWidgetWidth as c8, itemWidth as c9, pageWidgets as cA, parseDetailQuery as cB, parseLayout as cC, parseSettings as cD, parseSortValue as cE, percentChange as cF, placeRows as cG, pruneLayout as cH, queryRows as cI, readOnly as cJ, removePage as cK, renamePage as cL, resolveDateRange as cM, resolveDetailOptions as cN, resolveOptionValues as cO, resolvePageKey as cP, resolvePayload as cQ, resolveTableControls as cR, resolveWidget as cS, resolveWidgetLock as cT, resolveWidgetUnapplied as cU, resolveWidgets as cV, restoreWidget as cW, sameOptionValues as cX, serializeDetailQuery as cY, serializeLayout as cZ, serializeSettings as c_, kindLabel as ca, kpiDelta as cb, labelStride as cc, loadingWidgets as cd, memoryAdapter as ce, minimizeWidget as cf, movePage as cg, moveWidget as ch, moveWidgetBy as ci, moveWidgetDown as cj, moveWidgetToPage as ck, moveWidgetUp as cl, nextPageKey as cm, niceDomain as cn, niceStep as co, normalizeLayout as cp, normalizeSettings as cq, normalizeTitle as cr, ok as cs, optionValuesFor as ct, optionValuesFromLayout as cu, optionsCacheSuffix as cv, pageLayout as cw, pageList as cx, pageOf as cy, pageRoom as cz, type DetailData as d, shareOf as d0, showWidget as d1, sortDefinitions as d2, sortFromOptions as d3, tableDetailData as d4, toggleHidden as d5, toggleMinimized as d6, usesWidthColumns as d7, utf8Length as d8, validateDetailData as d9, viewChoices as da, viewKind as db, viewNote as dc, visibleWidgets as dd, widgetOptionValues as de, widgetsFor as df, widthForSize as dg, widthRange as dh, widthShareLabel as di, withEncoding as dj, withFallback as dk, withLogging as dl, withPageLayout as dm, withPrefix as dn, withReadCache as dp, withRetry as dq, type DetailQuery as e, type DashboardLayout as f, type WidgetViewerSettings as g, type WidgetSettingsPatch as h, type GaugeWidgetData as i, type DetailSort as j, type TextWidgetData as k, type WidgetData as l, type LayoutPersistence as m, type NormalizeOptions as n, type ResolveOptions as o, type WidgetContext as p, type WidgetProviders as q, type Result as r, type WidgetKind as s, type WidgetPayload as t, type AddPageOptions as u, type AlertListItem as v, BASE_VIEW_KEY as w, type BarListItem as x, type BooleanOption as y, type ChoiceOption as z };
1665
+ export { DEFAULT_MAX_LAYOUT_BYTES as $, type AlertListWidgetData as A, type BarListWidgetData as B, type CloneOptions as C, type DashboardWidget as D, type BooleanOption as E, type CachedPayload as F, type GraphWidgetData as G, type ChoiceOption as H, type CloneItem as I, type ColorOption as J, type KpiWidgetData as K, type Locale as L, type ColumnsOption as M, type NiceDomain as N, type OptionValues as O, type PageItem as P, type ConflictPolicy as Q, type ResolvedTableControls as R, type StoreScope as S, type TableWidgetData as T, type ConvertViewOptions as U, DATE_RANGE_PRESETS as V, type WidgetSize as W, DEFAULT_COMPARISON_LABEL as X, DEFAULT_CURRENCY as Y, DEFAULT_DETAIL_PAGE_SIZE as Z, DEFAULT_EMPTY_TEXT as _, type WidgetFill as a, type SortOption as a$, DEFAULT_PAGE_KEY as a0, DEFAULT_PAGE_ROWS as a1, DETAIL_MODES as a2, type DateRangeOption as a3, type DateRangePreset as a4, type DeltaDirection as a5, type DeltaSentiment as a6, type DetailCell as a7, type DetailColumn as a8, type DetailMode as a9, MAX_PARSED_CLONES as aA, MAX_PARSED_PAGES as aB, MAX_PARSED_SETTINGS as aC, MAX_TEXT_OPTION_LENGTH as aD, MAX_WIDGET_OPTIONS as aE, MAX_WIDGET_TITLE_LENGTH as aF, MAX_WIDGET_VIEWS as aG, MAX_WIDGET_WIDTH as aH, MIN_WIDGET_WIDTH as aI, type NormalizeSettingsOptions as aJ, type NumberOption as aK, OPTION_KEY_PATTERN as aL, type Ok as aM, type OkWidget as aN, type OptionContext as aO, type OptionValue as aP, type PageRoom as aQ, type PlacedRow as aR, type ProviderOptions as aS, type ResolvedDetailOptions as aT, type ResolvedWidget as aU, type ResolvedWidgetLock as aV, type RetryOptions as aW, type SaveOptions as aX, type SavedLayout as aY, type SettingsItem as aZ, type SortDirection as a_, type DetailPage as aa, type DetailProvider as ab, type DetailProviders as ac, EMPTY_LAYOUT as ad, type EmptyWidget as ae, type EncodingOptions as af, type EnforceLocksOptions as ag, type Err as ah, type ErrorWidget as ai, type FormatOptions as aj, type GraphPoint as ak, type GraphSeries as al, type GridItem as am, type KpiDelta as an, type KpiDeltaOptions as ao, LAYOUT_ENVELOPE_VERSION as ap, type LayoutItem as aq, type LayoutPage as ar, type LayoutPersistenceOptions as as, type LayoutSettings as at, type LoadedLayout as au, type LoadingWidget as av, MAX_DETAIL_PAGE_SIZE as aw, MAX_GRAPH_SERIES as ax, MAX_PAGE_ROWS as ay, MAX_PAGE_TITLE_LENGTH as az, type WidgetDefinition as b, hasPages as b$, type StorageAdapter as b0, type StorageLogEvent as b1, type StoreErrorCode as b2, type StoreResult as b3, type StoredValue as b4, type TableCell as b5, type TableColumn as b6, type TextOption as b7, VALUE_FORMATS as b8, VIEW_CONVERSIONS as b9, clearWidgetSettings as bA, cloneNumber as bB, coerceOptionValue as bC, convertView as bD, createLayoutPersistence as bE, defaultDetailQuery as bF, defaultOptionValue as bG, defineWidget as bH, deriveDetailData as bI, describeUnknownError as bJ, effectiveDefinitions as bK, effectiveViewKey as bL, emptyTextFor as bM, emptyWidget as bN, enforceLocks as bO, err as bP, failedWidget as bQ, fillColumnSpans as bR, fillWidthSpans as bS, fillsHeight as bT, fillsWidth as bU, finalizeWidget as bV, findView as bW, fitCount as bX, formatCount as bY, formatPercentChange as bZ, formatValue as b_, type ValueFormat as ba, type ViewConversion as bb, type ViewsItem as bc, WIDGET_FILLS as bd, WIDGET_KINDS as be, WIDGET_OPTION_TYPES as bf, WIDGET_SIZES as bg, WIDTH_COLUMNS as bh, type WidgetCache as bi, type WidgetDataOf as bj, type WidgetDetailOptions as bk, type WidgetEmptyState as bl, type WidgetLock as bm, type WidgetOption as bn, type WidgetProvider as bo, type WidgetStatus as bp, type WidgetTableControls as bq, type WidgetView as br, addPage as bs, applyClientOptions as bt, applySettings as bu, applyView as bv, assignPages as bw, baseColumnSpan as bx, cacheKeyFor as by, cleanClones as bz, type DetailProviderOptions as c, resolveWidgetUnapplied as c$, hasViews as c0, hiddenWidgets as c1, hideWidget as c2, isClientApplied as c3, isColumnKeyFor as c4, isFlexible as c5, isHidden as c6, isIsoInterval as c7, isMinimized as c8, isOptionsLocked as c9, optionValuesFromLayout as cA, optionsCacheSuffix as cB, pageLayout as cC, pageList as cD, pageOf as cE, pageRoom as cF, pageWidgets as cG, parseClones as cH, parseDetailQuery as cI, parseLayout as cJ, parseSettings as cK, parseSortValue as cL, percentChange as cM, placeRows as cN, pruneLayout as cO, queryRows as cP, readOnly as cQ, removePage as cR, renamePage as cS, resolveDateRange as cT, resolveDetailOptions as cU, resolveOptionValues as cV, resolvePageKey as cW, resolvePayload as cX, resolveTableControls as cY, resolveWidget as cZ, resolveWidgetLock as c_, isTitleInUse as ca, isWidgetEmptyState as cb, isWidgetKind as cc, isWidgetVisibleTo as cd, isWidgetWidth as ce, itemWidth as cf, kindLabel as cg, kpiDelta as ch, labelStride as ci, loadingWidgets as cj, memoryAdapter as ck, minimizeWidget as cl, movePage as cm, moveWidget as cn, moveWidgetBy as co, moveWidgetDown as cp, moveWidgetToPage as cq, moveWidgetUp as cr, nextPageKey as cs, niceDomain as ct, niceStep as cu, normalizeLayout as cv, normalizeSettings as cw, normalizeTitle as cx, ok as cy, optionValuesFor as cz, type DetailData as d, resolveWidgets as d0, restoreWidget as d1, sameOptionValues as d2, serializeClones as d3, serializeDetailQuery as d4, serializeLayout as d5, serializeSettings as d6, setWidgetSettings as d7, shareOf as d8, showWidget as d9, sortDefinitions as da, sortFromOptions as db, tableDetailData as dc, toggleHidden as dd, toggleMinimized as de, usesWidthColumns as df, utf8Length as dg, validateDetailData as dh, viewChoices as di, viewKind as dj, viewNote as dk, visibleWidgets as dl, widgetOptionValues as dm, widgetsFor as dn, widthForSize as dp, widthRange as dq, widthShareLabel as dr, withClones as ds, withEncoding as dt, withFallback as du, withLogging as dv, withPageLayout as dw, withPrefix as dx, withReadCache as dy, withRetry as dz, type DetailQuery as e, type DashboardLayout as f, type WidgetViewerSettings as g, type WidgetSettingsPatch as h, type GaugeWidgetData as i, type DetailSort as j, type TextWidgetData as k, type WidgetData as l, type LayoutPersistence as m, type NormalizeOptions as n, type ResolveOptions as o, type WidgetContext as p, type WidgetProviders as q, type PageOptions as r, type Result as s, type WidgetClone as t, type WidgetKind as u, type WidgetPayload as v, type AddPageOptions as w, type AlertListItem as x, BASE_VIEW_KEY as y, type BarListItem as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@richardmcquiston01/dashboard-widgets-toolkit",
3
- "version": "0.15.0",
3
+ "version": "0.16.0",
4
4
  "description": "Framework-agnostic dashboard widget toolkit: typed widget definitions and data payloads (KPI, gauge, table, bar list, alert list, chart), user layout (order, hide, minimise), and React renderers. Bring your own data providers.",
5
5
  "keywords": [
6
6
  "dashboard",