@qoretechnologies/reqraft 0.10.27-pr.74.gc5f6ca3 → 0.10.27-pr.74.gcbbf430

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 (59) hide show
  1. package/dist/components/searchFilterBar/SearchFilterBar.d.ts +33 -0
  2. package/dist/components/searchFilterBar/SearchFilterBar.d.ts.map +1 -0
  3. package/dist/components/searchFilterBar/SearchFilterBar.js +76 -0
  4. package/dist/components/searchFilterBar/SearchFilterBar.js.map +1 -0
  5. package/dist/components/searchFilterBar/index.d.ts +2 -0
  6. package/dist/components/searchFilterBar/index.d.ts.map +1 -0
  7. package/dist/components/searchFilterBar/index.js +18 -0
  8. package/dist/components/searchFilterBar/index.js.map +1 -0
  9. package/dist/components/supportTicket/InterfaceReferenceTags.d.ts +9 -1
  10. package/dist/components/supportTicket/InterfaceReferenceTags.d.ts.map +1 -1
  11. package/dist/components/supportTicket/InterfaceReferenceTags.js +2 -2
  12. package/dist/components/supportTicket/InterfaceReferenceTags.js.map +1 -1
  13. package/dist/components/supportTicket/ReferencePicker.d.ts +52 -6
  14. package/dist/components/supportTicket/ReferencePicker.d.ts.map +1 -1
  15. package/dist/components/supportTicket/ReferencePicker.js +240 -31
  16. package/dist/components/supportTicket/ReferencePicker.js.map +1 -1
  17. package/dist/components/supportTicket/attachmentAccess.d.ts +37 -0
  18. package/dist/components/supportTicket/attachmentAccess.d.ts.map +1 -0
  19. package/dist/components/supportTicket/attachmentAccess.js +132 -0
  20. package/dist/components/supportTicket/attachmentAccess.js.map +1 -0
  21. package/dist/components/supportTicket/index.d.ts +2 -0
  22. package/dist/components/supportTicket/index.d.ts.map +1 -1
  23. package/dist/components/supportTicket/index.js +2 -0
  24. package/dist/components/supportTicket/index.js.map +1 -1
  25. package/dist/components/supportTicket/meta.d.ts +8 -0
  26. package/dist/components/supportTicket/meta.d.ts.map +1 -1
  27. package/dist/components/supportTicket/meta.js +37 -1
  28. package/dist/components/supportTicket/meta.js.map +1 -1
  29. package/dist/components/supportTicket/ticketModel.d.ts +102 -0
  30. package/dist/components/supportTicket/ticketModel.d.ts.map +1 -0
  31. package/dist/components/supportTicket/ticketModel.js +3 -0
  32. package/dist/components/supportTicket/ticketModel.js.map +1 -0
  33. package/dist/components/ticketReferences/TicketReferences.d.ts.map +1 -1
  34. package/dist/components/ticketReferences/TicketReferences.js +109 -78
  35. package/dist/components/ticketReferences/TicketReferences.js.map +1 -1
  36. package/dist/components/ticketThread/TicketThread.d.ts.map +1 -1
  37. package/dist/components/ticketThread/TicketThread.js +19 -2
  38. package/dist/components/ticketThread/TicketThread.js.map +1 -1
  39. package/dist/index.d.ts +3 -1
  40. package/dist/index.d.ts.map +1 -1
  41. package/dist/index.js +4 -1
  42. package/dist/index.js.map +1 -1
  43. package/package.json +1 -1
  44. package/src/components/searchFilterBar/SearchFilterBar.tsx +131 -0
  45. package/src/components/searchFilterBar/index.ts +1 -0
  46. package/src/components/supportTicket/InterfaceReferenceTags.stories.tsx +37 -0
  47. package/src/components/supportTicket/InterfaceReferenceTags.tsx +11 -0
  48. package/src/components/supportTicket/ReferencePicker.stories.tsx +257 -34
  49. package/src/components/supportTicket/ReferencePicker.tsx +421 -95
  50. package/src/components/supportTicket/TicketConversation.stories.tsx +0 -1
  51. package/src/components/supportTicket/TicketReplyBox.stories.tsx +0 -4
  52. package/src/components/supportTicket/attachmentAccess.ts +97 -0
  53. package/src/components/supportTicket/index.ts +2 -0
  54. package/src/components/supportTicket/meta.ts +40 -0
  55. package/src/components/supportTicket/ticketModel.ts +131 -0
  56. package/src/components/ticketReferences/TicketReferences.tsx +124 -145
  57. package/src/components/ticketThread/TicketThread.stories.tsx +24 -2
  58. package/src/components/ticketThread/TicketThread.tsx +23 -3
  59. package/src/index.tsx +3 -1
