@crystaldesign/diva-backoffice 26.11.0-beta.13 → 26.11.0-beta.14

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/esm/index.js +1734 -494
  2. package/build/types/backoffice/src/tests/unit/ui/IDMCatalogEditor/api/goodsGroups.test.d.ts +2 -0
  3. package/build/types/backoffice/src/tests/unit/ui/IDMCatalogEditor/api/goodsGroups.test.d.ts.map +1 -0
  4. package/build/types/backoffice/src/tests/unit/ui/IDMCatalogEditor/hooks/useGoodsGroupRun.test.d.ts +2 -0
  5. package/build/types/backoffice/src/tests/unit/ui/IDMCatalogEditor/hooks/useGoodsGroupRun.test.d.ts.map +1 -0
  6. package/build/types/backoffice/src/ui/AssortmentManager/index.d.ts +1 -2
  7. package/build/types/backoffice/src/ui/AssortmentManager/index.d.ts.map +1 -1
  8. package/build/types/backoffice/src/ui/IDMCatalogEditor/Tables/Items.d.ts +5 -1
  9. package/build/types/backoffice/src/ui/IDMCatalogEditor/Tables/Items.d.ts.map +1 -1
  10. package/build/types/backoffice/src/ui/IDMCatalogEditor/api/goodsGroups.d.ts +129 -0
  11. package/build/types/backoffice/src/ui/IDMCatalogEditor/api/goodsGroups.d.ts.map +1 -0
  12. package/build/types/backoffice/src/ui/IDMCatalogEditor/components/GoodsGroups/ClassifyTrigger.d.ts +10 -0
  13. package/build/types/backoffice/src/ui/IDMCatalogEditor/components/GoodsGroups/ClassifyTrigger.d.ts.map +1 -0
  14. package/build/types/backoffice/src/ui/IDMCatalogEditor/components/GoodsGroups/index.d.ts +36 -0
  15. package/build/types/backoffice/src/ui/IDMCatalogEditor/components/GoodsGroups/index.d.ts.map +1 -0
  16. package/build/types/backoffice/src/ui/IDMCatalogEditor/hooks/useGoodsGroupRun.d.ts +21 -0
  17. package/build/types/backoffice/src/ui/IDMCatalogEditor/hooks/useGoodsGroupRun.d.ts.map +1 -0
  18. package/build/types/backoffice/src/ui/IDMCatalogEditor/hooks/useGoodsGroupVocabulary.d.ts +9 -0
  19. package/build/types/backoffice/src/ui/IDMCatalogEditor/hooks/useGoodsGroupVocabulary.d.ts.map +1 -0
  20. package/build/types/backoffice/src/ui/IDMCatalogEditor/modules/TableItems/index.d.ts.map +1 -1
  21. package/build/types/backoffice/src/ui/IDMCatalogEditor/modules/TableSeries/index.d.ts.map +1 -1
  22. package/build/types/backoffice/src/utils/ApiHandler.d.ts +1 -1
  23. package/build/types/backoffice/src/utils/ApiHandler.d.ts.map +1 -1
  24. package/package.json +10 -10
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=goodsGroups.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"goodsGroups.test.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/tests/unit/ui/IDMCatalogEditor/api/goodsGroups.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=useGoodsGroupRun.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useGoodsGroupRun.test.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/tests/unit/ui/IDMCatalogEditor/hooks/useGoodsGroupRun.test.ts"],"names":[],"mappings":""}
@@ -1,4 +1,3 @@
1
- import AssortmentManagerHeaderData from './HeaderData';
1
+ export { default as AssortmentManagerHeaderData } from './HeaderData';
2
2
  export type { AssortmentManagerHeaderDataConfiguration } from './HeaderData/types';
