@qoretechnologies/reqraft 0.10.25 → 0.10.26
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.
- package/.claude/CLAUDE.md +52 -23
- package/design/COMPACT_ENGINE_REDESIGN.md +156 -0
- package/design/FORM_ENGINE_COMPACT_UX_PLAN.md +353 -0
- package/dist/components/FocusedEditing/index.d.ts +9 -1
- package/dist/components/FocusedEditing/index.d.ts.map +1 -1
- package/dist/components/FocusedEditing/index.js +2 -2
- package/dist/components/FocusedEditing/index.js.map +1 -1
- package/dist/components/composer/Composer.d.ts +108 -0
- package/dist/components/composer/Composer.d.ts.map +1 -0
- package/dist/components/composer/Composer.js +238 -0
- package/dist/components/composer/Composer.js.map +1 -0
- package/dist/components/composer/helpers.d.ts +21 -0
- package/dist/components/composer/helpers.d.ts.map +1 -0
- package/dist/components/composer/helpers.js +75 -0
- package/dist/components/composer/helpers.js.map +1 -0
- package/dist/components/composer/index.d.ts +3 -0
- package/dist/components/composer/index.d.ts.map +1 -0
- package/dist/components/composer/index.js +19 -0
- package/dist/components/composer/index.js.map +1 -0
- package/dist/components/form/engine/CompactRow.d.ts.map +1 -1
- package/dist/components/form/engine/CompactRow.js +307 -110
- package/dist/components/form/engine/CompactRow.js.map +1 -1
- package/dist/components/form/engine/CompactToolbar.d.ts.map +1 -1
- package/dist/components/form/engine/CompactToolbar.js +123 -106
- package/dist/components/form/engine/CompactToolbar.js.map +1 -1
- package/dist/components/form/engine/FormEngine.d.ts +107 -11
- package/dist/components/form/engine/FormEngine.d.ts.map +1 -1
- package/dist/components/form/engine/FormEngine.js +618 -179
- package/dist/components/form/engine/FormEngine.js.map +1 -1
- package/dist/components/form/engine/compactRowContext.d.ts +9 -0
- package/dist/components/form/engine/compactRowContext.d.ts.map +1 -1
- package/dist/components/form/engine/compactRowContext.js.map +1 -1
- package/dist/components/form/engine/compactRowStyles.d.ts +7 -3
- package/dist/components/form/engine/compactRowStyles.d.ts.map +1 -1
- package/dist/components/form/engine/compactRowStyles.js +88 -51
- package/dist/components/form/engine/compactRowStyles.js.map +1 -1
- package/dist/components/form/engine/compactToolbarContext.d.ts +1 -0
- package/dist/components/form/engine/compactToolbarContext.d.ts.map +1 -1
- package/dist/components/form/engine/compactToolbarContext.js.map +1 -1
- package/dist/components/form/engine/optionActions.d.ts +28 -0
- package/dist/components/form/engine/optionActions.d.ts.map +1 -0
- package/dist/components/form/engine/optionActions.js +18 -0
- package/dist/components/form/engine/optionActions.js.map +1 -0
- package/dist/components/form/engine/readFirst.d.ts +63 -2
- package/dist/components/form/engine/readFirst.d.ts.map +1 -1
- package/dist/components/form/engine/readFirst.js +121 -6
- package/dist/components/form/engine/readFirst.js.map +1 -1
- package/dist/components/form/engine/rendererTypes.d.ts +35 -0
- package/dist/components/form/engine/rendererTypes.d.ts.map +1 -0
- package/dist/components/form/engine/rendererTypes.js +63 -0
- package/dist/components/form/engine/rendererTypes.js.map +1 -0
- package/dist/components/form/engine/variants/VariantCalmTable.d.ts +6 -0
- package/dist/components/form/engine/variants/VariantCalmTable.d.ts.map +1 -0
- package/dist/components/form/engine/variants/VariantCalmTable.js +94 -0
- package/dist/components/form/engine/variants/VariantCalmTable.js.map +1 -0
- package/dist/components/form/engine/variants/VariantCards.d.ts +6 -0
- package/dist/components/form/engine/variants/VariantCards.d.ts.map +1 -0
- package/dist/components/form/engine/variants/VariantCards.js +80 -0
- package/dist/components/form/engine/variants/VariantCards.js.map +1 -0
- package/dist/components/form/engine/variants/VariantFocus.d.ts +7 -0
- package/dist/components/form/engine/variants/VariantFocus.d.ts.map +1 -0
- package/dist/components/form/engine/variants/VariantFocus.js +138 -0
- package/dist/components/form/engine/variants/VariantFocus.js.map +1 -0
- package/dist/components/form/engine/variants/VariantMinimal.d.ts +6 -0
- package/dist/components/form/engine/variants/VariantMinimal.d.ts.map +1 -0
- package/dist/components/form/engine/variants/VariantMinimal.js +73 -0
- package/dist/components/form/engine/variants/VariantMinimal.js.map +1 -0
- package/dist/components/form/engine/variants/focusDemo.d.ts +13 -0
- package/dist/components/form/engine/variants/focusDemo.d.ts.map +1 -0
- package/dist/components/form/engine/variants/focusDemo.js +139 -0
- package/dist/components/form/engine/variants/focusDemo.js.map +1 -0
- package/dist/components/form/engine/variants/variantModel.d.ts +70 -0
- package/dist/components/form/engine/variants/variantModel.d.ts.map +1 -0
- package/dist/components/form/engine/variants/variantModel.js +133 -0
- package/dist/components/form/engine/variants/variantModel.js.map +1 -0
- package/dist/components/form/engine/variants/variantParts.d.ts +79 -0
- package/dist/components/form/engine/variants/variantParts.d.ts.map +1 -0
- package/dist/components/form/engine/variants/variantParts.js +191 -0
- package/dist/components/form/engine/variants/variantParts.js.map +1 -0
- package/dist/components/form/expressions/builder/index.d.ts.map +1 -1
- package/dist/components/form/expressions/builder/index.js +13 -2
- package/dist/components/form/expressions/builder/index.js.map +1 -1
- package/dist/components/form/expressions/useExpressions.d.ts.map +1 -1
- package/dist/components/form/expressions/useExpressions.js +4 -1
- package/dist/components/form/expressions/useExpressions.js.map +1 -1
- package/dist/components/form/fields/Field.d.ts.map +1 -1
- package/dist/components/form/fields/Field.js +5 -3
- package/dist/components/form/fields/Field.js.map +1 -1
- package/dist/components/form/fields/allowed-values/AllowedValues.d.ts +2 -1
- package/dist/components/form/fields/allowed-values/AllowedValues.d.ts.map +1 -1
- package/dist/components/form/fields/allowed-values/AllowedValues.js +8 -26
- package/dist/components/form/fields/allowed-values/AllowedValues.js.map +1 -1
- package/dist/components/form/fields/auto/AutoFormField.d.ts +3 -0
- package/dist/components/form/fields/auto/AutoFormField.d.ts.map +1 -1
- package/dist/components/form/fields/auto/AutoFormField.js +42 -8
- package/dist/components/form/fields/auto/AutoFormField.js.map +1 -1
- package/dist/components/form/fields/binary/Binary.d.ts +15 -0
- package/dist/components/form/fields/binary/Binary.d.ts.map +1 -0
- package/dist/components/form/fields/binary/Binary.js +74 -0
- package/dist/components/form/fields/binary/Binary.js.map +1 -0
- package/dist/components/form/fields/boolean/Boolean.js +1 -1
- package/dist/components/form/fields/boolean/Boolean.js.map +1 -1
- package/dist/components/form/fields/multi-select/MultiSelectFormField.d.ts.map +1 -1
- package/dist/components/form/fields/multi-select/MultiSelectFormField.js +5 -4
- package/dist/components/form/fields/multi-select/MultiSelectFormField.js.map +1 -1
- package/dist/components/form/fields/select/Select.d.ts.map +1 -1
- package/dist/components/form/fields/select/Select.js +29 -12
- package/dist/components/form/fields/select/Select.js.map +1 -1
- package/dist/components/form/fields/select/SelectCollection.d.ts +8 -2
- package/dist/components/form/fields/select/SelectCollection.d.ts.map +1 -1
- package/dist/components/form/fields/select/SelectCollection.js +52 -16
- package/dist/components/form/fields/select/SelectCollection.js.map +1 -1
- package/dist/components/form/index.d.ts +2 -0
- package/dist/components/form/index.d.ts.map +1 -1
- package/dist/components/form/index.js +2 -0
- package/dist/components/form/index.js.map +1 -1
- package/dist/components/imageLightbox/ImageLightbox.d.ts +21 -0
- package/dist/components/imageLightbox/ImageLightbox.d.ts.map +1 -0
- package/dist/components/imageLightbox/ImageLightbox.js +169 -0
- package/dist/components/imageLightbox/ImageLightbox.js.map +1 -0
- package/dist/components/imageLightbox/index.d.ts +2 -0
- package/dist/components/imageLightbox/index.d.ts.map +1 -0
- package/dist/components/imageLightbox/index.js +18 -0
- package/dist/components/imageLightbox/index.js.map +1 -0
- package/dist/components/searchFilterBar/SearchFilterBar.d.ts +33 -0
- package/dist/components/searchFilterBar/SearchFilterBar.d.ts.map +1 -0
- package/dist/components/searchFilterBar/SearchFilterBar.js +76 -0
- package/dist/components/searchFilterBar/SearchFilterBar.js.map +1 -0
- package/dist/components/searchFilterBar/index.d.ts +2 -0
- package/dist/components/searchFilterBar/index.d.ts.map +1 -0
- package/dist/components/searchFilterBar/index.js +18 -0
- package/dist/components/searchFilterBar/index.js.map +1 -0
- package/dist/components/supportTicket/AttachmentChips.d.ts +10 -0
- package/dist/components/supportTicket/AttachmentChips.d.ts.map +1 -0
- package/dist/components/supportTicket/AttachmentChips.js +122 -0
- package/dist/components/supportTicket/AttachmentChips.js.map +1 -0
- package/dist/components/supportTicket/InterfaceReferenceTags.d.ts +43 -0
- package/dist/components/supportTicket/InterfaceReferenceTags.d.ts.map +1 -0
- package/dist/components/supportTicket/InterfaceReferenceTags.js +31 -0
- package/dist/components/supportTicket/InterfaceReferenceTags.js.map +1 -0
- package/dist/components/supportTicket/ReferencePicker.d.ts +87 -0
- package/dist/components/supportTicket/ReferencePicker.d.ts.map +1 -0
- package/dist/components/supportTicket/ReferencePicker.js +295 -0
- package/dist/components/supportTicket/ReferencePicker.js.map +1 -0
- package/dist/components/supportTicket/TicketHeader.d.ts +86 -0
- package/dist/components/supportTicket/TicketHeader.d.ts.map +1 -0
- package/dist/components/supportTicket/TicketHeader.js +149 -0
- package/dist/components/supportTicket/TicketHeader.js.map +1 -0
- package/dist/components/supportTicket/TicketMetaTags.d.ts +32 -0
- package/dist/components/supportTicket/TicketMetaTags.d.ts.map +1 -0
- package/dist/components/supportTicket/TicketMetaTags.js +21 -0
- package/dist/components/supportTicket/TicketMetaTags.js.map +1 -0
- package/dist/components/supportTicket/TicketReplyBox.d.ts +63 -0
- package/dist/components/supportTicket/TicketReplyBox.d.ts.map +1 -0
- package/dist/components/supportTicket/TicketReplyBox.js +115 -0
- package/dist/components/supportTicket/TicketReplyBox.js.map +1 -0
- package/dist/components/supportTicket/attachmentAccess.d.ts +37 -0
- package/dist/components/supportTicket/attachmentAccess.d.ts.map +1 -0
- package/dist/components/supportTicket/attachmentAccess.js +132 -0
- package/dist/components/supportTicket/attachmentAccess.js.map +1 -0
- package/dist/components/supportTicket/fileToAttachment.d.ts +9 -0
- package/dist/components/supportTicket/fileToAttachment.d.ts.map +1 -0
- package/dist/components/supportTicket/fileToAttachment.js +28 -0
- package/dist/components/supportTicket/fileToAttachment.js.map +1 -0
- package/dist/components/supportTicket/index.d.ts +11 -0
- package/dist/components/supportTicket/index.d.ts.map +1 -0
- package/dist/components/supportTicket/index.js +27 -0
- package/dist/components/supportTicket/index.js.map +1 -0
- package/dist/components/supportTicket/meta.d.ts +71 -0
- package/dist/components/supportTicket/meta.d.ts.map +1 -0
- package/dist/components/supportTicket/meta.js +115 -0
- package/dist/components/supportTicket/meta.js.map +1 -0
- package/dist/components/supportTicket/ticketModel.d.ts +102 -0
- package/dist/components/supportTicket/ticketModel.d.ts.map +1 -0
- package/dist/components/supportTicket/ticketModel.js +3 -0
- package/dist/components/supportTicket/ticketModel.js.map +1 -0
- package/dist/components/ticketReferences/TicketReferences.d.ts +52 -0
- package/dist/components/ticketReferences/TicketReferences.d.ts.map +1 -0
- package/dist/components/ticketReferences/TicketReferences.js +492 -0
- package/dist/components/ticketReferences/TicketReferences.js.map +1 -0
- package/dist/components/ticketReferences/index.d.ts +3 -0
- package/dist/components/ticketReferences/index.d.ts.map +1 -0
- package/dist/components/ticketReferences/index.js +6 -0
- package/dist/components/ticketReferences/index.js.map +1 -0
- package/dist/components/ticketThread/TicketThread.d.ts +57 -0
- package/dist/components/ticketThread/TicketThread.d.ts.map +1 -0
- package/dist/components/ticketThread/TicketThread.js +299 -0
- package/dist/components/ticketThread/TicketThread.js.map +1 -0
- package/dist/components/ticketThread/index.d.ts +3 -0
- package/dist/components/ticketThread/index.d.ts.map +1 -0
- package/dist/components/ticketThread/index.js +7 -0
- package/dist/components/ticketThread/index.js.map +1 -0
- package/dist/helpers/common.d.ts +5 -0
- package/dist/helpers/common.d.ts.map +1 -1
- package/dist/helpers/common.js +20 -1
- package/dist/helpers/common.js.map +1 -1
- package/dist/helpers/scrollbar.d.ts +2 -0
- package/dist/helpers/scrollbar.d.ts.map +1 -0
- package/dist/helpers/scrollbar.js +25 -0
- package/dist/helpers/scrollbar.js.map +1 -0
- package/dist/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -1
- package/dist/index.js.map +1 -1
- package/dist/providers/StorageProvider.d.ts +13 -0
- package/dist/providers/StorageProvider.d.ts.map +1 -1
- package/dist/providers/StorageProvider.js +29 -5
- package/dist/providers/StorageProvider.js.map +1 -1
- package/package.json +6 -5
- package/src/components/FocusedEditing/index.tsx +17 -2
- package/src/components/composer/Composer.stories.tsx +238 -0
- package/src/components/composer/Composer.tsx +545 -0
- package/src/components/composer/helpers.ts +74 -0
- package/src/components/composer/index.ts +2 -0
- package/src/components/dpqlEditor/DpqlEditor.stories.tsx +74 -2
- package/src/components/form/engine/CompactRow.tsx +561 -283
- package/src/components/form/engine/CompactToolbar.tsx +216 -182
- package/src/components/form/engine/FormEngine.stories.tsx +1736 -162
- package/src/components/form/engine/FormEngine.tsx +886 -170
- package/src/components/form/engine/FormEngineRemote.stories.tsx +377 -0
- package/src/components/form/engine/_structuredData/StructuredDataView.stories.tsx +8 -0
- package/src/components/form/engine/compactRowContext.ts +14 -0
- package/src/components/form/engine/compactRowStyles.ts +273 -146
- package/src/components/form/engine/compactToolbarContext.ts +1 -0
- package/src/components/form/engine/optionActions.ts +40 -0
- package/src/components/form/engine/readFirst.ts +169 -10
- package/src/components/form/engine/rendererTypes.ts +55 -0
- package/src/components/form/engine/variants/FormEngineVariants.stories.tsx +159 -0
- package/src/components/form/engine/variants/VariantCalmTable.tsx +242 -0
- package/src/components/form/engine/variants/VariantCards.tsx +212 -0
- package/src/components/form/engine/variants/VariantFocus.tsx +382 -0
- package/src/components/form/engine/variants/VariantMinimal.tsx +170 -0
- package/src/components/form/engine/variants/focusDemo.ts +145 -0
- package/src/components/form/engine/variants/variantModel.ts +216 -0
- package/src/components/form/engine/variants/variantParts.tsx +313 -0
- package/src/components/form/expressions/ExpressionField.stories.tsx +84 -2
- package/src/components/form/expressions/builder/ExpressionBuilder.stories.tsx +213 -19
- package/src/components/form/expressions/builder/index.tsx +12 -1
- package/src/components/form/expressions/useExpressions.ts +4 -1
- package/src/components/form/fields/Field.stories.tsx +40 -0
- package/src/components/form/fields/Field.tsx +10 -1
- package/src/components/form/fields/allowed-values/AllowedValues.tsx +13 -36
- package/src/components/form/fields/array/ArrayAutoField.stories.tsx +64 -0
- package/src/components/form/fields/auto/AutoFormField.stories.tsx +146 -2
- package/src/components/form/fields/auto/AutoFormField.tsx +42 -1
- package/src/components/form/fields/binary/Binary.stories.tsx +122 -0
- package/src/components/form/fields/binary/Binary.tsx +81 -0
- package/src/components/form/fields/boolean/Boolean.stories.tsx +58 -0
- package/src/components/form/fields/boolean/Boolean.tsx +1 -1
- package/src/components/form/fields/byte-size/ByteSize.stories.tsx +24 -0
- package/src/components/form/fields/color/Color.stories.tsx +30 -0
- package/src/components/form/fields/cron/Cron.stories.tsx +8 -0
- package/src/components/form/fields/date/Date.stories.tsx +22 -0
- package/src/components/form/fields/file/File.stories.tsx +48 -0
- package/src/components/form/fields/long-string/LongString.stories.tsx +24 -0
- package/src/components/form/fields/markdown/Markdown.stories.tsx +8 -0
- package/src/components/form/fields/multi-select/MultiSelectFormField.tsx +14 -10
- package/src/components/form/fields/number/Number.stories.tsx +31 -0
- package/src/components/form/fields/object/Object.stories.tsx +88 -0
- package/src/components/form/fields/radio-group/RadioGroup.stories.tsx +24 -0
- package/src/components/form/fields/rich-text/RichText.stories.tsx +23 -0
- package/src/components/form/fields/schema-definition/SchemaDefinitionField.stories.tsx +72 -0
- package/src/components/form/fields/select/Select.stories.tsx +108 -0
- package/src/components/form/fields/select/Select.tsx +38 -12
- package/src/components/form/fields/select/SelectCollection.tsx +78 -17
- package/src/components/form/fields/string/String.stories.tsx +16 -0
- package/src/components/form/fields/template/TemplateField.stories.tsx +160 -0
- package/src/components/form/fields/url/Url.stories.tsx +24 -0
- package/src/components/form/index.tsx +2 -0
- package/src/components/imageLightbox/ImageLightbox.stories.tsx +238 -0
- package/src/components/imageLightbox/ImageLightbox.tsx +236 -0
- package/src/components/imageLightbox/index.ts +1 -0
- package/src/components/log/Log.stories.tsx +96 -0
- package/src/components/menu/Menu.stories.tsx +54 -0
- package/src/components/qonsoleSmartInput/QonsoleSmartInput.stories.tsx +83 -37
- package/src/components/searchFilterBar/SearchFilterBar.tsx +131 -0
- package/src/components/searchFilterBar/index.ts +1 -0
- package/src/components/smartEditor/SmartEditor.stories.tsx +32 -0
- package/src/components/supportTicket/AttachmentChips.stories.tsx +171 -0
- package/src/components/supportTicket/AttachmentChips.tsx +147 -0
- package/src/components/supportTicket/InterfaceReferenceTags.stories.tsx +171 -0
- package/src/components/supportTicket/InterfaceReferenceTags.tsx +96 -0
- package/src/components/supportTicket/ReferencePicker.stories.tsx +519 -0
- package/src/components/supportTicket/ReferencePicker.tsx +563 -0
- package/src/components/supportTicket/TicketConversation.stories.tsx +121 -0
- package/src/components/supportTicket/TicketHeader.stories.tsx +183 -0
- package/src/components/supportTicket/TicketHeader.tsx +247 -0
- package/src/components/supportTicket/TicketMetaTags.stories.tsx +103 -0
- package/src/components/supportTicket/TicketMetaTags.tsx +85 -0
- package/src/components/supportTicket/TicketReplyBox.stories.tsx +351 -0
- package/src/components/supportTicket/TicketReplyBox.tsx +146 -0
- package/src/components/supportTicket/attachmentAccess.ts +97 -0
- package/src/components/supportTicket/fileToAttachment.ts +24 -0
- package/src/components/supportTicket/index.ts +10 -0
- package/src/components/supportTicket/meta.ts +185 -0
- package/src/components/supportTicket/ticketModel.ts +131 -0
- package/src/components/ticketReferences/TicketReferences.stories.tsx +315 -0
- package/src/components/ticketReferences/TicketReferences.tsx +886 -0
- package/src/components/ticketReferences/index.ts +2 -0
- package/src/components/ticketThread/TicketThread.stories.tsx +828 -0
- package/src/components/ticketThread/TicketThread.tsx +704 -0
- package/src/components/ticketThread/index.ts +6 -0
- package/src/helpers/common.ts +19 -0
- package/src/helpers/scrollbar.ts +32 -0
- package/src/hooks/useFetch/useFetch.stories.tsx +30 -0
- package/src/hooks/useStorage/useStorage.stories.tsx +82 -0
- package/src/hooks/useWebSocket/useWebsocket.stories.tsx +127 -1
- package/src/index.tsx +8 -1
- package/src/providers/StorageProvider.tsx +30 -4
- package/src/stores/currentUser/currentUser.stories.tsx +49 -0
|
@@ -0,0 +1,149 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
7
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.TicketHeaderText = exports.TicketHeader = exports.ticketTabBadge = exports.TICKET_TAB_ALIGN = exports.TicketTabsFrame = exports.ticketInitials = exports.TicketAvatar = exports.TicketPersonValue = exports.TicketMonoId = exports.TICKET_RAIL_ROW_HEIGHT = void 0;
|
|
11
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
12
|
+
var reqore_1 = require("@qoretechnologies/reqore");
|
|
13
|
+
var sizes_1 = require("@qoretechnologies/reqore/dist/constants/sizes");
|
|
14
|
+
var styled_components_1 = __importDefault(require("styled-components"));
|
|
15
|
+
/*
|
|
16
|
+
* The header every ticket surface puts above its tabs: the subject, the ticket's
|
|
17
|
+
* number, and a rail of labelled properties.
|
|
18
|
+
*
|
|
19
|
+
* Shared because it had already drifted. The staff drawer's header was redesigned
|
|
20
|
+
* into this definition-list rail while the customer's kept a heading, a tag row and
|
|
21
|
+
* a muted meta line — the same information, two layouts, and no way to change one
|
|
22
|
+
* without hand-copying it into the other. What each surface shows differs (staff
|
|
23
|
+
* edit the assignee; a customer reads who opened the ticket), so the rows are the
|
|
24
|
+
* caller's; the frame, the rhythm and the alignment rules are not.
|
|
25
|
+
*/
|
|
26
|
+
/** How wide the label column is. Fits "References" — the longest label in use. */
|
|
27
|
+
var LABEL_WIDTH = '84px';
|
|
28
|
+
/** Everything in the rail runs at one scale. */
|
|
29
|
+
var RAIL_SIZE = 'small';
|
|
30
|
+
/** Breathing room above and below each row's control — the rail's vertical rhythm. */
|
|
31
|
+
var ROW_PADDING = 4;
|
|
32
|
+
/**
|
|
33
|
+
* The height a tab item needs to sit on the rail's rhythm.
|
|
34
|
+
*
|
|
35
|
+
* Exported because the tab strip below the header has to match it and there is no
|
|
36
|
+
* Reqore prop for a tab's height: `size` sets it, and `padded` governs the items'
|
|
37
|
+
* horizontal edges, not the strip's. The height must go on the ITEM, never on the
|
|
38
|
+
* list — both of a tab's own surfaces are keyed to the item's box (the active marker
|
|
39
|
+
* is an inset shadow on its bottom edge, the hover wash fills it), so padding the
|
|
40
|
+
* list leaves the item floating in a taller strip: the marker lifts off the hairline
|
|
41
|
+
* and reads as a doubled line, and the wash reads as a floating box.
|
|
42
|
+
*
|
|
43
|
+
* This belongs in Reqore as a tab-height option rather than as a CSS rule each
|
|
44
|
+
* consumer re-applies. Until it exists, `TicketTabsFrame` is the single copy.
|
|
45
|
+
*/
|
|
46
|
+
exports.TICKET_RAIL_ROW_HEIGHT = sizes_1.SIZE_TO_PX[RAIL_SIZE] + ROW_PADDING * 2;
|
|
47
|
+
/** The ticket number, set in mono so it reads as an identifier, not a heading. Exported
|
|
48
|
+
* so the staff drawer (which puts the number in the drawer's own title, not the rail)
|
|
49
|
+
* renders it identically rather than re-declaring the same span. */
|
|
50
|
+
exports.TicketMonoId = styled_components_1.default.span(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;\n font-size: 11.5px;\n color: rgba(255, 255, 255, 0.45);\n"], ["\n font-family: ui-monospace, 'SF Mono', 'Menlo', monospace;\n font-size: 11.5px;\n color: rgba(255, 255, 255, 0.45);\n"])));
|
|
51
|
+
/**
|
|
52
|
+
* A person: initials disc, then the name, on one baseline.
|
|
53
|
+
*
|
|
54
|
+
* One wrapper for every person in the rail — the assignee, the customer, the author.
|
|
55
|
+
* They were visibly different before: one went through a nested control group inside
|
|
56
|
+
* a button (its own gap and alignment) while another used a plain flex row, so the
|
|
57
|
+
* two drifted apart every time either was touched. The only difference left is that
|
|
58
|
+
* some of them are pressable.
|
|
59
|
+
*/
|
|
60
|
+
exports.TicketPersonValue = styled_components_1.default.span(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n gap: 6px;\n min-width: 0;\n\n /* the name yields before the disc does */\n > span:last-child {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n"], ["\n display: inline-flex;\n align-items: center;\n gap: 6px;\n min-width: 0;\n\n /* the name yields before the disc does */\n > span:last-child {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n"])));
|
|
61
|
+
/** Initials disc for a person. */
|
|
62
|
+
exports.TicketAvatar = styled_components_1.default.span(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n width: 18px;\n height: 18px;\n border-radius: 999px;\n flex: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n font-size: 8px;\n font-weight: 650;\n color: #fff;\n background: linear-gradient(150deg, #8a4fe6, #2c1140);\n border: 1px solid rgba(255, 255, 255, 0.14);\n"], ["\n width: 18px;\n height: 18px;\n border-radius: 999px;\n flex: none;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n font-size: 8px;\n font-weight: 650;\n color: #fff;\n background: linear-gradient(150deg, #8a4fe6, #2c1140);\n border: 1px solid rgba(255, 255, 255, 0.14);\n"])));
|
|
63
|
+
/**
|
|
64
|
+
* Up to two initials from a handle ("nick.m@acme.io" → "NM"). Falls back to "?" so a
|
|
65
|
+
* handle made entirely of separators still renders a disc rather than an empty circle.
|
|
66
|
+
*/
|
|
67
|
+
var ticketInitials = function (name) {
|
|
68
|
+
return name
|
|
69
|
+
.split(/[\s._@-]+/)
|
|
70
|
+
.filter(Boolean)
|
|
71
|
+
.slice(0, 2)
|
|
72
|
+
.map(function (part) { var _a, _b; return (_b = (_a = part[0]) === null || _a === void 0 ? void 0 : _a.toUpperCase()) !== null && _b !== void 0 ? _b : ''; })
|
|
73
|
+
.join('') || '?';
|
|
74
|
+
};
|
|
75
|
+
exports.ticketInitials = ticketInitials;
|
|
76
|
+
/**
|
|
77
|
+
* Wraps a ticket surface's tab strip so it joins the header rail's rhythm.
|
|
78
|
+
*
|
|
79
|
+
* See `TICKET_RAIL_ROW_HEIGHT` for why the height goes on the item and not the list.
|
|
80
|
+
*/
|
|
81
|
+
exports.TicketTabsFrame = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n flex: 1;\n min-height: 0;\n\n .reqore-tabs-list {\n padding-top: 0;\n padding-bottom: 0;\n }\n\n .reqore-tabs-list-item {\n min-height: ", "px;\n }\n"], ["\n display: flex;\n flex-direction: column;\n flex: 1;\n min-height: 0;\n\n .reqore-tabs-list {\n padding-top: 0;\n padding-bottom: 0;\n }\n\n .reqore-tabs-list-item {\n min-height: ", "px;\n }\n"])), exports.TICKET_RAIL_ROW_HEIGHT);
|
|
82
|
+
/*
|
|
83
|
+
* Centre each tab's icon + label + count.
|
|
84
|
+
*
|
|
85
|
+
* With `fill`, every tab is far wider than its content, and ReqoreButton defaults
|
|
86
|
+
* `textAlign` to 'left' for non-square buttons — which also hands the leading icon a
|
|
87
|
+
* `margin-right: auto`, pinning the group against the left edge of its tab. Setting
|
|
88
|
+
* both alignments centres the group as a unit, so the strip reads as evenly spaced
|
|
89
|
+
* segments rather than left-huddled labels.
|
|
90
|
+
*/
|
|
91
|
+
exports.TICKET_TAB_ALIGN = {
|
|
92
|
+
textAlign: 'center',
|
|
93
|
+
iconsAlign: 'center',
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* A tab's count pill. The active tab's carries the accent; the rest stay neutral, so
|
|
97
|
+
* the strip reads as one selected item rather than several competing chips. Returns
|
|
98
|
+
* `undefined` for an empty count — a tab with nothing in it shows no badge at all.
|
|
99
|
+
*/
|
|
100
|
+
var ticketTabBadge = function (count, isActive, accent) {
|
|
101
|
+
if (!count) {
|
|
102
|
+
return undefined;
|
|
103
|
+
}
|
|
104
|
+
if (!isActive || !accent) {
|
|
105
|
+
return count;
|
|
106
|
+
}
|
|
107
|
+
return { label: count, color: accent.glow, effect: { color: accent.color } };
|
|
108
|
+
};
|
|
109
|
+
exports.ticketTabBadge = ticketTabBadge;
|
|
110
|
+
var TicketHeader = function (_a) {
|
|
111
|
+
var subject = _a.subject, reference = _a.reference, properties = _a.properties, _b = _a.padding, padding = _b === void 0 ? 14 : _b, className = _a.className;
|
|
112
|
+
return ((0, jsx_runtime_1.jsx)(reqore_1.ReqoreDescriptionList
|
|
113
|
+
/* The rail IS a description list — Reqore's, not a private copy. `contentSize`
|
|
114
|
+
is what makes it tabular with controls in it: it reserves a control's height on
|
|
115
|
+
every row and insets the values that aren't controls, so a dropdown row and a
|
|
116
|
+
plain-text row share both a height and a left edge. */
|
|
117
|
+
, {
|
|
118
|
+
/* The rail IS a description list — Reqore's, not a private copy. `contentSize`
|
|
119
|
+
is what makes it tabular with controls in it: it reserves a control's height on
|
|
120
|
+
every row and insets the values that aren't controls, so a dropdown row and a
|
|
121
|
+
plain-text row share both a height and a left edge. */
|
|
122
|
+
contentSize: RAIL_SIZE, size: RAIL_SIZE,
|
|
123
|
+
/* Labels are reference furniture, quieter and smaller than the values they name —
|
|
124
|
+
and "References" has to fit LABEL_WIDTH on one line at this scale. */
|
|
125
|
+
labelTextSize: 'tiny',
|
|
126
|
+
/* The rail's rhythm, which the tab strip below is measured against — see
|
|
127
|
+
TICKET_RAIL_ROW_HEIGHT. Reqore's comfortable default would make the rows 52px
|
|
128
|
+
and the strip would no longer line up with them. */
|
|
129
|
+
rowPadding: 'tiny', labelWidth: LABEL_WIDTH, uppercaseLabels: true, flat: true, transparent: true, padded: false, contentStyle: { padding: "".concat(padding - 4, "px ").concat(padding, "px ").concat(padding - 6, "px") }, className: "".concat(className || '', " ticket-header"), label: subject ? (
|
|
130
|
+
/* The label is the panel's heading, which `padded={false}` leaves flush against
|
|
131
|
+
the edge — `contentStyle` only pads the rows. Pad the subject here so it lines
|
|
132
|
+
up with the values below it, using the same horizontal `padding` as the rows. */
|
|
133
|
+
(0, jsx_runtime_1.jsx)("div", { style: { padding: "".concat(padding, "px ").concat(padding, "px ").concat(padding - 8, "px"), minWidth: 0 }, children: (0, jsx_runtime_1.jsxs)(reqore_1.ReqoreControlGroup, { verticalAlign: 'center', gapSize: 'small', children: [(0, jsx_runtime_1.jsx)("span", { children: subject }), reference ? (0, jsx_runtime_1.jsx)(exports.TicketMonoId, { children: reference }) : null] }) })) : undefined, items: properties
|
|
134
|
+
.filter(function (property) { return property.when !== false; })
|
|
135
|
+
.map(function (property) { return ({
|
|
136
|
+
key: property.label,
|
|
137
|
+
label: property.label,
|
|
138
|
+
content: property.value,
|
|
139
|
+
}); }) }));
|
|
140
|
+
};
|
|
141
|
+
exports.TicketHeader = TicketHeader;
|
|
142
|
+
/** A rail value that is plain text rather than a control — sized to match the rest. */
|
|
143
|
+
var TicketHeaderText = function (_a) {
|
|
144
|
+
var children = _a.children, muted = _a.muted, tooltip = _a.tooltip;
|
|
145
|
+
return ((0, jsx_runtime_1.jsx)(reqore_1.ReqoreSpan, { size: RAIL_SIZE, tooltip: tooltip, effect: muted ? { opacity: 0.5 } : undefined, children: children }));
|
|
146
|
+
};
|
|
147
|
+
exports.TicketHeaderText = TicketHeaderText;
|
|
148
|
+
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
149
|
+
//# sourceMappingURL=TicketHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TicketHeader.js","sourceRoot":"","sources":["../../../src/components/supportTicket/TicketHeader.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,mDAIkC;AAGlC,uEAA2E;AAE3E,wEAAuC;AAEvC;;;;;;;;;;GAUG;AAEH,kFAAkF;AAClF,IAAM,WAAW,GAAG,MAAM,CAAC;AAC3B,gDAAgD;AAChD,IAAM,SAAS,GAAG,OAAgB,CAAC;AACnC,sFAAsF;AACtF,IAAM,WAAW,GAAG,CAAC,CAAC;AAEt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,KAAK,KAAK,EAAvB,CAAuB,CAAC;aAC7C,GAAG,CAAC,UAAC,QAAQ,IAAK,OAAA,CAAC;YAClB,GAAG,EAAE,QAAQ,CAAC,KAAK;YACnB,KAAK,EAAE,QAAQ,CAAC,KAAK;YACrB,OAAO,EAAE,QAAQ,CAAC,KAAK;SACxB,CAAC,EAJiB,CAIjB,CAAC,GACL,CACH;AA3CyB,CA2CzB,CAAC;AAjDW,QAAA,YAAY,gBAiDvB;AAEF,uFAAuF;AAChF,IAAM,gBAAgB,GAAG,UAAC,EAShC;QARC,QAAQ,cAAA,EACR,KAAK,WAAA,EACL,OAAO,aAAA;IAMH,OAAA,CACJ,uBAAC,mBAAU,IAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,SAAS,YACxF,QAAQ,GACE,CACd;AAJK,CAIL,CAAC;AAbW,QAAA,gBAAgB,oBAa3B"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { TSizes } from '@qoretechnologies/reqore/dist/constants/sizes';
|
|
2
|
+
import { TTicketCategory, TTicketPriority, TTicketStatus, TTicketViewerRole } from './meta';
|
|
3
|
+
export interface ITicketMetaTagsProps {
|
|
4
|
+
/** The three enum values to badge — a full ticket satisfies this structurally. */
|
|
5
|
+
ticket: {
|
|
6
|
+
status: TTicketStatus;
|
|
7
|
+
priority: TTicketPriority;
|
|
8
|
+
category: TTicketCategory;
|
|
9
|
+
};
|
|
10
|
+
/** Picks audience-specific labels (e.g. "Awaiting your reply" vs "Awaiting
|
|
11
|
+
* customer"). Omit for the staff / neutral wording. */
|
|
12
|
+
viewerRole?: TTicketViewerRole;
|
|
13
|
+
size?: TSizes;
|
|
14
|
+
/** Hide the category tag (e.g. in a dense list row). */
|
|
15
|
+
hideCategory?: boolean;
|
|
16
|
+
/** Reqore's subtle tag style — the intent colour as text on a faint wash,
|
|
17
|
+
* instead of a solid intent fill. Defaults to `true`; pass `false` for the
|
|
18
|
+
* old solid chips. */
|
|
19
|
+
minimal?: boolean;
|
|
20
|
+
/** Whether the tags are borderless (Reqore's `flat`). Defaults to `false` here,
|
|
21
|
+
* so tags carry a border — a shade lighter than the fill — which keeps the
|
|
22
|
+
* `minimal` tags legible. Pass `true` for no border. */
|
|
23
|
+
flat?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The status / priority / category badge row for a ticket — the single place the
|
|
27
|
+
* three enum vocabularies (`../supportTicket/meta`) turn into Reqore tags, so the
|
|
28
|
+
* customer list, the staff queue, the detail header and the Qonsole card all read
|
|
29
|
+
* identically. Each tag's label, intent and icon come from the shared meta maps.
|
|
30
|
+
*/
|
|
31
|
+
export declare const TicketMetaTags: ({ ticket, viewerRole, size, hideCategory, minimal, flat, }: ITicketMetaTagsProps) => import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
//# sourceMappingURL=TicketMetaTags.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TicketMetaTags.d.ts","sourceRoot":"","sources":["../../../src/components/supportTicket/TicketMetaTags.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,+CAA+C,CAAC;AACvE,OAAO,EAKL,eAAe,EACf,eAAe,EACf,aAAa,EACb,iBAAiB,EAClB,MAAM,QAAQ,CAAC;AAEhB,MAAM,WAAW,oBAAoB;IACnC,kFAAkF;IAClF,MAAM,EAAE;QACN,MAAM,EAAE,aAAa,CAAC;QACtB,QAAQ,EAAE,eAAe,CAAC;QAC1B,QAAQ,EAAE,eAAe,CAAC;KAC3B,CAAC;IACF;4DACwD;IACxD,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wDAAwD;IACxD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;2BAEuB;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;6DAEyD;IACzD,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc,+DAOxB,oBAAoB,4CAmCtB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TicketMetaTags = void 0;
|
|
4
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
var reqore_1 = require("@qoretechnologies/reqore");
|
|
6
|
+
var meta_1 = require("./meta");
|
|
7
|
+
/**
|
|
8
|
+
* The status / priority / category badge row for a ticket — the single place the
|
|
9
|
+
* three enum vocabularies (`../supportTicket/meta`) turn into Reqore tags, so the
|
|
10
|
+
* customer list, the staff queue, the detail header and the Qonsole card all read
|
|
11
|
+
* identically. Each tag's label, intent and icon come from the shared meta maps.
|
|
12
|
+
*/
|
|
13
|
+
var TicketMetaTags = function (_a) {
|
|
14
|
+
var ticket = _a.ticket, viewerRole = _a.viewerRole, _b = _a.size, size = _b === void 0 ? 'small' : _b, hideCategory = _a.hideCategory, _c = _a.minimal, minimal = _c === void 0 ? true : _c, _d = _a.flat, flat = _d === void 0 ? false : _d;
|
|
15
|
+
var status = meta_1.TICKET_STATUS_META[ticket.status];
|
|
16
|
+
var priority = meta_1.TICKET_PRIORITY_META[ticket.priority];
|
|
17
|
+
var category = meta_1.TICKET_CATEGORY_META[ticket.category];
|
|
18
|
+
return ((0, jsx_runtime_1.jsxs)(reqore_1.ReqoreControlGroup, { size: size, wrap: true, children: [(0, jsx_runtime_1.jsx)(reqore_1.ReqoreTag, { icon: status.icon, intent: status.intent, label: (0, meta_1.ticketStatusLabel)(ticket.status, viewerRole), size: size, minimal: minimal, flat: flat, effect: { weight: 'bold' } }), (0, jsx_runtime_1.jsx)(reqore_1.ReqoreTag, { icon: priority.icon, intent: priority.intent, label: priority.label, size: size, minimal: minimal, flat: flat }), !hideCategory && ((0, jsx_runtime_1.jsx)(reqore_1.ReqoreTag, { icon: category.icon, label: category.label, size: size, minimal: minimal, flat: flat }))] }));
|
|
19
|
+
};
|
|
20
|
+
exports.TicketMetaTags = TicketMetaTags;
|
|
21
|
+
//# sourceMappingURL=TicketMetaTags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TicketMetaTags.js","sourceRoot":"","sources":["../../../src/components/supportTicket/TicketMetaTags.tsx"],"names":[],"mappings":";;;;AAAA,mDAAyE;AAEzE,+BASgB;AAyBhB;;;;;GAKG;AACI,IAAM,cAAc,GAAG,UAAC,EAOR;QANrB,MAAM,YAAA,EACN,UAAU,gBAAA,EACV,YAAc,EAAd,IAAI,mBAAG,OAAO,KAAA,EACd,YAAY,kBAAA,EACZ,eAAc,EAAd,OAAO,mBAAG,IAAI,KAAA,EACd,YAAY,EAAZ,IAAI,mBAAG,KAAK,KAAA;IAEZ,IAAM,MAAM,GAAG,yBAAkB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACjD,IAAM,QAAQ,GAAG,2BAAoB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACvD,IAAM,QAAQ,GAAG,2BAAoB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAEvD,OAAO,CACL,wBAAC,2BAAkB,IAAC,IAAI,EAAE,IAAI,EAAE,IAAI,mBAClC,uBAAC,kBAAS,IACR,IAAI,EAAE,MAAM,CAAC,IAAI,EACjB,MAAM,EAAE,MAAM,CAAC,MAAM,EACrB,KAAK,EAAE,IAAA,wBAAiB,EAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,EACnD,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,GAC1B,EACF,uBAAC,kBAAS,IACR,IAAI,EAAE,QAAQ,CAAC,IAAI,EACnB,MAAM,EAAE,QAAQ,CAAC,MAAM,EACvB,KAAK,EAAE,QAAQ,CAAC,KAAK,EACrB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,GACV,EACD,CAAC,YAAY,IAAI,CAChB,uBAAC,kBAAS,IACR,IAAI,EAAE,QAAQ,CAAC,IAAI,EACnB,KAAK,EAAE,QAAQ,CAAC,KAAK,EACrB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,GACV,CACH,IACkB,CACtB,CAAC;AACJ,CAAC,CAAC;AA1CW,QAAA,cAAc,kBA0CzB"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { ReqoreDropdown } from '@qoretechnologies/reqore';
|
|
2
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
3
|
+
import { TComposerEditor } from '../composer/Composer';
|
|
4
|
+
import { IAttachmentUpload } from './meta';
|
|
5
|
+
/** The exact `items` shape ReqoreDropdown accepts — no import-path guessing. */
|
|
6
|
+
type TAttachMenuItems = NonNullable<ComponentProps<typeof ReqoreDropdown>['items']>;
|
|
7
|
+
export interface ITicketReplyBoxProps {
|
|
8
|
+
/** Send the composed message. `internal` is only ever true when
|
|
9
|
+
* `allowInternalNote` is set (the staff surface). */
|
|
10
|
+
onSend: (body: string, options: {
|
|
11
|
+
internal: boolean;
|
|
12
|
+
attachments?: IAttachmentUpload[];
|
|
13
|
+
}) => void | Promise<void>;
|
|
14
|
+
/** File → base64 upload conversion; defaults to the shared `fileToAttachment`. */
|
|
15
|
+
fileToAttachment?: (file: File) => Promise<IAttachmentUpload>;
|
|
16
|
+
/** the send round-trip is in flight */
|
|
17
|
+
sending?: boolean;
|
|
18
|
+
/** the ticket can't be replied to (e.g. closed) — renders a notice instead */
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
disabledReason?: string;
|
|
21
|
+
/** placeholder text. (A function is called with `false` — the mode is chosen at
|
|
22
|
+
* send time, so there is no live internal-note mode.) */
|
|
23
|
+
placeholder?: string | ((internal: boolean) => string);
|
|
24
|
+
/** send labels; a function is called with `false` for the primary "Send reply"
|
|
25
|
+
* and `true` for the "Add internal note" split-menu item. Defaults to
|
|
26
|
+
* "Send reply" / "Add internal note". */
|
|
27
|
+
sendLabel?: string | ((internal: boolean) => string);
|
|
28
|
+
/** Staff surface: split the send button so it also offers "Add internal note"
|
|
29
|
+
* (customer composers omit it and just send a reply). */
|
|
30
|
+
allowInternalNote?: boolean;
|
|
31
|
+
/** Extra attach-menu entries beyond "Upload files" — e.g. the IDE's screenshot /
|
|
32
|
+
* region capture. Receives the composer's `addFiles`. With any entry the attach
|
|
33
|
+
* control becomes a dropdown; otherwise it's a plain button. */
|
|
34
|
+
attachMenuItems?: (addFiles: (files: File[]) => void) => TAttachMenuItems;
|
|
35
|
+
/** Extra footer controls left of the send button — e.g. the IDE's
|
|
36
|
+
* reference-interfaces toggle. */
|
|
37
|
+
footerActions?: ReactNode;
|
|
38
|
+
/** Rendered on top of the editor, inside the bar — e.g. reference chips. */
|
|
39
|
+
aboveInput?: ReactNode;
|
|
40
|
+
/** Rendered below the editor — e.g. the IDE's interface-reference picker. */
|
|
41
|
+
belowInput?: ReactNode;
|
|
42
|
+
/** Editor flavour. Helpdesk uses the rich, Qonsole-style editor by default; pass
|
|
43
|
+
* `plain` for a simple textarea (e.g. deterministic play tests). */
|
|
44
|
+
editor?: TComposerEditor;
|
|
45
|
+
/** Initial draft text to seed the editor with (e.g. a restored draft). */
|
|
46
|
+
defaultText?: string;
|
|
47
|
+
/** Initial staged files (e.g. a restored draft's attachments, or a demo). */
|
|
48
|
+
defaultFiles?: File[];
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* The shared ticket reply composer — now a thin adapter over the universal
|
|
52
|
+
* `<Composer>` (the input extracted from qorus-ide's Qonsole chat). It maps the
|
|
53
|
+
* ticket vocabulary onto the composer: the staff `allowInternalNote` becomes a
|
|
54
|
+
* split send (primary "Send reply" + a caret "Add internal note", mode chosen at
|
|
55
|
+
* send time), and staged files convert to `IAttachmentUpload[]` via
|
|
56
|
+
* `fileToAttachment` before `onSend`. App-specific affordances still arrive
|
|
57
|
+
* through slots (`attachMenuItems`, `footerActions`, `belowInput`), so the
|
|
58
|
+
* IDE-only bits (screenshot capture, the reference picker) stay in qorus-ide. A
|
|
59
|
+
* closed ticket renders a muted notice.
|
|
60
|
+
*/
|
|
61
|
+
export declare const TicketReplyBox: ({ onSend, fileToAttachment, sending, disabled, disabledReason, placeholder, sendLabel, allowInternalNote, attachMenuItems, footerActions, aboveInput, belowInput, editor, defaultText, defaultFiles, }: ITicketReplyBoxProps) => import("react/jsx-runtime").JSX.Element;
|
|
62
|
+
export {};
|
|
63
|
+
//# sourceMappingURL=TicketReplyBox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TicketReplyBox.d.ts","sourceRoot":"","sources":["../../../src/components/supportTicket/TicketReplyBox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAiC,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAEtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAE3C,gFAAgF;AAChF,KAAK,gBAAgB,GAAG,WAAW,CAAC,cAAc,CAAC,OAAO,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;AAEpF,MAAM,WAAW,oBAAoB;IACnC;0DACsD;IACtD,MAAM,EAAE,CACN,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE;QAAE,QAAQ,EAAE,OAAO,CAAC;QAAC,WAAW,CAAC,EAAE,iBAAiB,EAAE,CAAA;KAAE,KAC9D,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,kFAAkF;IAClF,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC9D,uCAAuC;IACvC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;8DAC0D;IAC1D,WAAW,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,QAAQ,EAAE,OAAO,KAAK,MAAM,CAAC,CAAC;IACvD;;8CAE0C;IAC1C,SAAS,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,QAAQ,EAAE,OAAO,KAAK,MAAM,CAAC,CAAC;IACrD;8DAC0D;IAC1D,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;qEAEiE;IACjE,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,KAAK,gBAAgB,CAAC;IAC1E;uCACmC;IACnC,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,4EAA4E;IAC5E,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,6EAA6E;IAC7E,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB;yEACqE;IACrE,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,0EAA0E;IAC1E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6EAA6E;IAC7E,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC;CACvB;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,2MAgBxB,oBAAoB,4CAiEtB,CAAC"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.TicketReplyBox = void 0;
|
|
40
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
41
|
+
var Composer_1 = require("../composer/Composer");
|
|
42
|
+
var fileToAttachment_1 = require("./fileToAttachment");
|
|
43
|
+
/**
|
|
44
|
+
* The shared ticket reply composer — now a thin adapter over the universal
|
|
45
|
+
* `<Composer>` (the input extracted from qorus-ide's Qonsole chat). It maps the
|
|
46
|
+
* ticket vocabulary onto the composer: the staff `allowInternalNote` becomes a
|
|
47
|
+
* split send (primary "Send reply" + a caret "Add internal note", mode chosen at
|
|
48
|
+
* send time), and staged files convert to `IAttachmentUpload[]` via
|
|
49
|
+
* `fileToAttachment` before `onSend`. App-specific affordances still arrive
|
|
50
|
+
* through slots (`attachMenuItems`, `footerActions`, `belowInput`), so the
|
|
51
|
+
* IDE-only bits (screenshot capture, the reference picker) stay in qorus-ide. A
|
|
52
|
+
* closed ticket renders a muted notice.
|
|
53
|
+
*/
|
|
54
|
+
var TicketReplyBox = function (_a) {
|
|
55
|
+
var onSend = _a.onSend, _b = _a.fileToAttachment, fileToAttachment = _b === void 0 ? fileToAttachment_1.fileToAttachment : _b, sending = _a.sending, disabled = _a.disabled, _c = _a.disabledReason, disabledReason = _c === void 0 ? 'This ticket is closed. Open a new ticket to continue the conversation.' : _c, _d = _a.placeholder, placeholder = _d === void 0 ? 'Write a reply…' : _d, sendLabel = _a.sendLabel, allowInternalNote = _a.allowInternalNote, attachMenuItems = _a.attachMenuItems, footerActions = _a.footerActions, aboveInput = _a.aboveInput, belowInput = _a.belowInput, _e = _a.editor, editor = _e === void 0 ? 'rich' : _e, defaultText = _a.defaultText, defaultFiles = _a.defaultFiles;
|
|
56
|
+
var resolvedPlaceholder = typeof placeholder === 'function' ? placeholder(false) : placeholder;
|
|
57
|
+
// Label for a given send mode: `false` = public reply, `true` = internal note.
|
|
58
|
+
var labelFor = function (note) {
|
|
59
|
+
return sendLabel !== undefined
|
|
60
|
+
? typeof sendLabel === 'function'
|
|
61
|
+
? sendLabel(note)
|
|
62
|
+
: sendLabel
|
|
63
|
+
: note
|
|
64
|
+
? 'Add internal note'
|
|
65
|
+
: 'Send reply';
|
|
66
|
+
};
|
|
67
|
+
// Staff surface splits the send button; customer surface is a single "Send reply".
|
|
68
|
+
// Both use the Qonsole-style minimal `custom1` accent (the Composer default); the
|
|
69
|
+
// internal note stays amber (`warning`) so it can't be mistaken for a public reply.
|
|
70
|
+
var sendActions = allowInternalNote
|
|
71
|
+
? [
|
|
72
|
+
{
|
|
73
|
+
id: 'reply',
|
|
74
|
+
label: labelFor(false),
|
|
75
|
+
icon: 'SendPlane2Line',
|
|
76
|
+
minimal: true,
|
|
77
|
+
customTheme: { main: 'custom1' },
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
id: 'internal',
|
|
81
|
+
label: labelFor(true),
|
|
82
|
+
icon: 'StickyNoteLine',
|
|
83
|
+
minimal: true,
|
|
84
|
+
intent: 'warning',
|
|
85
|
+
},
|
|
86
|
+
]
|
|
87
|
+
: undefined;
|
|
88
|
+
var handleSend = function (body_1, _a) { return __awaiter(void 0, [body_1, _a], void 0, function (body, _b) {
|
|
89
|
+
var internal, attachments, _c;
|
|
90
|
+
var files = _b.files, action = _b.action;
|
|
91
|
+
return __generator(this, function (_d) {
|
|
92
|
+
switch (_d.label) {
|
|
93
|
+
case 0:
|
|
94
|
+
internal = action === 'internal';
|
|
95
|
+
if (!files.length) return [3 /*break*/, 2];
|
|
96
|
+
return [4 /*yield*/, Promise.all(files.map(fileToAttachment))];
|
|
97
|
+
case 1:
|
|
98
|
+
_c = _d.sent();
|
|
99
|
+
return [3 /*break*/, 3];
|
|
100
|
+
case 2:
|
|
101
|
+
_c = undefined;
|
|
102
|
+
_d.label = 3;
|
|
103
|
+
case 3:
|
|
104
|
+
attachments = _c;
|
|
105
|
+
return [4 /*yield*/, onSend(body, { internal: internal, attachments: attachments })];
|
|
106
|
+
case 4:
|
|
107
|
+
_d.sent();
|
|
108
|
+
return [2 /*return*/];
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
}); };
|
|
112
|
+
return ((0, jsx_runtime_1.jsx)(Composer_1.Composer, { editor: editor, defaultText: defaultText, defaultFiles: defaultFiles, placeholder: resolvedPlaceholder, sending: sending, disabled: disabled, disabledReason: disabledReason, onSend: handleSend, sendLabel: labelFor(false), sendActions: sendActions, sendMenuClassName: 'ticket-send-more', attachMenuItems: attachMenuItems, footerActions: footerActions, aboveInput: aboveInput, belowInput: belowInput }));
|
|
113
|
+
};
|
|
114
|
+
exports.TicketReplyBox = TicketReplyBox;
|
|
115
|
+
//# sourceMappingURL=TicketReplyBox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TicketReplyBox.js","sourceRoot":"","sources":["../../../src/components/supportTicket/TicketReplyBox.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,iDAAsF;AACtF,uDAAiF;AAkDjF;;;;;;;;;;GAUG;AACI,IAAM,cAAc,GAAG,UAAC,EAgBR;QAfrB,MAAM,YAAA,EACN,wBAA0C,EAA1C,gBAAgB,mBAAG,mCAAuB,KAAA,EAC1C,OAAO,aAAA,EACP,QAAQ,cAAA,EACR,sBAAyF,EAAzF,cAAc,mBAAG,wEAAwE,KAAA,EACzF,mBAA8B,EAA9B,WAAW,mBAAG,gBAAgB,KAAA,EAC9B,SAAS,eAAA,EACT,iBAAiB,uBAAA,EACjB,eAAe,qBAAA,EACf,aAAa,mBAAA,EACb,UAAU,gBAAA,EACV,UAAU,gB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A9C,KAAA,SAA8C,CAAA;;;oBAC9C,KAAA,SAAS,CAAA;;;oBAFP,WAAW,KAEJ;oBACb,qBAAM,MAAM,CAAC,IAAI,EAAE,EAAE,QAAQ,UAAA,EAAE,WAAW,aAAA,EAAE,CAAC,EAAA;;oBAA7C,SAA6C,CAAC;;;;SAC/C,CAAC;IAEF,OAAO,CACL,uBAAC,mBAAQ,IACP,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,mBAAmB,EAChC,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,EAC9B,MAAM,EAAE,UAAU,EAClB,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC,EAC1B,WAAW,EAAE,WAAW,EACxB,iBAAiB,EAAC,kBAAkB,EACpC,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,GACtB,CACH,CAAC;AACJ,CAAC,CAAC;AAjFW,QAAA,cAAc,kBAiFzB"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export interface ITicketAttachmentAccessConfig {
|
|
2
|
+
/** Absolute URL for one attachment's bytes. */
|
|
3
|
+
attachmentUrl: (ticketId: string, attachmentId: string) => string;
|
|
4
|
+
/**
|
|
5
|
+
* Headers for the byte request — typically auth. A function rather than a
|
|
6
|
+
* value because tokens are resolved per request, not at wire-up time.
|
|
7
|
+
*/
|
|
8
|
+
headers?: () => Record<string, string>;
|
|
9
|
+
/**
|
|
10
|
+
* Error to throw on a non-OK response. Defaults to a plain `Error`; apps with
|
|
11
|
+
* their own API error type (carrying the status) pass a factory.
|
|
12
|
+
*/
|
|
13
|
+
onError?: (message: string, status: number) => Error;
|
|
14
|
+
}
|
|
15
|
+
export interface ITicketAttachmentAccess {
|
|
16
|
+
/** Raw bytes. `failure` is the message used if the response isn't OK. */
|
|
17
|
+
fetchBlob: (ticketId: string, attachmentId: string, failure?: string) => Promise<Blob>;
|
|
18
|
+
/**
|
|
19
|
+
* An object URL for the bytes — for inline thumbnails and the lightbox.
|
|
20
|
+
*
|
|
21
|
+
* The caller owns the returned URL and must `URL.revokeObjectURL` it when the
|
|
22
|
+
* element goes away; this cannot do it for them without breaking the img.
|
|
23
|
+
*/
|
|
24
|
+
fetchBlobUrl: (ticketId: string, attachmentId: string) => Promise<string>;
|
|
25
|
+
/** Save the attachment to disk under its original filename. */
|
|
26
|
+
download: (ticketId: string, attachmentId: string, filename: string) => Promise<void>;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Save a blob to disk under `filename`, via a temporary anchor.
|
|
30
|
+
*
|
|
31
|
+
* Exported because it is the half of `download` that has nothing to do with
|
|
32
|
+
* tickets — a surface that already holds the bytes shouldn't have to re-fetch
|
|
33
|
+
* them just to reuse the save behaviour.
|
|
34
|
+
*/
|
|
35
|
+
export declare const saveBlobAs: (blob: Blob, filename: string) => void;
|
|
36
|
+
export declare const createTicketAttachmentAccess: ({ attachmentUrl, headers, onError, }: ITicketAttachmentAccessConfig) => ITicketAttachmentAccess;
|
|
37
|
+
//# sourceMappingURL=attachmentAccess.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachmentAccess.d.ts","sourceRoot":"","sources":["../../../src/components/supportTicket/attachmentAccess.ts"],"names":[],"mappings":"AAeA,MAAM,WAAW,6BAA6B;IAC5C,+CAA+C;IAC/C,aAAa,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,KAAK,MAAM,CAAC;IAClE;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,KAAK,CAAC;CACtD;AAED,MAAM,WAAW,uBAAuB;IACtC,yEAAyE;IACzE,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACvF;;;;;OAKG;IACH,YAAY,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1E,+DAA+D;IAC/D,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACvF;AAKD;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,SAAU,IAAI,YAAY,MAAM,KAAG,IAYzD,CAAC;AAEF,eAAO,MAAM,4BAA4B,yCAItC,6BAA6B,KAAG,uBAwBlC,CAAC"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Authed attachment byte-fetching, shared by every ticket surface.
|
|
4
|
+
*
|
|
5
|
+
* Attachment bytes can't go through the JSON fetch helpers, so each app grew its
|
|
6
|
+
* own raw-`fetch` copy: qorus-ide in `views/support/api.ts`, admin-portal in
|
|
7
|
+
* `pages/SupportTickets/helpers.ts`. The two were the same function down to the
|
|
8
|
+
* error text ("Could not download the attachment") and the anchor-click dance —
|
|
9
|
+
* they differed only in how the URL is built, which auth header is sent, and
|
|
10
|
+
* which Error subclass is thrown.
|
|
11
|
+
*
|
|
12
|
+
* Those three differences are the parameters below. Everything else — the
|
|
13
|
+
* non-OK check, `URL.createObjectURL`, the temporary anchor, revoking the object
|
|
14
|
+
* URL — lives here once.
|
|
15
|
+
*/
|
|
16
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
18
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
19
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
20
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
21
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
22
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
26
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
27
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
28
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
29
|
+
function step(op) {
|
|
30
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
31
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
32
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
33
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
34
|
+
switch (op[0]) {
|
|
35
|
+
case 0: case 1: t = op; break;
|
|
36
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
37
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
38
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
39
|
+
default:
|
|
40
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
41
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
42
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
43
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
44
|
+
if (t[2]) _.ops.pop();
|
|
45
|
+
_.trys.pop(); continue;
|
|
46
|
+
}
|
|
47
|
+
op = body.call(thisArg, _);
|
|
48
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
49
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
53
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
54
|
+
if (ar || !(i in from)) {
|
|
55
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
56
|
+
ar[i] = from[i];
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
60
|
+
};
|
|
61
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
62
|
+
exports.createTicketAttachmentAccess = exports.saveBlobAs = void 0;
|
|
63
|
+
var DEFAULT_DOWNLOAD_FAILURE = 'Could not download the attachment';
|
|
64
|
+
var DEFAULT_LOAD_FAILURE = 'Could not load the attachment';
|
|
65
|
+
/**
|
|
66
|
+
* Save a blob to disk under `filename`, via a temporary anchor.
|
|
67
|
+
*
|
|
68
|
+
* Exported because it is the half of `download` that has nothing to do with
|
|
69
|
+
* tickets — a surface that already holds the bytes shouldn't have to re-fetch
|
|
70
|
+
* them just to reuse the save behaviour.
|
|
71
|
+
*/
|
|
72
|
+
var saveBlobAs = function (blob, filename) {
|
|
73
|
+
var url = URL.createObjectURL(blob);
|
|
74
|
+
var anchor = document.createElement('a');
|
|
75
|
+
anchor.href = url;
|
|
76
|
+
anchor.download = filename;
|
|
77
|
+
document.body.appendChild(anchor);
|
|
78
|
+
anchor.click();
|
|
79
|
+
anchor.remove();
|
|
80
|
+
// Safari needs the URL alive until the click is processed; a task boundary is
|
|
81
|
+
// enough and avoids leaking the blob for the life of the document.
|
|
82
|
+
setTimeout(function () { return URL.revokeObjectURL(url); }, 0);
|
|
83
|
+
};
|
|
84
|
+
exports.saveBlobAs = saveBlobAs;
|
|
85
|
+
var createTicketAttachmentAccess = function (_a) {
|
|
86
|
+
var attachmentUrl = _a.attachmentUrl, headers = _a.headers, onError = _a.onError;
|
|
87
|
+
var fetchBlob = function (ticketId_1, attachmentId_1) {
|
|
88
|
+
var args_1 = [];
|
|
89
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
90
|
+
args_1[_i - 2] = arguments[_i];
|
|
91
|
+
}
|
|
92
|
+
return __awaiter(void 0, __spreadArray([ticketId_1, attachmentId_1], args_1, true), void 0, function (ticketId, attachmentId, failure) {
|
|
93
|
+
var response;
|
|
94
|
+
var _a;
|
|
95
|
+
if (failure === void 0) { failure = DEFAULT_LOAD_FAILURE; }
|
|
96
|
+
return __generator(this, function (_b) {
|
|
97
|
+
switch (_b.label) {
|
|
98
|
+
case 0: return [4 /*yield*/, fetch(attachmentUrl(ticketId, attachmentId), {
|
|
99
|
+
headers: (_a = headers === null || headers === void 0 ? void 0 : headers()) !== null && _a !== void 0 ? _a : {},
|
|
100
|
+
})];
|
|
101
|
+
case 1:
|
|
102
|
+
response = _b.sent();
|
|
103
|
+
if (!response.ok) {
|
|
104
|
+
throw onError ? onError(failure, response.status) : new Error(failure);
|
|
105
|
+
}
|
|
106
|
+
return [2 /*return*/, response.blob()];
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
return {
|
|
112
|
+
fetchBlob: fetchBlob,
|
|
113
|
+
fetchBlobUrl: function (ticketId, attachmentId) { return __awaiter(void 0, void 0, void 0, function () { var _a, _b; return __generator(this, function (_c) {
|
|
114
|
+
switch (_c.label) {
|
|
115
|
+
case 0:
|
|
116
|
+
_b = (_a = URL).createObjectURL;
|
|
117
|
+
return [4 /*yield*/, fetchBlob(ticketId, attachmentId, DEFAULT_LOAD_FAILURE)];
|
|
118
|
+
case 1: return [2 /*return*/, _b.apply(_a, [_c.sent()])];
|
|
119
|
+
}
|
|
120
|
+
}); }); },
|
|
121
|
+
download: function (ticketId, attachmentId, filename) { return __awaiter(void 0, void 0, void 0, function () { var _a; return __generator(this, function (_b) {
|
|
122
|
+
switch (_b.label) {
|
|
123
|
+
case 0:
|
|
124
|
+
_a = exports.saveBlobAs;
|
|
125
|
+
return [4 /*yield*/, fetchBlob(ticketId, attachmentId, DEFAULT_DOWNLOAD_FAILURE)];
|
|
126
|
+
case 1: return [2 /*return*/, _a.apply(void 0, [_b.sent(), filename])];
|
|
127
|
+
}
|
|
128
|
+
}); }); },
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
exports.createTicketAttachmentAccess = createTicketAttachmentAccess;
|
|
132
|
+
//# sourceMappingURL=attachmentAccess.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachmentAccess.js","sourceRoot":"","sources":["../../../src/components/supportTicket/attachmentAccess.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BH,IAAM,wBAAwB,GAAG,mCAAmC,CAAC;AACrE,IAAM,oBAAoB,GAAG,+BAA+B,CAAC;AAE7D;;;;;;GAMG;AACI,IAAM,UAAU,GAAG,UAAC,IAAU,EAAE,QAAgB;IACrD,IAAM,GAAG,GAAG,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IACtC,IAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAE3C,MAAM,CAAC,IAAI,GAAG,GAAG,CAAC;IAClB,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IAClC,MAAM,CAAC,KAAK,EAAE,CAAC;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,QAAQ,EAAE,YAAY,EAAE,wBAAwB,CAAC,EAAA;wBAA5E,sBAAA,kBAAW,SAAiE,EAAE,QAAQ,EAAC,EAAA;;iBAAA;KAC1F,CAAC;AACJ,CAAC,CAAC;AA5BW,QAAA,4BAA4B,gCA4BvC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IAttachmentUpload } from './meta';
|
|
2
|
+
/**
|
|
3
|
+
* Read a picked `File` into the inline base64 upload shape the support API expects
|
|
4
|
+
* (the SaaS plane accepts attachments as base64 on the create/reply payload, with
|
|
5
|
+
* no separate multipart upload). Shared by every composer so the customer and
|
|
6
|
+
* staff surfaces encode files identically.
|
|
7
|
+
*/
|
|
8
|
+
export declare const fileToAttachment: (file: File) => Promise<IAttachmentUpload>;
|
|
9
|
+
//# sourceMappingURL=fileToAttachment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fileToAttachment.d.ts","sourceRoot":"","sources":["../../../src/components/supportTicket/fileToAttachment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAE3C;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,SAAU,IAAI,KAAG,QAAQ,iBAAiB,CAenE,CAAC"}
|