@@ -0,0 +1,33 @@
1
+ import { IReqoreIconName } from '@qoretechnologies/reqore/dist/types/icons';
2
+ export interface ISearchFilterOption {
3
+ label: string;
4
+ icon?: IReqoreIconName;
5
+ selected?: boolean;
6
+ onClick: () => void;
7
+ }
8
+ export interface ISearchFilter {
9
+ /** Icon for the trigger — usually the selected option's. */
10
+ icon?: IReqoreIconName;
11
+ /** Trigger label — usually the selected option's. */
12
+ label: string;
13
+ items: ISearchFilterOption[];
14
+ }
15
+ export interface ISearchFilterBarProps {
16
+ value: string;
17
+ onChange: (value: string) => void;
18
+ placeholder: string;
19
+ filters?: ISearchFilter[];
20
+ /**
21
+ * Stack the search over its filters. On a phone the box and two dropdowns
22
+ * cannot share a row without the input collapsing to a few characters, so the
23
+ * caller passes its own breakpoint result rather than this guessing.
24
+ */
25
+ stacked?: boolean;
26
+ /**
27
+ * Pin the bar to the top of its scroll container. For a bar inside a scrolling
28
+ * panel (the References tab); a bar above a page-level list does not need it.
29
+ */
30
+ sticky?: boolean;
31
+ }
32
+ export declare const SearchFilterBar: ({ value, onChange, placeholder, filters, stacked, sticky, }: ISearchFilterBarProps) => import("react/jsx-runtime").JSX.Element;
33
+ //# sourceMappingURL=SearchFilterBar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SearchFilterBar.d.ts","sourceRoot":"","sources":["../../../src/components/searchFilterBar/SearchFilterBar.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAwC5E,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,aAAa;IAC5B,4DAA4D;IAC5D,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,qDAAqD;IACrD,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,mBAAmB,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,aAAa,EAAE,CAAC;IAC1B;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,eAAO,MAAM,eAAe,gEAOzB,qBAAqB,4CAiDvB,CAAC"}
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
+ return cooked;
5
+ };
6
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
+ if (k2 === undefined) k2 = k;
8
+ var desc = Object.getOwnPropertyDescriptor(m, k);
9
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
+ desc = { enumerable: true, get: function() { return m[k]; } };
11
+ }
12
+ Object.defineProperty(o, k2, desc);
13
+ }) : (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ o[k2] = m[k];
16
+ }));
17
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
18
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
19
+ }) : function(o, v) {
20
+ o["default"] = v;
21
+ });
22
+ var __importStar = (this && this.__importStar) || function (mod) {
23
+ if (mod && mod.__esModule) return mod;
24
+ var result = {};
25
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
26
+ __setModuleDefault(result, mod);
27
+ return result;
28
+ };
29
+ Object.defineProperty(exports, "__esModule", { value: true });
30
+ exports.SearchFilterBar = void 0;
31
+ var jsx_runtime_1 = require("react/jsx-runtime");
32
+ var reqore_1 = require("@qoretechnologies/reqore");
33
+ var styled_components_1 = __importStar(require("styled-components"));
34
+ /*
35
+ * A search box with filter dropdowns beside it — the strip that sits above a list
36
+ * and narrows it.
37
+ *
38
+ * This existed twice, built independently either side of the package boundary: the
39
+ * ticket list in qorus-ide and the References tab here in reqraft. Same
40
+ * composition (ReqoreControlGroup > ReqoreInput + N ReqoreDropdowns), but they had
41
+ * drifted — one sized the group, the other sized each control; one wrapped, the
42
+ * other stacked; one moved the dropdown caret to the right slot and suppressed the
43
+ * default, the other did not. Two strips that should be indistinguishable ended up
44
+ * visibly different, and any fix had to be made twice.
45
+ *
46
+ * It lives in reqraft rather than Reqore because it is a composition of Reqore
47
+ * primitives, not a new primitive — there is nothing here Reqore is missing.
48
+ *
49
+ * The frosted container is part of the component, not the caller's job. Extracting
50
+ * only the controls left the two surfaces still looking different: one bar sat in a
51
+ * bordered, blurred card, the other bare on the page. If the bar is meant to read
52
+ * the same everywhere then its own chrome has to travel with it.
53
+ */
54
+ var Container = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: 8px;\n border-radius: 8px;\n border: 1px solid rgba(255, 255, 255, 0.08);\n background: rgba(255, 255, 255, 0.04);\n backdrop-filter: blur(6px);\n\n ", "\n"], ["\n padding: 8px;\n border-radius: 8px;\n border: 1px solid rgba(255, 255, 255, 0.08);\n background: rgba(255, 255, 255, 0.04);\n backdrop-filter: blur(6px);\n\n ", "\n"])), function (_a) {
55
+ var $sticky = _a.$sticky;
56
+ return $sticky && (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n position: sticky;\n top: 0;\n z-index: 2;\n "], ["\n position: sticky;\n top: 0;\n z-index: 2;\n "])));
57
+ });
58
+ var SearchFilterBar = function (_a) {
59
+ var value = _a.value, onChange = _a.onChange, placeholder = _a.placeholder, _b = _a.filters, filters = _b === void 0 ? [] : _b, stacked = _a.stacked, sticky = _a.sticky;
60
+ return ((0, jsx_runtime_1.jsx)(Container, { "$sticky": sticky, children: (0, jsx_runtime_1.jsxs)(reqore_1.ReqoreControlGroup, { fluid: true, wrap: true, gapSize: 'small', size: 'small', vertical: stacked, verticalAlign: stacked ? undefined : 'center', children: [(0, jsx_runtime_1.jsx)(reqore_1.ReqoreInput, { icon: 'Search2Line', placeholder: placeholder, value: value, onChange: function (event) { return onChange(event.currentTarget.value); }, onClearClick: value ? function () { return onChange(''); } : undefined, minimal: true, fluid: true }), filters.length ?
61
+ (0, jsx_runtime_1.jsx)(reqore_1.ReqoreControlGroup, { gapSize: 'small', size: 'small', fluid: stacked, children: filters.map(function (filter, index) { return ((0, jsx_runtime_1.jsx)(reqore_1.ReqoreDropdown, { icon: filter.icon, label: filter.label, minimal: true, flat: true,
62
+ /* stretch to share the row when stacked; hug the label otherwise */
63
+ fixed: !stacked,
64
+ /* the caret defaults to the LEFT slot, where the filter's own icon
65
+ already sits — without this each trigger shows two glyphs */
66
+ rightIcon: 'ArrowDownSLine', showCaret: false, items: filter.items.map(function (item) { return ({
67
+ label: item.label,
68
+ icon: item.icon,
69
+ selected: item.selected,
70
+ onClick: item.onClick,
71
+ }); }) }, index)); }) })
72
+ : null] }) }));
73
+ };
74
+ exports.SearchFilterBar = SearchFilterBar;
75
+ var templateObject_1, templateObject_2;
76
+ //# sourceMappingURL=SearchFilterBar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SearchFilterBar.js","sourceRoot":"","sources":["../../../src/components/searchFilterBar/SearchFilterBar.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAA2F;AAE3F,qEAAgD;AAEhD;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,IAAM,SAAS,GAAG,2BAAM,CAAC,GAAG,kPAAuB,yKAO/C,EAMC,IACJ,KAPG,UAAC,EAAW;QAAT,OAAO,aAAA;IACV,OAAA,OAAO,QACP,uBAAG,uIAAA,mEAIF,IAAA;AALD,CAKC,CACJ,CAAC;AAmCK,IAAM,eAAe,GAAG,UAAC,EAOR;QANtB,KAAK,WAAA,EACL,QAAQ,cAAA,EACR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IAAI,EAAE,IAAI,CAAC,IAAI;gCACf,QAAQ,EAAE,IAAI,CAAC,QAAQ;gCACvB,OAAO,EAAE,IAAI,CAAC,OAAO;6BACtB,CAAC,EALgC,CAKhC,CAAC,IAhBE,KAAK,CAiBV,CACH,EApB+B,CAoB/B,CAAC,GACiB;oBACvB,CAAC,CAAC,IAAI,IACa,GACX,CACb;AAjD4B,CAiD5B,CAAC;AAxDW,QAAA,eAAe,mBAwD1B"}
@@ -0,0 +1,2 @@
1
+ export * from './SearchFilterBar';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/searchFilterBar/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./SearchFilterBar"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/searchFilterBar/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC"}
@@ -14,6 +14,14 @@ export interface IInterfaceReferenceTagsProps {
14
14
  /** Open a referenced interface; chips are static (informational) when omitted —
15
15
  * e.g. the staff view, which can't reach the customer's instance. */
16
16
  onInterfaceClick?: (reference: IInterfaceReference) => void;
17
+ /**
18
+ * Detach a reference. Each chip grows an "×" when given — for the composer,
19
+ * where the chips are the references you're about to send and so are still
20
+ * editable. Omitted everywhere the chips are a record of what WAS sent (the
21
+ * thread, the ticket header, the Qonsole card): those aren't editable, and an
22
+ * × on them would offer to undo something that already happened.
23
+ */
24
+ onRemove?: (reference: IInterfaceReference) => void;
17
25
  size?: TSizes;
18
26
  /** Chip styling — pass `intent`/`customTheme` (e.g. `{ main: 'custom1' }`) to tint
19
27
  * the reference chips to a surface's accent (the Qonsole/helpdesk composer does). */
@@ -31,5 +39,5 @@ export interface IInterfaceReferenceTagsProps {
31
39
  * thread (per message, no label), and the Qonsole card — so a reference looks
32
40
  * identical everywhere. Renders nothing when there are no references.
33
41
  */
34
- export declare const InterfaceReferenceTags: ({ references, label, resolveInterfaceIcon, onInterfaceClick, size, intent, customTheme, resolveInterfaceImage, }: IInterfaceReferenceTagsProps) => import("react/jsx-runtime").JSX.Element;
42
+ export declare const InterfaceReferenceTags: ({ references, label, resolveInterfaceIcon, onInterfaceClick, onRemove, size, intent, customTheme, resolveInterfaceImage, }: IInterfaceReferenceTagsProps) => import("react/jsx-runtime").JSX.Element;
35
43
  //# sourceMappingURL=InterfaceReferenceTags.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"InterfaceReferenceTags.d.ts","sourceRoot":"","sources":["../../../src/components/supportTicket/InterfaceReferenceTags.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAClF,OAAO,EAAE,MAAM,EAAE,MAAM,+CAA+C,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAwB,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAEnE,MAAM,WAAW,4BAA4B;IAC3C,UAAU,CAAC,EAAE,mBAAmB,EAAE,CAAC;IACnC;2EACuE;IACvE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;wEACoE;IACpE,oBAAoB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,eAAe,CAAC;IACzD;0EACsE;IACtE,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAC5D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;0FACsF;IACtF,MAAM,CAAC,EAAE,cAAc,CAAC,OAAO,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC;IACpD,WAAW,CAAC,EAAE,cAAc,CAAC,OAAO,SAAS,CAAC,CAAC,aAAa,CAAC,CAAC;IAC9D;;0DAEsD;IACtD,qBAAqB,CAAC,EAAE,CAAC,SAAS,EAAE,mBAAmB,KAAK,MAAM,GAAG,SAAS,CAAC;CAChF;AAED;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,qHAShC,4BAA4B,4CAwC9B,CAAC"}
1
+ {"version":3,"file":"InterfaceReferenceTags.d.ts","sourceRoot":"","sources":["../../../src/components/supportTicket/InterfaceReferenceTags.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAClF,OAAO,EAAE,MAAM,EAAE,MAAM,+CAA+C,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAwB,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AAEnE,MAAM,WAAW,4BAA4B;IAC3C,UAAU,CAAC,EAAE,mBAAmB,EAAE,CAAC;IACnC;2EACuE;IACvE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;wEACoE;IACpE,oBAAoB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,eAAe,CAAC;IACzD;0EACsE;IACtE,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAC5D;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,CAAC,SAAS,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACpD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;0FACsF;IACtF,MAAM,CAAC,EAAE,cAAc,CAAC,OAAO,SAAS,CAAC,CAAC,QAAQ,CAAC,CAAC;IACpD,WAAW,CAAC,EAAE,cAAc,CAAC,OAAO,SAAS,CAAC,CAAC,aAAa,CAAC,CAAC;IAC9D;;0DAEsD;IACtD,qBAAqB,CAAC,EAAE,CAAC,SAAS,EAAE,mBAAmB,KAAK,MAAM,GAAG,SAAS,CAAC;CAChF;AAED;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,+HAUhC,4BAA4B,4CA0C9B,CAAC"}
@@ -12,7 +12,7 @@ var meta_1 = require("./meta");
12
12
  * identical everywhere. Renders nothing when there are no references.
13
13
  */
14
14
  var InterfaceReferenceTags = function (_a) {
15
- var references = _a.references, label = _a.label, resolveInterfaceIcon = _a.resolveInterfaceIcon, onInterfaceClick = _a.onInterfaceClick, _b = _a.size, size = _b === void 0 ? 'small' : _b, intent = _a.intent, customTheme = _a.customTheme, resolveInterfaceImage = _a.resolveInterfaceImage;
15
+ var references = _a.references, label = _a.label, resolveInterfaceIcon = _a.resolveInterfaceIcon, onInterfaceClick = _a.onInterfaceClick, onRemove = _a.onRemove, _b = _a.size, size = _b === void 0 ? 'small' : _b, intent = _a.intent, customTheme = _a.customTheme, resolveInterfaceImage = _a.resolveInterfaceImage;
16
16
  if (!(references === null || references === void 0 ? void 0 : references.length)) {
17
17
  return null;
18
18
  }
@@ -24,7 +24,7 @@ var InterfaceReferenceTags = function (_a) {
24
24
  var image = (_a = reference.logo) !== null && _a !== void 0 ? _a : resolveInterfaceImage === null || resolveInterfaceImage === void 0 ? void 0 : resolveInterfaceImage(reference);
25
25
  return ((0, jsx_runtime_1.jsx)(reqore_1.ReqoreTag, { icon: image ? undefined : resolveIcon(reference.interface_kind), leftIconProps: image ? { image: image } : undefined, labelKey: reference.interface_kind, label: reference.interface_name, size: size, intent: intent, customTheme: customTheme, tooltip: onInterfaceClick
26
26
  ? "Open ".concat(reference.interface_kind, " ").concat(reference.interface_name)
27
- : "".concat(reference.interface_kind, ": ").concat(reference.interface_name), onClick: onInterfaceClick ? function () { return onInterfaceClick(reference); } : undefined }, (_b = reference.reference_id) !== null && _b !== void 0 ? _b : "".concat(reference.interface_kind, ":").concat(reference.interface_name)));
27
+ : "".concat(reference.interface_kind, ": ").concat(reference.interface_name), onClick: onInterfaceClick ? function () { return onInterfaceClick(reference); } : undefined, onRemoveClick: onRemove ? function () { return onRemove(reference); } : undefined, removeTooltip: "Remove ".concat(reference.interface_kind, " ").concat(reference.interface_name) }, (_b = reference.reference_id) !== null && _b !== void 0 ? _b : "".concat(reference.interface_kind, ":").concat(reference.interface_name)));
28
28
  })] }));