3
- export { AssortmentManagerHeaderData };
4
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/AssortmentManager/index.tsx"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,MAAM,cAAc,CAAC;AACvD,YAAY,EAAE,wCAAwC,EAAE,MAAM,oBAAoB,CAAC;AAEnF,OAAO,EAAE,2BAA2B,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/AssortmentManager/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,2BAA2B,EAAE,MAAM,cAAc,CAAC;AACtE,YAAY,EAAE,wCAAwC,EAAE,MAAM,oBAAoB,CAAC"}
@@ -8,7 +8,11 @@ interface ItemsProps {
8
8
  selectedSerie: any;
9
9
  apiConfig: ApiConfig;
10
10
  hooks?: DivaSpreadsheetHooks<any>;
11
+ /** True while the whole serie's classification run is in progress - every item cell then shows as running too, since the run classifies (and can overwrite) every item as it goes. */
12
+ serieRunActive?: boolean;
13
+ /** Bumped by the owner whenever something outside this component changed the items' classification (e.g. a serie run just settled) - included in the grid's key so it remounts and refetches instead of showing stale rows. */
14
+ refreshToken?: string | number;
11
15
  }
12
- declare const Items: React.ForwardRefExoticComponent<ItemsProps & React.RefAttributes<SpreadsheetRefProps>>;
16
+ declare const Items: React.MemoExoticComponent<React.ForwardRefExoticComponent<Omit<ItemsProps & React.RefAttributes<SpreadsheetRefProps>, "ref"> & React.RefAttributes<SpreadsheetRefProps>>>;
13
17
  export default Items;
14
18
  //# sourceMappingURL=Items.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Items.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/IDMCatalogEditor/Tables/Items.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,SAAS,EAAkB,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAiB,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACtG,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAIvC,UAAU,UAAU;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,WAAW,CAAC;IAC7B,aAAa,EAAE,GAAG,CAAC;IACnB,SAAS,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,oBAAoB,CAAC,GAAG,CAAC,CAAC;CACnC;AAED,QAAA,MAAM,KAAK,wFAyfT,CAAC;AAIH,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"Items.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/IDMCatalogEditor/Tables/Items.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AAGxE,OAAO,EAAE,SAAS,EAAkB,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAA4C,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjI,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAwBvC,UAAU,UAAU;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,WAAW,CAAC;IAC7B,aAAa,EAAE,GAAG,CAAC;IACnB,SAAS,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,oBAAoB,CAAC,GAAG,CAAC,CAAC;IAClC,sLAAsL;IACtL,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,+NAA+N;IAC/N,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAChC;AAgpBD,QAAA,MAAM,KAAK,2KAAuB,CAAC;AAEnC,eAAe,KAAK,CAAC"}