29
29
  };
30
30
  exports.InterfaceReferenceTags = InterfaceReferenceTags;
@@ -1 +1 @@
1
- {"version":3,"file":"InterfaceReferenceTags.js","sourceRoot":"","sources":["../../../src/components/supportTicket/InterfaceReferenceTags.tsx"],"names":[],"mappings":";;;;AAAA,mDAAkF;AAIlF,+BAAmE;AAwBnE;;;;;;GAMG;AACI,IAAM,sBAAsB,GAAG,UAAC,EASR;QAR7B,UAAU,gBAAA,EACV,KAAK,WAAA,EACL,oBAAoB,0BAAA,EACpB,gBAAgB,sBAAA,EAChB,YAAc,EAAd,IAAI,mBAAG,OAAO,KAAA,EACd,MAAM,YAAA,EACN,WAAW,iBAAA,EACX,qBAAqB,2BAAA;IAErB,IAAI,CAAC,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,MAAM,CAAA,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAM,WAAW,GAAG,oBAAoB,aAApB,oBAAoB,cAApB,oBAAoB,GAAI,2BAAoB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CACH,CAAC;YACJ,CAAC,CAAC,IACiB,CACtB,CAAC;AACJ,CAAC,CAAC;AAjDW,QAAA,sBAAsB,0BAiDjC"}
1
+ {"version":3,"file":"InterfaceReferenceTags.js","sourceRoot":"","sources":["../../../src/components/supportTicket/InterfaceReferenceTags.tsx"],"names":[],"mappings":";;;;AAAA,mDAAkF;AAIlF,+BAAmE;AAgCnE;;;;;;GAMG;AACI,IAAM,sBAAsB,GAAG,UAAC,EAUR;QAT7B,UAAU,gBAAA,EACV,KAAK,WAAA,EACL,oBAAoB,0BAAA,EACpB,gBAAgB,sBAAA,EAChB,QAAQ,cAAA,EACR,YAAc,EAAd,IAAI,mBAAG,OAAO,KAAA,EACd,MAAM,YAAA,EACN,WAAW,iBAAA,EACX,qBAAqB,2BAAA;IAErB,IAAI,CAAC,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,MAAM,CAAA,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAM,WAAW,GAAG,oBAAoB,aAApB,oBAAoB,cAApB,oBAAoB,GAAI,2BAAoB,CAAC;IACjE,OAAO,CACL,wBAAC,2BAAkB,IAAC,aAAa,EAAC,QAAQ,EAAC,IAAI,QAAC,OAAO,EAAC,OAAO,aAC5D,KAAK,CAAC,CAAC,CAAC,CACP,uBAAC,gBAAO,IAAC,IAAI,EAAC,OAAO,EAAC,MAAM,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,YAC3C,KAAK,GACE,CACX,CAAC,CAAC,CAAC,IAAI,EACP,UAAU,CAAC,GAAG,CAAC,UAAC,SAAS;;gBACxB,4EAA4E;gBAC5E,0EAA0E;gBAC1E,IAAM,KAAK,GAAG,MAAA,SAAS,CAAC,IAAI,mCAAI,qBAAqB,aAArB,qBAAqB,uBAArB,qBAAqB,CAAG,SAAS,CAAC,CAAC;gBACnE,OAAO,CACL,uBAAC,kBAAS,IAKR,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC,cAAc,CAAC,EAC/D,aAAa,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,OAAA,EAAE,CAAC,CAAC,CAAC,SAAS,EAC5C,QAAQ,EAAE,SAAS,CAAC,cAAc,EAClC,KAAK,EAAE,SAAS,CAAC,cAAc,EAC/B,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,OAAO,EACL,gBAAgB;wBACd,CAAC,CAAC,eAAQ,SAAS,CAAC,cAAc,cAAI,SAAS,CAAC,cAAc,CAAE;wBAChE,CAAC,CAAC,UAAG,SAAS,CAAC,cAAc,eAAK,SAAS,CAAC,cAAc,CAAE,EAEhE,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,cAAM,OAAA,gBAAgB,CAAC,SAAS,CAAC,EAA3B,CAA2B,CAAC,CAAC,CAAC,SAAS,EACzE,aAAa,EAAE,QAAQ,CAAC,CAAC,CAAC,cAAM,OAAA,QAAQ,CAAC,SAAS,CAAC,EAAnB,CAAmB,CAAC,CAAC,CAAC,SAAS,EAC/D,aAAa,EAAE,iBAAU,SAAS,CAAC,cAAc,cAAI,SAAS,CAAC,cAAc,CAAE,IAjB7E,MAAA,SAAS,CAAC,YAAY,mCACtB,UAAG,SAAS,CAAC,cAAc,cAAI,SAAS,CAAC,cAAc,CAAE,CAiB3D,CACH,CAAC;YACJ,CAAC,CAAC,IACiB,CACtB,CAAC;AACJ,CAAC,CAAC;AApDW,QAAA,sBAAsB,0BAoDjC"}
@@ -1,6 +1,27 @@
1
+ import { TReqoreBadge } from '@qoretechnologies/reqore/dist/components/Button';
1
2
  import { IReqoreIconName } from '@qoretechnologies/reqore/dist/types/icons';
2
3
  import { ReactNode } from 'react';
3
4
  import { IInterfaceReference } from './meta';
5
+ /**
6
+ * One interface in the list. A bare string is the name and nothing else — the common
7
+ * case, and what a host that has only names can keep passing. The object form adds the
8
+ * two things a name alone can't disambiguate: a `description` second line (what the
9
+ * thing is for, an owning group, a path) and a `badge` (a version, a run count, a
10
+ * status tag). Search reads both the name and the description, since both are on screen.
11
+ */
12
+ export interface IReferencePickerItem {
13
+ /** the interface name — this is what gets stored on the reference */
14
+ name: string;
15
+ /** a muted second line under the name */
16
+ description?: string;
17
+ /** trailing badge, before the add/remove icon */
18
+ badge?: TReqoreBadge | TReqoreBadge[];
19
+ }
20
+ export type TReferencePickerItem = string | IReferencePickerItem;
21
+ /** `auto` picks `stacked` from the picker's own measured width. */
22
+ export type TReferencePickerLayout = 'auto' | 'columns' | 'stacked';
23
+ /** `auto` lifts into a modal on a phone-sized viewport, when `onClose` is given. */
24
+ export type TReferencePickerPresentation = 'auto' | 'inline' | 'modal';
4
25
  export interface IReferencePickerProps {
5
26
  /** the interface kinds listed down the left pane */
6
27
  kinds: string[];
@@ -8,10 +29,11 @@ export interface IReferencePickerProps {
8
29
  kind: string;
9
30
  onKindChange: (kind: string) => void;
10
31
  /**
11
- * The selected kind's interfaces, by name. Fetching is the host's job — it knows
12
- * where they come from and how to cache them.
32
+ * The selected kind's interfaces — bare names, or objects carrying a description
33
+ * and a badge. Fetching is the host's job; it knows where they come from and how
34
+ * to cache them.
13
35
  */
14
- items: string[];
36
+ items: TReferencePickerItem[];
15
37
  /** `items` is still being fetched, so the right pane shows a spinner rather than
16
38
  * claiming the kind is empty */
17
39
  loading?: boolean;
@@ -23,19 +45,43 @@ export interface IReferencePickerProps {
23
45
  error?: string;
24
46
  /** Retry the failed fetch. The error state is pressable when given. */
25
47
  onRetry?: () => void;
26
- /** Already-picked references. Anything of the current kind that is already picked is
27
- * dropped from the right pane, so a reference can't be added twice. */
48
+ /** Already-picked references. Anything of the current kind that is already picked
49
+ * renders selected in place — never removed from the list. */
28
50
  picked?: IInterfaceReference[];
29
51
  onAdd: (reference: IInterfaceReference) => void;
52
+ /** Un-pick a reference from inside the picker. Without it a picked row still shows
53
+ * as picked, it just can't be toggled back off here. */
54
+ onRemove?: (reference: IInterfaceReference) => void;
30
55
  /** the whole picker is inert (e.g. a reply is in flight) */
31
56
  disabled?: boolean;
32
57
  /** Per-kind icon. Consumers with their own icon vocabulary (the IDE) pass one; the
33
58
  * built-in per-kind default is used when omitted. */
34
59
  resolveInterfaceIcon?: (kind: string) => IReqoreIconName;
60
+ /**
61
+ * Per-kind reading name — "Value maps" for `value-map`. The kind id is a wire value
62
+ * and never reaches the user; this is what does. Search matches both, so typing
63
+ * either the id or the label finds the kind. Defaults to the built-in Qorus
64
+ * vocabulary.
65
+ */
66
+ resolveKindLabel?: (kind: string) => string;
35
67
  /** the underline / selected-kind colour. Defaults to the support surfaces' violet. */
36
68
  accent?: string;
37
69
  /** shown above the panes — the composer's picked-reference chips, typically */
38
70
  header?: ReactNode;
71
+ /**
72
+ * Dismiss the picker. Required for the modal presentation (a modal with no way out
73
+ * is a trap); the inline presentation ignores it, since the host's own toggle is
74
+ * what closes the picker there.
75
+ */
76
+ onClose?: () => void;
77
+ /** Modal heading. */
78
+ title?: string;
79
+ /** How the panes arrange. `auto` (default) stacks below `STACK_BREAKPOINT` of the
80
+ * picker's own width; the explicit values are what stories pin. */
81
+ layout?: TReferencePickerLayout;
82
+ /** Where the picker renders. `auto` (default) goes to a modal on a phone-sized
83
+ * viewport when `onClose` is given, and stays inline otherwise. */
84
+ presentation?: TReferencePickerPresentation;
39
85
  }
40
- export declare const ReferencePicker: ({ kinds, kind, onKindChange, items, loading, error, onRetry, picked, onAdd, disabled, resolveInterfaceIcon, accent, header, }: IReferencePickerProps) => import("react/jsx-runtime").JSX.Element;
86
+ export declare const ReferencePicker: ({ kinds, kind, onKindChange, items, loading, error, onRetry, picked, onAdd, onRemove, disabled, resolveInterfaceIcon, resolveKindLabel, accent, header, onClose, title, layout, presentation, }: IReferencePickerProps) => import("react/jsx-runtime").JSX.Element;
41
87
  //# sourceMappingURL=ReferencePicker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ReferencePicker.d.ts","sourceRoot":"","sources":["../../../src/components/supportTicket/ReferencePicker.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AAGrD,OAAO,EAAwB,mBAAmB,EAAE,MAAM,QAAQ,CAAC;AA0EnE,MAAM,WAAW,qBAAqB;IACpC,oDAAoD;IACpD,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC;;;OAGG;IACH,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB;qCACiC;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uEAAuE;IACvE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;4EACwE;IACxE,MAAM,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAC/B,KAAK,EAAE,CAAC,SAAS,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAChD,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;0DACsD;IACtD,oBAAoB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,eAAe,CAAC;IACzD,sFAAsF;IACtF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+EAA+E;IAC/E,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB;AAED,eAAO,MAAM,eAAe,kIAczB,qBAAqB,4CA0GvB,CAAC"}
1
+ {"version":3,"file":"ReferencePicker.d.ts","sourceRoot":"","sources":["../../../src/components/supportTicket/ReferencePicker.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,MAAM,iDAAiD,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAC5E,OAAO,EAAE,SAAS,EAA6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