@@ -0,0 +1,129 @@
1
+ /**
2
+ * Types and access helpers for the goods-group vocabulary (Warengruppen-Programme / Wohnwelten) that idm-service
3
+ * joins onto a serie under `goodsGroup` when the `goodsGroup` field is requested.
4
+ */
5
+ /** One vocabulary entry (a program/catalog group, a living world, or a product group) with its translated name. */
6
+ export interface VocabularyEntry {
7
+ code: string;
8
+ /** Translated display name, keyed by lowercase language code (e.g. 'de', 'en', 'fr', 'it'). */
9
+ name: Record<string, string>;
10
+ }
11
+ /** A living world, nesting the catalog groups (programs) that belong to it. */
12
+ export interface LivingWorldEntry extends VocabularyEntry {
13
+ catalogGroups: VocabularyEntry[];
14
+ }
15
+ /** The full goods-group vocabulary, as returned by idm-service. */
16
+ export interface GoodsGroupVocabulary {
17
+ livingWorlds: LivingWorldEntry[];
18
+ /** Catalog groups (programs) that do not belong to any living world - always 4 entries. */
19
+ catalogGroupsWithoutWorld: VocabularyEntry[];
20
+ productGroups: VocabularyEntry[];
21
+ }
22
+ /** The `goodsGroup` join idm-service attaches to a serie row when the AI enrichment has classified it. */
23
+ export interface SerieGoodsGroupSummary {
24
+ id: string;
25
+ effectiveCatalogGroupCode?: string;
26
+ effectiveLivingWorldCode?: string;
27
+ source: 'ai' | 'manual';
28
+ needsReview: boolean;
29
+ runningRunId?: string;
30
+ }
31
+ /** The `goodsGroup` join idm-service attaches to an item row when the AI enrichment has classified it. */
32
+ export interface ItemGoodsGroupSummary {
33
+ id: string;
34
+ effectiveCode?: string;
35
+ source: 'ai' | 'manual';
36
+ needsReview: boolean;
37
+ changedSinceClassified: boolean;
38
+ }
39
+ /**
40
+ * Resolves the translated display label of a vocabulary entry. Accepts a raw code instead of an entry (e.g. while
41
+ * the vocabulary has not loaded yet, or the code is not one it lists) and returns it unchanged, so callers can
42
+ * pass either without a separate lookup step.
43
+ */
44
+ export declare function vocabularyLabel(entry: VocabularyEntry | string | undefined, language: string): string;
45
+ /**
46
+ * Flattens the vocabulary's catalog groups (programs) into one list - the ones nested under a living world plus
47
+ * the ones without one - for use as the enum editor's option list and for code-to-entry lookups.
48
+ */
49
+ export declare function flattenCatalogGroups(vocabulary: GoodsGroupVocabulary | undefined): VocabularyEntry[];
50
+ /** Identifies the idm-service instance (and, optionally, the caller's auth) to fetch the vocabulary from. */
51
+ export interface GoodsGroupVocabularyContext {
52
+ idmService: string;
53
+ jwt?: string;
54
+ }
55
+ /** The goods-group classification of one serie, as persisted by idm-service - the AI run plus an optional manual correction. */
56
+ export interface GoodsGroupDocument {
57
+ id: string;
58
+ aiGoodsGroupCode?: string;
59
+ aiCatalogGroupCode?: string;
60
+ aiLivingWorldCode?: string;
61
+ aiConfidence?: number;
62
+ aiRationale?: string;
63
+ needsReview: boolean;
64
+ manualCatalogGroupCode?: string;
65
+ manualLivingWorldCode?: string;
66
+ manualGoodsGroupCode?: string;
67
+ correctedBy?: string;
68
+ correctedAt?: string;
69
+ }
70
+ /** Clears the manual correction, reverting the serie's goods-group classification back to the AI value. */
71
+ export declare function deleteGoodsGroupManual(ctx: GoodsGroupVocabularyContext, id: string): Promise<void>;
72
+ /** Fetches a serie's current goods-group classification document. */
73
+ export declare function getGoodsGroup(ctx: GoodsGroupVocabularyContext, id: string): Promise<GoodsGroupDocument>;
74
+ /**
75
+ * Derives the serie-row summary (effective codes, source, review flag) from a goods-group document -
76
+ * the same shape idm-service joins onto a serie row under `goodsGroup`. `previous` carries forward
77
+ * `runningRunId`, which is not part of the document itself and would otherwise be lost on a writeback.
78
+ */
79
+ export declare function toSerieGoodsGroupSummary(doc: GoodsGroupDocument, previous?: SerieGoodsGroupSummary): SerieGoodsGroupSummary;
80
+ /**
81
+ * Derives the item-row summary (effective code, source, review flag) from a goods-group document - the same
82
+ * shape idm-service joins onto an item row under `goodsGroup`. The document has no notion of the item's own
83
+ * change date, so `changedSinceClassified` cannot be derived from it; it is carried forward from `previous`
84
+ * instead, and defaults to false when there is no previous summary to carry it from.
85
+ */
86
+ export declare function toItemGoodsGroupSummary(doc: GoodsGroupDocument, previous?: ItemGoodsGroupSummary): ItemGoodsGroupSummary;
87
+ /**
88
+ * Sets the manual correction by business key (catalog/serie/optional item) instead of the goods-group
89
+ * document id, so it also works for a serie or item that has never been classified yet and therefore has
90
+ * no document (and no id) to address.
91
+ */
92
+ export declare function putGoodsGroupManualByKey(ctx: GoodsGroupVocabularyContext, body: {
93
+ catalogId: string;
94
+ serieId: string;
95
+ typeNo?: string;
96
+ } & ({
97
+ manualCatalogGroupCode: string;
98
+ } | {
99
+ manualGoodsGroupCode: string;
100
+ })): Promise<GoodsGroupDocument>;
101
+ /** The status idm-service reports for a goods-group classification run. */
102
+ export type GoodsGroupRunStatus = 'running' | 'done' | 'error' | 'stopped';
103
+ /** A goods-group classification run for a whole serie, as tracked by idm-service. */
104
+ export interface GoodsGroupRun {
105
+ runId?: string;
106
+ status: GoodsGroupRunStatus;
107
+ error?: string;
108
+ }
109
+ /**
110
+ * Starts a goods-group classification run for a serie. If a run for this serie is already in progress,
111
+ * idm-service returns that run's id instead of starting a second one - depending on how idm-service signals
112
+ * it, either as a normal response or as a non-2xx response that still carries the runId in its body. Both
113
+ * are treated the same here: either way there is now a run for the returned id, ready to poll.
114
+ */
115
+ export declare function startGoodsGroupRun(ctx: GoodsGroupVocabularyContext, body: {
116
+ catalogId: string;
117
+ serieId: string;
118
+ }): Promise<{
119
+ runId: string;
120
+ }>;
121
+ /** Fetches a classification run's current status. */
122
+ export declare function getGoodsGroupRun(ctx: GoodsGroupVocabularyContext, runId: string): Promise<GoodsGroupRun>;
123
+ /** Synchronously classifies a single item and returns its resulting goods-group document. */
124
+ export declare function classifyGoodsGroupItem(ctx: GoodsGroupVocabularyContext, body: {
125
+ catalogId: string;
126
+ serieId: string;
127
+ typeNo: string;
128
+ }): Promise<GoodsGroupDocument>;
129
+ //# sourceMappingURL=goodsGroups.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"goodsGroups.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/IDMCatalogEditor/api/goodsGroups.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,mHAAmH;AACnH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,+FAA+F;IAC/F,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC9B;AAED,+EAA+E;AAC/E,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,aAAa,EAAE,eAAe,EAAE,CAAC;CAClC;AAED,mEAAmE;AACnE,MAAM,WAAW,oBAAoB;IACnC,YAAY,EAAE,gBAAgB,EAAE,CAAC;IACjC,2FAA2F;IAC3F,yBAAyB,EAAE,eAAe,EAAE,CAAC;IAC7C,aAAa,EAAE,eAAe,EAAE,CAAC;CAClC;AAED,0GAA0G;AAC1G,MAAM,WAAW,s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AAM,CAAA;CAAE,GAAG,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAiBnJ;AAED,qDAAqD;AACrD,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,2BAA2B,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAM9G;AAED,6FAA6F;AAC7F,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,2BAA2B,EAChC,IAAI,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAC3D,OAAO,CAAC,kBAAkB,CAAC,CAQ7B"}
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ interface ClassifyTriggerProps {
3
+ /** Whether this cell's classification is currently running - swaps the icon for a spinner and blocks the click. */
4
+ running: boolean;
5
+ onClick: () => void | Promise<void>;
6
+ }
7
+ /** The AI classification trigger shown at the end of a goods-group cell - see GoodsGroupCellRenderer. */
8
+ export default function ClassifyTrigger({ running, onClick }: ClassifyTriggerProps): React.JSX.Element;
9
+ export {};
10
+ //# sourceMappingURL=ClassifyTrigger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClassifyTrigger.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/IDMCatalogEditor/components/GoodsGroups/ClassifyTrigger.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAMhD,UAAU,oBAAoB;IAC5B,mHAAmH;IACnH,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACrC;AAeD,yGAAyG;AACzG,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,oBAAoB,qBAwDjF"}
@@ -0,0 +1,36 @@
1
+ import React from 'react';
2
+ import { CustomCellRendererProps } from 'ag-grid-react';
3
+ import { IRowNode } from 'ag-grid-enterprise';
4
+ import { DivaContext } from '@crystaldesign/spreadsheet';
5
+ import { GoodsGroupVocabulary, ItemGoodsGroupSummary, SerieGoodsGroupSummary } from '../../api/goodsGroups';
6
+ export interface RowData {
7
+ /** The row's Mongo id - onClassify needs it (catalogId/serieId/typeNo lookups all key off it), and an
8
+ * add-pending row has none yet. */
9
+ _id?: string;
10
+ goodsGroup?: SerieGoodsGroupSummary | ItemGoodsGroupSummary;
11
+ }
12
+ export type GoodsGroupField = 'catalogGroup' | 'livingWorld' | 'goodsGroup';
13
+ export interface GoodsGroupCellRendererParams {
14
+ /** Which part of the vocabulary the cell's value (a code) is looked up in. */
15
+ field: GoodsGroupField;
16
+ /** The vocabulary, fetched once by the column owner (TableSeries/Items) - undefined while it is loading. */
17
+ vocabulary: GoodsGroupVocabulary | undefined;
18
+ /**
19
+ * Triggers an AI classification for this cell's row. Only set on the columns that support triggering one
20
+ * (Programm/Warengruppe) - left undefined on the readonly Wohnwelt column, which then renders without the
21
+ * icon.
22
+ */
23
+ onClassify?: (data: RowData, node: IRowNode<RowData>) => void | Promise<void>;
24
+ /** Whether this specific cell's classification is currently running - swaps the icon for a spinner and blocks the click. */
25
+ isRunning?: (data: RowData) => boolean;
26
+ }
27
+ /**
28
+ * Renders a serie's or item's goods-group vocabulary value (catalog group/program, living world, or product
29
+ * group) as its translated name, plus - on the columns that pass `onClassify` - an AI classify trigger pinned
30
+ * to the cell's end. Values the AI enrichment run set (`goodsGroup.source === 'ai'`) render greyed out - in the
31
+ * same style as the spreadsheet package's withPlaceholder cells - to mark them as unconfirmed; manually set
32
+ * values render as normal text. The vocabulary is passed in via props rather than fetched here, so the cell
33
+ * shows the raw code until the owner's fetch resolves.
34
+ */
35
+ export default function GoodsGroupCellRenderer(props: CustomCellRendererProps<RowData, string, DivaContext> & GoodsGroupCellRendererParams): React.JSX.Element;
36
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/IDMCatalogEditor/components/GoodsGroups/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAoB,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEzD,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EAIvB,MAAM,uBAAuB,CAAC;AAI/B,MAAM,WAAW,OAAO;IACtB;uCACmC;IACnC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,sBAAsB,GAAG,qBAAqB,CAAC;CAC7D;AAED,MAAM,MAAM,eAAe,GAAG,cAAc,GAAG,aAAa,GAAG,YAAY,CAAC;AAE5E,MAAM,WAAW,4BAA4B;IAC3C,8EAA8E;IAC9E,KAAK,EAAE,eAAe,CAAC;IACvB,4GAA4G;IAC5G,UAAU,EAAE,oBAAoB,GAAG,SAAS,CAAC;IAC7C;;;;OAIG;IACH,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9E,4HAA4H;IAC5H,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC;CACxC;AAUD;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,KAAK,EAAE,uBAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,GAAG,4BAA4B,qBA2BzI"}
@@ -0,0 +1,21 @@
1
+ import { GoodsGroupRunStatus, GoodsGroupVocabularyContext } from '../api/goodsGroups';
2
+ /** The result a run settles with - 'running' is excluded, since that is what keeps it being polled. */
3
+ export interface GoodsGroupRunResult {
4
+ status: Exclude<GoodsGroupRunStatus, 'running'>;
5
+ error?: string;
6
+ }
7
+ /**
8
+ * Starts and polls goods-group classification runs - several at once, one per serie. Each tracked run is
9
+ * polled every 2s until it leaves the 'running' status, then onSettled fires once and polling for that run
10
+ * stops; all intervals are cleared on unmount. `ctx` and `onSettled` are read from refs kept current on every
11
+ * render, so `start` and `resume` stay referentially stable and never see stale values.
12
+ */
13
+ export default function useGoodsGroupRun(ctx: GoodsGroupVocabularyContext, onSettled: (runId: string, result: GoodsGroupRunResult) => void): {
14
+ start: (params: {
15
+ catalogId: string;
16
+ serieId: string;
17
+ }) => Promise<string>;
18
+ resume: (runId: string) => void;
19
+ isSettled: (runId: string) => boolean;
20
+ };
21
+ //# sourceMappingURL=useGoodsGroupRun.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useGoodsGroupRun.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/IDMCatalogEditor/hooks/useGoodsGroupRun.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,2BAA2B,EAAwC,MAAM,oBAAoB,CAAC;AAI5H,uGAAuG;AACvG,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,OAAO,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC;IAChD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,GAAG,EAAE,2BAA2B,EAAE,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,mBAAmB,KAAK,IAAI;oBA6DvH;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE;oBAU7C,MAAM;uBAOsB,MAAM;EAM7C"}
@@ -0,0 +1,9 @@
1
+ import { GoodsGroupVocabulary, GoodsGroupVocabularyContext } from '../api/goodsGroups';
2
+ /**
3
+ * Fetches the goods-group vocabulary once per mount (re-fetching only if the service URL or JWT changes), and
4
+ * returns it - or undefined while loading, or after a failed fetch. TableSeries calls this once and passes the
5
+ * result down to the Programm/Wohnwelt columns and their shared cell renderer, so the vocabulary is fetched once
6
+ * instead of once per consumer.
7
+ */
8
+ export default function useGoodsGroupVocabulary(ctx: GoodsGroupVocabularyContext): GoodsGroupVocabulary | undefined;
9
+ //# sourceMappingURL=useGoodsGroupVocabulary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useGoodsGroupVocabulary.d.ts","sourceRoot":"","sources":["../../../../../../../src/ui/IDMCatalogEditor/hooks/useGoodsGroupVocabulary.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AAEvF;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAC,GAAG,EAAE,2BAA2B,GAAG,oBAAoB,GAAG,SAAS,CA6BlH"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/IDMCatalogEditor/modules/TableItems/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0B,MAAM,OAAO,CAAC;AAe/C,eAAO,MAAM,UAAU;;CAwFrB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/IDMCatalogEditor/modules/TableItems/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA0B,MAAM,OAAO,CAAC;AAe/C,eAAO,MAAM,UAAU;;CA4FrB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/IDMCatalogEditor/modules/TableSeries/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAe5D,eAAO,MAAM,WAAW;;CAuXtB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/ui/IDMCatalogEditor/modules/TableSeries/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAkCtE,eAAO,MAAM,WAAW;;CAukBtB,CAAC"}
@@ -40,6 +40,6 @@ export default class {
40
40
  private readInternal;
41
41
  private aplyJsonPath;
42
42
  private createPatch;
43
- createSocket(data: any, mapping: Mapping | undefined, namespace?: string): Socket<import("@socket.io/component-emitter").DefaultEventsMap, import("@socket.io/component-emitter").DefaultEventsMap>;
43
+ createSocket(data: any, mapping: Mapping | undefined, namespace?: string): Socket;
44
44
  }
45
45
  //# sourceMappingURL=ApiHandler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ApiHandler.d.ts","sourceRoot":"","sources":["../../../../../src/utils/ApiHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAE3C,OAA+B,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEnF,OAAO,EAAM,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAK9C,MAAM,CAAC,OAAO;IAoBV,SAAS,CAAC,aAAa,EAAE,sBAAsB;IAC/C,SAAS,CAAC,UAAU,EAAE,SAAS;IApBjC,SAAS,CAAC,UAAU,qBAAC;IACrB,SAAS,CAAC,aAAa,qBAAC;IACxB,SAAS,CAAC,aAAa,sBAAC;IACxB,SAAS,CAAC,OAAO,sBAAC;IAClB,SAAS,CAAC,UAAU,qBAAC;IACrB,SAAS,CAAC,aAAa,qBAAC;IACxB,SAAS,CAAC,UAAU,qBAAC;IACrB,SAAS,CAAC,cAAc,SAAQ;IAChC,SAAS,CAAC,WAAW,qBAAC;IACtB,SAAS,CAAC,YAAY,qBAAC;IACvB,SAAS,CAAC,iBAAiB,UAAQ;IACnC,SAAS,CAAC,aAAa,qBAAC;IACxB,SAAS,CAAC,eAAe,UAAS;IAClC,SAAS,CAAC,aAAa,sBAAC;IACx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"name": "@crystaldesign/diva-backoffice",
3
- "version": "26.11.0-beta.13",
3
+ "version": "26.11.0-beta.14",
4
4
  "description": "Ant Design backoffice shell: configuration plus the IDM and enricher editors.",
5
5
  "license": "COMMERCIAL",
6
6
  "devDependencies": {
@@ -16,14 +16,14 @@
16
16
  "dependencies": {
17
17
  "@ant-design/icons": "6.1.0",
18
18
  "@babel/runtime": "7.24.7",
19
- "@crystaldesign/content-box": "26.11.0-beta.13",
20
- "@crystaldesign/content-item": "26.11.0-beta.13",
21
- "@crystaldesign/diva-agent": "26.11.0-beta.13",
22
- "@crystaldesign/diva-core": "26.11.0-beta.13",
23
- "@crystaldesign/diva-utils": "26.11.0-beta.13",
24
- "@crystaldesign/media-upload": "26.11.0-beta.13",
25
- "@crystaldesign/rtf-editor": "26.11.0-beta.13",
26
- "@crystaldesign/spreadsheet": "26.11.0-beta.13",
19
+ "@crystaldesign/content-box": "26.11.0-beta.14",
20
+ "@crystaldesign/content-item": "26.11.0-beta.14",
21
+ "@crystaldesign/diva-agent": "26.11.0-beta.14",
22
+ "@crystaldesign/diva-core": "26.11.0-beta.14",
23
+ "@crystaldesign/diva-utils": "26.11.0-beta.14",
24
+ "@crystaldesign/media-upload": "26.11.0-beta.14",
25
+ "@crystaldesign/rtf-editor": "26.11.0-beta.14",
26
+ "@crystaldesign/spreadsheet": "26.11.0-beta.14",
27
27
  "@dnd-kit/core": "^6.1.0",
28
28
  "@dnd-kit/sortable": "^8.0.0",
29
29
  "@dnd-kit/utilities": "^3.2.2",
@@ -57,5 +57,5 @@
57
57
  },
58
58
  "module": "build/esm/index.js",
59
59
  "types": "./build/types/backoffice/src/index.d.ts",
60
- "gitHead": "33ccbb63dde1deb30bb0b61f7af3097467a0143c"
60
+ "gitHead": "8b11c46f3238efbc1a262db6702ce608d006c484"
61
61
  }