@kineticdata/react 5.1.2 → 6.0.1
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/assets/task/icons/drag-handle.svg +3 -0
- package/assets/task/icons/plus_small.svg +2 -4
- package/lib/apis/agent/adapters.js +16 -12
- package/lib/apis/agent/bridges.js +54 -41
- package/lib/apis/agent/handlers.js +51 -38
- package/lib/apis/core/activity.js +19 -11
- package/lib/apis/core/attributeDefinitions.js +54 -46
- package/lib/apis/core/attributeDefinitions.test.js +47 -55
- package/lib/apis/core/authentication.js +58 -63
- package/lib/apis/core/backgroundJobs.js +38 -30
- package/lib/apis/core/bridgeModelAttributeMappings.js +42 -34
- package/lib/apis/core/bridgeModelAttributes.js +47 -37
- package/lib/apis/core/bridgeModelMappings.js +42 -34
- package/lib/apis/core/bridgeModelQualificationMappings.js +42 -34
- package/lib/apis/core/bridgeModelQualifications.js +42 -34
- package/lib/apis/core/bridgeModels.js +56 -46
- package/lib/apis/core/bridgeModels.test.js +64 -80
- package/lib/apis/core/bridgedresources.js +64 -72
- package/lib/apis/core/bridgedresources.test.js +33 -30
- package/lib/apis/core/categories.js +59 -52
- package/lib/apis/core/categories.test.js +36 -33
- package/lib/apis/core/fileResources.js +41 -33
- package/lib/apis/core/filestores.js +42 -34
- package/lib/apis/core/formTypes.js +50 -44
- package/lib/apis/core/forms.js +53 -49
- package/lib/apis/core/forms.test.js +60 -74
- package/lib/apis/core/kapps.js +45 -39
- package/lib/apis/core/kapps.test.js +45 -52
- package/lib/apis/core/logs.js +20 -16
- package/lib/apis/core/memberships.js +23 -20
- package/lib/apis/core/meta.js +31 -19
- package/lib/apis/core/notices.js +17 -9
- package/lib/apis/core/oauthClients.js +49 -45
- package/lib/apis/core/platformComponents.js +73 -57
- package/lib/apis/core/platformItems.js +22 -13
- package/lib/apis/core/profile.js +28 -21
- package/lib/apis/core/profile.test.js +20 -17
- package/lib/apis/core/securityPolicyDefinitions.js +48 -41
- package/lib/apis/core/securityPolicyDefinitions.test.js +50 -60
- package/lib/apis/core/space.js +23 -16
- package/lib/apis/core/space.test.js +31 -38
- package/lib/apis/core/submissions.js +213 -186
- package/lib/apis/core/submissions.test.js +39 -36
- package/lib/apis/core/teams.js +51 -44
- package/lib/apis/core/teams.test.js +42 -39
- package/lib/apis/core/translations.js +123 -130
- package/lib/apis/core/translations.test.js +278 -368
- package/lib/apis/core/users.js +56 -49
- package/lib/apis/core/users.test.js +42 -39
- package/lib/apis/core/version.js +20 -11
- package/lib/apis/core/webApis.js +42 -34
- package/lib/apis/core/webhooks.js +48 -41
- package/lib/apis/core/webhooks.test.js +50 -60
- package/lib/apis/core/webhooksJobs.js +30 -26
- package/lib/apis/core/workflows.js +52 -44
- package/lib/apis/http.js +121 -80
- package/lib/apis/http.test.js +137 -38
- package/lib/apis/index.js +506 -50
- package/lib/apis/system/index.js +363 -215
- package/lib/apis/task/index.js +294 -227
- package/lib/components/agent/bridge/BridgeForm.js +50 -50
- package/lib/components/agent/bridge/BridgeTable.js +16 -9
- package/lib/components/agent/filestore/FilestoreForm.js +49 -48
- package/lib/components/agent/filestore/FilestoreTable.js +16 -9
- package/lib/components/agent/handler/AgentHandlerForm.js +24 -27
- package/lib/components/agent/handler/AgentHandlerTable.js +17 -10
- package/lib/components/common/AttributeSelect.js +15 -9
- package/lib/components/common/BridgeSelect.js +48 -43
- package/lib/components/common/ComponentConfigContext.js +9 -2
- package/lib/components/common/ContentEditable.js +36 -60
- package/lib/components/common/FormSelect.js +70 -58
- package/lib/components/common/NodeSelect.js +23 -19
- package/lib/components/common/Scroller.js +24 -23
- package/lib/components/common/StaticSelect.js +57 -50
- package/lib/components/common/TableInput.js +54 -57
- package/lib/components/common/TeamSelect.js +42 -39
- package/lib/components/common/ToastContainer.js +170 -0
- package/lib/components/common/Typeahead.js +121 -138
- package/lib/components/common/UserSelect.js +42 -41
- package/lib/components/common/authentication/AuthInterceptor.js +15 -19
- package/lib/components/common/authentication/AuthInterceptor.test.js +46 -64
- package/lib/components/common/authentication/AuthenticationContainer.js +350 -454
- package/lib/components/common/authentication/RequestInterceptor.js +16 -19
- package/lib/components/common/code_input/CodeInput.js +92 -122
- package/lib/components/common/code_input/draftHelpers.js +96 -90
- package/lib/components/common/code_input/languageHelpers.js +49 -47
- package/lib/components/common/code_input/languageHelpers.test.js +21 -16
- package/lib/components/common/defaults/Toast.js +26 -0
- package/lib/components/common/defaults/index.js +13 -0
- package/lib/components/core/CoreFormModal.js +26 -24
- package/lib/components/core/CoreModal.js +37 -31
- package/lib/components/core/attribute_definition/AttributeDefinitionForm.js +24 -23
- package/lib/components/core/attribute_definition/AttributeDefinitionTable.js +25 -18
- package/lib/components/core/bridge_model/BridgeModelForm.js +27 -37
- package/lib/components/core/bridge_model/BridgeModelTable.js +17 -10
- package/lib/components/core/bridge_model_attribute/BridgeModelAttributeForm.js +17 -16
- package/lib/components/core/bridge_model_attribute/BridgeModelAttributeTable.js +25 -21
- package/lib/components/core/bridge_model_qualification/BridgeModelQualificationForm.js +20 -20
- package/lib/components/core/bridge_model_qualification/BridgeModelQualificationTable.js +27 -22
- package/lib/components/core/category/CategoryForm.js +22 -22
- package/lib/components/core/category/CategoryTable.js +28 -16
- package/lib/components/core/core_form/CoreForm.js +209 -285
- package/lib/components/core/core_form/CoreForm.test.js +12 -10
- package/lib/components/core/core_form/defaults/index.js +52 -44
- package/lib/components/core/core_form/globals.js +14 -5
- package/lib/components/core/field_definition/FieldDefinitionForm.js +23 -21
- package/lib/components/core/field_definition/FieldDefinitionTable.js +26 -15
- package/lib/components/core/file_resource/FileResourceForm.js +38 -37
- package/lib/components/core/file_resource/FileResourceTable.js +16 -12
- package/lib/components/core/form/FormForm.js +56 -61
- package/lib/components/core/form/FormTable.js +47 -33
- package/lib/components/core/form_type/FormTypeForm.js +14 -13
- package/lib/components/core/form_type/FormTypeTable.js +15 -9
- package/lib/components/core/i18n/I18n.js +54 -61
- package/lib/components/core/i18n/I18nContext.js +9 -2
- package/lib/components/core/i18n/I18nProvider.js +40 -43
- package/lib/components/core/i18n/Moment.js +40 -50
- package/lib/components/core/index_definition/IndexDefinitionForm.js +23 -24
- package/lib/components/core/index_definition/IndexDefinitionTable.js +31 -16
- package/lib/components/core/index_job/IndexJobTable.js +20 -15
- package/lib/components/core/kapp/KappForm.js +57 -58
- package/lib/components/core/kapp/KappTable.js +34 -44
- package/lib/components/core/log/LogTable.js +42 -34
- package/lib/components/core/oauth_client/OAuthClientForm.js +17 -17
- package/lib/components/core/oauth_client/OAuthClientTable.js +12 -8
- package/lib/components/core/platform_component/AgentComponentForm.js +15 -15
- package/lib/components/core/platform_component/AgentComponentTable.js +10 -5
- package/lib/components/core/platform_component/TaskComponentForm.js +14 -14
- package/lib/components/core/profile/ProfileForm.js +40 -39
- package/lib/components/core/security_definition/SecurityDefinitionForm.js +28 -25
- package/lib/components/core/security_definition/SecurityDefinitionTable.js +27 -17
- package/lib/components/core/space/SpaceForm.js +79 -90
- package/lib/components/core/submission/DatastoreSubmissionFilters.js +39 -40
- package/lib/components/core/submission/DatastoreSubmissionTable.js +37 -34
- package/lib/components/core/submission/FormSubmissionFilters.js +79 -75
- package/lib/components/core/submission/FormSubmissionTable.js +64 -39
- package/lib/components/core/submission/KappSubmissionTable.js +67 -48
- package/lib/components/core/submission/SubmissionForm.js +126 -55
- package/lib/components/core/submission/SubmissionTable.js +24 -20
- package/lib/components/core/submission/helpers.js +37 -33
- package/lib/components/core/submission/helpers.test.js +69 -20
- package/lib/components/core/team/TeamForm.js +24 -21
- package/lib/components/core/team/TeamTable.js +27 -16
- package/lib/components/core/translation/ContextForm.js +13 -10
- package/lib/components/core/translation/ContextTable.js +13 -10
- package/lib/components/core/translation/EntryForm.js +27 -24
- package/lib/components/core/translation/EntryTable.js +19 -16
- package/lib/components/core/translation/LocaleForm.js +16 -13
- package/lib/components/core/translation/LocaleTable.js +12 -8
- package/lib/components/core/user/UserForm.js +38 -37
- package/lib/components/core/user/UserTable.js +42 -20
- package/lib/components/core/webapi/WebApiForm.js +87 -80
- package/lib/components/core/webapi/WebApiTable.js +28 -17
- package/lib/components/core/webhook/WebhookForm.js +33 -32
- package/lib/components/core/webhook/WebhookTable.js +41 -29
- package/lib/components/core/webhook_job/WebhookJobTable.js +58 -35
- package/lib/components/form/Form.helpers.js +182 -108
- package/lib/components/form/Form.js +467 -524
- package/lib/components/form/Form.models.js +39 -24
- package/lib/components/form/FormState.js +8 -5
- package/lib/components/form/KitchenSinkForm.js +135 -4
- package/lib/components/form/defaults/AttributesField.js +48 -59
- package/lib/components/form/defaults/CheckboxField.js +14 -6
- package/lib/components/form/defaults/CodeField.js +15 -7
- package/lib/components/form/defaults/FormButtons.js +12 -4
- package/lib/components/form/defaults/FormError.js +12 -4
- package/lib/components/form/defaults/FormField.js +15 -7
- package/lib/components/form/defaults/FormLayout.js +12 -4
- package/lib/components/form/defaults/FormMultiField.js +15 -7
- package/lib/components/form/defaults/PasswordField.js +14 -6
- package/lib/components/form/defaults/RadioField.js +15 -7
- package/lib/components/form/defaults/SampleTeamsRolesFIeld.js +17 -9
- package/lib/components/form/defaults/SelectField.js +16 -8
- package/lib/components/form/defaults/SelectMultiField.js +15 -7
- package/lib/components/form/defaults/TableField.js +14 -6
- package/lib/components/form/defaults/TeamField.js +15 -7
- package/lib/components/form/defaults/TeamMultiField.js +15 -7
- package/lib/components/form/defaults/TextField.js +14 -6
- package/lib/components/form/defaults/TextMultiField.js +26 -28
- package/lib/components/form/defaults/UserField.js +15 -7
- package/lib/components/form/defaults/UserMultiField.js +15 -7
- package/lib/components/form/defaults/index.js +48 -41
- package/lib/components/form/tests/Form.test.js +568 -864
- package/lib/components/form/tests/components.js +15 -25
- package/lib/components/form/tests/helpers.test.js +35 -33
- package/lib/components/index.js +1034 -135
- package/lib/components/system/SystemBackgroundTasksTable.js +14 -10
- package/lib/components/system/SystemCassandraForm.js +98 -0
- package/lib/components/system/SystemElasticSearchForm.js +98 -0
- package/lib/components/system/SystemFilestoreForm.js +36 -28
- package/lib/components/system/SystemForm.js +19 -16
- package/lib/components/system/SystemIngressForm.js +85 -36
- package/lib/components/system/SystemSecurityForm.js +17 -14
- package/lib/components/system/SystemSmtpForm.js +13 -13
- package/lib/components/system/SystemTaskAdapterForm.js +49 -21
- package/lib/components/system/SystemTrustedCertificateForm.js +40 -0
- package/lib/components/system/SystemTrustedCertificatesTable.js +74 -0
- package/lib/components/system/SystemUserForm.js +15 -14
- package/lib/components/system/helpers.js +281 -98
- package/lib/components/system/helpers.test.js +16 -12
- package/lib/components/system/spaces/SystemSpaceForm.js +25 -24
- package/lib/components/system/spaces/SystemTenantForm.js +112 -68
- package/lib/components/system/spaces/SystemTenantTable.js +12 -8
- package/lib/components/table/Table.js +295 -227
- package/lib/components/table/Table.redux.js +339 -355
- package/lib/components/table/Table.redux.test.js +49 -47
- package/lib/components/table/Table.test.js +146 -132
- package/lib/components/table/defaults/BodyCell.js +12 -6
- package/lib/components/table/defaults/BodyRow.js +10 -4
- package/lib/components/table/defaults/BooleanFilter.js +17 -11
- package/lib/components/table/defaults/ColumnControl.js +26 -0
- package/lib/components/table/defaults/EmptyBodyRow.js +12 -6
- package/lib/components/table/defaults/FilterLayout.js +17 -11
- package/lib/components/table/defaults/Footer.js +11 -5
- package/lib/components/table/defaults/FooterCell.js +10 -4
- package/lib/components/table/defaults/FooterRow.js +10 -4
- package/lib/components/table/defaults/Header.js +10 -4
- package/lib/components/table/defaults/HeaderCell.js +16 -10
- package/lib/components/table/defaults/HeaderRow.js +10 -4
- package/lib/components/table/defaults/PaginationControl.js +18 -9
- package/lib/components/table/defaults/TableBody.js +10 -4
- package/lib/components/table/defaults/TableLayout.js +12 -6
- package/lib/components/table/defaults/TextFilter.js +16 -10
- package/lib/components/table/defaults/index.js +43 -33
- package/lib/components/task/builder/Connector.js +100 -111
- package/lib/components/task/builder/ConnectorForm.js +17 -11
- package/lib/components/task/builder/Node.js +101 -83
- package/lib/components/task/builder/NodeForm.js +30 -27
- package/lib/components/task/builder/NodeParametersForm.js +27 -24
- package/lib/components/task/builder/SvgCanvas.js +67 -96
- package/lib/components/task/builder/SvgText.js +19 -134
- package/lib/components/task/builder/TaskDefinitionConfigForm.js +27 -22
- package/lib/components/task/builder/TreeBuilder.js +140 -115
- package/lib/components/task/builder/builder.redux.js +311 -326
- package/lib/components/task/builder/constants.js +94 -45
- package/lib/components/task/builder/helpers.js +184 -173
- package/lib/components/task/builder/helpers.test.js +20 -18
- package/lib/components/task/builder/models.js +121 -98
- package/lib/components/task/category/TaskCategoryForm.js +31 -29
- package/lib/components/task/category/TaskCategoryTable.js +12 -8
- package/lib/components/task/common/UsageTable.js +16 -12
- package/lib/components/task/engine/EngineSettingsForm.js +13 -11
- package/lib/components/task/errors/RunErrorTable.js +50 -27
- package/lib/components/task/errors/SystemErrorsTable.js +13 -9
- package/lib/components/task/handlers/HandlerForm.js +55 -55
- package/lib/components/task/handlers/HandlerTable.js +35 -19
- package/lib/components/task/handlers/MissingHandlerTable.js +12 -8
- package/lib/components/task/policy_rule/PolicyRuleForm.js +33 -32
- package/lib/components/task/policy_rule/PolicyRuleTable.js +12 -8
- package/lib/components/task/runs/CreateManualTriggerForm.js +17 -15
- package/lib/components/task/runs/RunTable.js +45 -29
- package/lib/components/task/runs/RunTaskTable.js +10 -6
- package/lib/components/task/sources/SourceForm.js +47 -47
- package/lib/components/task/sources/SourceTable.js +29 -18
- package/lib/components/task/triggers/TriggerTable.js +71 -41
- package/lib/components/task/workflows/LinkedWorkflowForm.js +48 -54
- package/lib/components/task/workflows/LinkedWorkflowTable.js +46 -26
- package/lib/components/task/workflows/MissingRoutineTable.js +12 -8
- package/lib/components/task/workflows/WorkflowForm.js +49 -44
- package/lib/components/task/workflows/WorkflowTable.js +47 -29
- package/lib/helpers/SearchBuilder.js +73 -127
- package/lib/helpers/SearchBuilder.test.js +184 -175
- package/lib/helpers/index.js +116 -74
- package/lib/index.js +87 -38
- package/lib/reducer.js +11 -3
- package/lib/saga.js +42 -38
- package/lib/store.js +59 -35
- package/package.json +17 -29
- package/proxyhelper.js +122 -57
- package/assets/discussions/images/avi_128.png +0 -0
- package/assets/discussions/images/excel_128.png +0 -0
- package/assets/discussions/images/html_128.png +0 -0
- package/assets/discussions/images/illustrator_128.png +0 -0
- package/assets/discussions/images/indesign_128.png +0 -0
- package/assets/discussions/images/movie_128.png +0 -0
- package/assets/discussions/images/mpeg_128.png +0 -0
- package/assets/discussions/images/pdf_128.png +0 -0
- package/assets/discussions/images/photoshop_128.png +0 -0
- package/assets/discussions/images/powerpoint_128.png +0 -0
- package/assets/discussions/images/txt_128.png +0 -0
- package/assets/discussions/images/unknown_128.png +0 -0
- package/assets/discussions/images/word_128.png +0 -0
- package/assets/discussions/styles/_discussion.scss +0 -506
- package/lib/apis/discussions/index.js +0 -395
- package/lib/apis/socket/index.js +0 -77
- package/lib/apis/socket/socket.js +0 -350
- package/lib/apis/socket/socket.test.js +0 -90
- package/lib/apis/socket/timer.js +0 -45
- package/lib/apis/socket/timer.test.js +0 -51
- package/lib/apis/socket/topic.js +0 -185
- package/lib/apis/topics/index.js +0 -19
- package/lib/components/discussions/ChatInputForm.js +0 -424
- package/lib/components/discussions/DateBanner.js +0 -10
- package/lib/components/discussions/Discussion.js +0 -202
- package/lib/components/discussions/DiscussionForm.js +0 -227
- package/lib/components/discussions/InvitationForm.js +0 -107
- package/lib/components/discussions/MessageHistory.js +0 -110
- package/lib/components/discussions/MessagesByDate.js +0 -40
- package/lib/components/discussions/MessagesList.js +0 -30
- package/lib/components/discussions/MoreMessagesBanner.js +0 -26
- package/lib/components/discussions/ScrollHelper.js +0 -84
- package/lib/components/discussions/SystemMessage.js +0 -88
- package/lib/components/discussions/SystemMessageGroup.js +0 -15
- package/lib/components/discussions/UserMessage.js +0 -163
- package/lib/components/discussions/UserMessageGroup.js +0 -34
- package/lib/components/discussions/redux.js +0 -178
- package/lib/components/discussions/sagas.js +0 -500
- package/lib/helpers/discussions/canManage.js +0 -30
- package/lib/helpers/discussions/canManage.test.js +0 -69
- package/lib/helpers/discussions/generateSystemMessageContent.js +0 -131
- package/lib/helpers/discussions/generateSystemMessageContent.test.js +0 -450
- package/lib/models/discussions.js +0 -76
- package/lib/models/index.js +0 -1
package/lib/apis/socket/topic.js
DELETED
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
|
-
import { TOPIC_HUB_TOPIC, TOPIC_HUB_ACTION_SUBSCRIBE, TOPIC_HUB_ACTION_UNSUBSCRIBE, PRESENCE_CREATE_OP, PRESENCE_REMOVE_OP, TOPIC_HUB_EVENT_ACK_OK, TOPIC_HUB_EVENT_ACK_ERROR } from './socket';
|
|
4
|
-
export var TOPIC_STATUS = {
|
|
5
|
-
closed: 'closed',
|
|
6
|
-
reconnecting: 'reconnecting',
|
|
7
|
-
subscribing: 'subscribing',
|
|
8
|
-
subscribed: 'subscribed',
|
|
9
|
-
unsubscribing: 'unsubscribing',
|
|
10
|
-
error: 'error'
|
|
11
|
-
};
|
|
12
|
-
export var Topic = /*#__PURE__*/function () {
|
|
13
|
-
function Topic(topicId, socket, cb) {
|
|
14
|
-
_classCallCheck(this, Topic);
|
|
15
|
-
|
|
16
|
-
this.topicId = topicId;
|
|
17
|
-
this.topicStatus = TOPIC_STATUS.closed;
|
|
18
|
-
this.socket = socket;
|
|
19
|
-
this.eventCallbacks = [];
|
|
20
|
-
this.statusCallbacks = cb ? [cb] : [];
|
|
21
|
-
this.presences = [];
|
|
22
|
-
this.presenceCallbacks = [];
|
|
23
|
-
this.setStatus = this.setStatus.bind(this);
|
|
24
|
-
this.on = this.on.bind(this);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
_createClass(Topic, [{
|
|
28
|
-
key: "socket",
|
|
29
|
-
value: function socket() {
|
|
30
|
-
return this.socket;
|
|
31
|
-
}
|
|
32
|
-
}, {
|
|
33
|
-
key: "on",
|
|
34
|
-
value: function on(event, cb) {
|
|
35
|
-
var events = this.eventCallbacks[event] || [];
|
|
36
|
-
events.push(cb);
|
|
37
|
-
this.eventCallbacks[event] = events;
|
|
38
|
-
return this;
|
|
39
|
-
}
|
|
40
|
-
}, {
|
|
41
|
-
key: "onPresence",
|
|
42
|
-
value: function onPresence(cb) {
|
|
43
|
-
this.presenceCallbacks.push(cb);
|
|
44
|
-
return this;
|
|
45
|
-
}
|
|
46
|
-
}, {
|
|
47
|
-
key: "onStatus",
|
|
48
|
-
value: function onStatus(cb) {
|
|
49
|
-
this.statusCallbacks.push(cb);
|
|
50
|
-
return this;
|
|
51
|
-
}
|
|
52
|
-
}, {
|
|
53
|
-
key: "subscribe",
|
|
54
|
-
value: function subscribe(userInvitationToken) {
|
|
55
|
-
var _this = this;
|
|
56
|
-
|
|
57
|
-
return new Promise(function (resolve, reject) {
|
|
58
|
-
_this.setStatus(TOPIC_STATUS.subscribing); // Wrap the user's callback with our own.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
var handleSubscribe = function handleSubscribe(message) {
|
|
62
|
-
if (message.event === TOPIC_HUB_EVENT_ACK_OK) {
|
|
63
|
-
_this.setStatus(TOPIC_STATUS.subscribed, message);
|
|
64
|
-
|
|
65
|
-
resolve(message);
|
|
66
|
-
} else if (message.event === TOPIC_HUB_EVENT_ACK_ERROR) {
|
|
67
|
-
_this.setStatus(TOPIC_STATUS.error, message);
|
|
68
|
-
|
|
69
|
-
reject(message);
|
|
70
|
-
}
|
|
71
|
-
}; // Craft the message to be sent to the server.
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
var action = _this.socket.createMessage(TOPIC_HUB_TOPIC, TOPIC_HUB_ACTION_SUBSCRIBE, {
|
|
75
|
-
topic: _this.topicId,
|
|
76
|
-
userInvitationToken: userInvitationToken
|
|
77
|
-
}); // Send the message.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
_this.socket.send(action, handleSubscribe);
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
}, {
|
|
84
|
-
key: "unsubscribe",
|
|
85
|
-
value: function unsubscribe() {
|
|
86
|
-
var _this2 = this;
|
|
87
|
-
|
|
88
|
-
this.setStatus(TOPIC_STATUS.leaving);
|
|
89
|
-
|
|
90
|
-
var handleUnsubscribe = function handleUnsubscribe(message) {
|
|
91
|
-
if (message.event === TOPIC_HUB_EVENT_ACK_OK) {
|
|
92
|
-
_this2.setStatus(TOPIC_STATUS.closed, message);
|
|
93
|
-
} else if (message.event === TOPIC_HUB_EVENT_ACK_ERROR) {
|
|
94
|
-
_this2.setStatus(TOPIC_STATUS.error, message);
|
|
95
|
-
} // Remove this topic from the socket.
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
delete _this2.socket.topics[_this2.topicId];
|
|
99
|
-
}; // Craft the message to be sent to the server.
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
var action = this.socket.createMessage(TOPIC_HUB_TOPIC, TOPIC_HUB_ACTION_UNSUBSCRIBE, {
|
|
103
|
-
topic: this.topicId
|
|
104
|
-
}); // Send the message.
|
|
105
|
-
|
|
106
|
-
this.socket.send(action, handleUnsubscribe);
|
|
107
|
-
return this;
|
|
108
|
-
}
|
|
109
|
-
}, {
|
|
110
|
-
key: "send",
|
|
111
|
-
value: function send(action) {
|
|
112
|
-
var payload = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
113
|
-
var cb = arguments.length > 2 ? arguments[2] : undefined;
|
|
114
|
-
this.socket.send(this.socket.createMessage(this.topicId, action, payload), cb);
|
|
115
|
-
return this;
|
|
116
|
-
}
|
|
117
|
-
}, {
|
|
118
|
-
key: "receive",
|
|
119
|
-
value: function receive(message) {
|
|
120
|
-
var eventCallbacks = this.eventCallbacks[message.event];
|
|
121
|
-
|
|
122
|
-
if (eventCallbacks) {
|
|
123
|
-
eventCallbacks.forEach(function (cb) {
|
|
124
|
-
return cb(message);
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}, {
|
|
129
|
-
key: "receivePresence",
|
|
130
|
-
value: function receivePresence(op, data) {
|
|
131
|
-
switch (op) {
|
|
132
|
-
case PRESENCE_CREATE_OP:
|
|
133
|
-
this.presences.push(data);
|
|
134
|
-
break;
|
|
135
|
-
|
|
136
|
-
case PRESENCE_REMOVE_OP:
|
|
137
|
-
this.presences = this.presences.filter(function (p) {
|
|
138
|
-
return data.connection !== p.connection;
|
|
139
|
-
});
|
|
140
|
-
break;
|
|
141
|
-
|
|
142
|
-
default:
|
|
143
|
-
console.warn('Invalid presence delta operation: ' + op);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
this.presenceCallbacks.forEach(function (cb) {
|
|
147
|
-
return cb(op, data);
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
}, {
|
|
151
|
-
key: "presence",
|
|
152
|
-
value: function presence() {
|
|
153
|
-
return this.presences;
|
|
154
|
-
}
|
|
155
|
-
}, {
|
|
156
|
-
key: "setStatus",
|
|
157
|
-
value: function setStatus(status, message) {
|
|
158
|
-
var _this3 = this;
|
|
159
|
-
|
|
160
|
-
if (!Object.values(TOPIC_STATUS).includes(status)) return this;
|
|
161
|
-
this.topicStatus = status;
|
|
162
|
-
this.statusCallbacks.forEach(function (cb) {
|
|
163
|
-
return cb(_this3.topicStatus, message);
|
|
164
|
-
});
|
|
165
|
-
return this;
|
|
166
|
-
}
|
|
167
|
-
}, {
|
|
168
|
-
key: "status",
|
|
169
|
-
value: function status() {
|
|
170
|
-
return this.topicStatus;
|
|
171
|
-
}
|
|
172
|
-
}, {
|
|
173
|
-
key: "id",
|
|
174
|
-
value: function id() {
|
|
175
|
-
return this.topicId;
|
|
176
|
-
}
|
|
177
|
-
}, {
|
|
178
|
-
key: "isSubscribed",
|
|
179
|
-
value: function isSubscribed() {
|
|
180
|
-
return this.topicStatus === TOPIC_STATUS.subscribed;
|
|
181
|
-
}
|
|
182
|
-
}]);
|
|
183
|
-
|
|
184
|
-
return Topic;
|
|
185
|
-
}();
|
package/lib/apis/topics/index.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import axios from 'axios';
|
|
2
|
-
import { bundle } from '../../helpers';
|
|
3
|
-
|
|
4
|
-
var baseUrl = function baseUrl() {
|
|
5
|
-
return "".concat(bundle.spaceLocation(), "/app/topics");
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export var fetchTopicsVersion = function fetchTopicsVersion() {
|
|
9
|
-
return axios.request({
|
|
10
|
-
url: "".concat(baseUrl(), "/api/v1/version"),
|
|
11
|
-
method: 'get'
|
|
12
|
-
}).then(function (response) {
|
|
13
|
-
return response.data;
|
|
14
|
-
})["catch"](function (response) {
|
|
15
|
-
return {
|
|
16
|
-
error: response
|
|
17
|
-
};
|
|
18
|
-
});
|
|
19
|
-
};
|
|
@@ -1,424 +0,0 @@
|
|
|
1
|
-
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
|
-
import _toArray from "@babel/runtime/helpers/esm/toArray";
|
|
3
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
4
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
5
|
-
import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
|
|
6
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
7
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
8
|
-
import React, { Component } from 'react';
|
|
9
|
-
import Dropzone from 'react-dropzone';
|
|
10
|
-
import { compose } from 'recompose';
|
|
11
|
-
import { ButtonDropdown, DropdownToggle, DropdownMenu, DropdownItem, Popover, PopoverBody } from 'reactstrap';
|
|
12
|
-
import classNames from 'classnames';
|
|
13
|
-
import { ContentEditable } from '../common/ContentEditable';
|
|
14
|
-
import { connect } from '../../store';
|
|
15
|
-
import { bundle } from '../../helpers';
|
|
16
|
-
import { SEND_MESSAGE_UPDATE, SEND_MESSAGE } from './redux';
|
|
17
|
-
var VALID_IMG_TYPES = ['image/jpeg', 'image/bmp', 'image/gif', 'image/x-icon', 'image/png', 'image/svg+xml'];
|
|
18
|
-
|
|
19
|
-
var canShowPreview = function canShowPreview(attachment) {
|
|
20
|
-
return attachment.preview && VALID_IMG_TYPES.includes(attachment.type) || attachment.value && VALID_IMG_TYPES.includes(attachment.value.contentType);
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
var getThumbnailUrl = function getThumbnailUrl(discussion, message, attachment) {
|
|
24
|
-
return "".concat(bundle.spaceLocation(), "/app/discussions/api/v1/discussions/").concat(discussion.id, "/messages/").concat(message.id, "/files/").concat(attachment.value.thumbnailId, "/").concat(encodeURIComponent(attachment.value.filename.replace(/ /g, '_')));
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
var getThumbnailSrc = function getThumbnailSrc(discussion, message, attachment) {
|
|
28
|
-
return canShowPreview(attachment) ? attachment.type === 'attachment' ? getThumbnailUrl(discussion, message, attachment) : attachment.preview : null;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
var UploadCard = function UploadCard(_ref) {
|
|
32
|
-
var discussion = _ref.discussion,
|
|
33
|
-
message = _ref.message,
|
|
34
|
-
attachment = _ref.attachment,
|
|
35
|
-
remove = _ref.remove;
|
|
36
|
-
var name = attachment.value ? attachment.value.filename : attachment.name;
|
|
37
|
-
var thumbnailSrc = getThumbnailSrc(discussion, message, attachment);
|
|
38
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
39
|
-
className: "icon-wrapper",
|
|
40
|
-
style: {
|
|
41
|
-
display: 'flex',
|
|
42
|
-
backgroundColor: '#fff',
|
|
43
|
-
height: '24px',
|
|
44
|
-
minWidth: '96px',
|
|
45
|
-
maxWidth: '182px',
|
|
46
|
-
color: '#54698D',
|
|
47
|
-
fontSize: '10px',
|
|
48
|
-
lineHeight: '12px',
|
|
49
|
-
marginBottom: '0.5em',
|
|
50
|
-
marginRight: '0.5em'
|
|
51
|
-
}
|
|
52
|
-
}, thumbnailSrc && /*#__PURE__*/React.createElement("img", {
|
|
53
|
-
src: thumbnailSrc,
|
|
54
|
-
alt: name,
|
|
55
|
-
style: {
|
|
56
|
-
width: '24px',
|
|
57
|
-
height: '24px'
|
|
58
|
-
}
|
|
59
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
60
|
-
style: {
|
|
61
|
-
flex: '1',
|
|
62
|
-
marginLeft: '0.5em'
|
|
63
|
-
}
|
|
64
|
-
}, name), /*#__PURE__*/React.createElement("button", {
|
|
65
|
-
className: "btn btn-icon",
|
|
66
|
-
type: "button",
|
|
67
|
-
style: {
|
|
68
|
-
width: '24px',
|
|
69
|
-
height: '24px',
|
|
70
|
-
display: 'flex',
|
|
71
|
-
justifyContent: 'center'
|
|
72
|
-
},
|
|
73
|
-
onClick: remove(attachment),
|
|
74
|
-
"aria-label": "Remove file from message"
|
|
75
|
-
}, /*#__PURE__*/React.createElement("i", {
|
|
76
|
-
className: "fa fa-fw fa-times"
|
|
77
|
-
})));
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
var ChatInput = /*#__PURE__*/function (_Component) {
|
|
81
|
-
_inherits(ChatInput, _Component);
|
|
82
|
-
|
|
83
|
-
var _super = _createSuper(ChatInput);
|
|
84
|
-
|
|
85
|
-
function ChatInput(props) {
|
|
86
|
-
var _this;
|
|
87
|
-
|
|
88
|
-
_classCallCheck(this, ChatInput);
|
|
89
|
-
|
|
90
|
-
_this = _super.call(this, props);
|
|
91
|
-
|
|
92
|
-
_this.handleAttachmentCancel = function (attachment) {
|
|
93
|
-
return function (_e) {
|
|
94
|
-
_this.setState({
|
|
95
|
-
fileAttachments: _this.state.fileAttachments.filter(function (a) {
|
|
96
|
-
return a !== attachment;
|
|
97
|
-
})
|
|
98
|
-
});
|
|
99
|
-
};
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
_this.handleFocus = function () {
|
|
103
|
-
_this.setState({
|
|
104
|
-
hasFocus: true
|
|
105
|
-
});
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
_this.handleBlur = function () {
|
|
109
|
-
_this.setState({
|
|
110
|
-
hasFocus: false
|
|
111
|
-
});
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
_this.state = {
|
|
115
|
-
chatInput: '',
|
|
116
|
-
actionsOpen: false,
|
|
117
|
-
fileAttachments: [],
|
|
118
|
-
hasFocus: false
|
|
119
|
-
};
|
|
120
|
-
_this.handleSendChatMessage = _this.handleSendChatMessage.bind(_assertThisInitialized(_this));
|
|
121
|
-
_this.handleChatHotKey = _this.handleChatHotKey.bind(_assertThisInitialized(_this));
|
|
122
|
-
_this.handleChatInput = _this.handleChatInput.bind(_assertThisInitialized(_this));
|
|
123
|
-
_this.handleAttachmentDrop = _this.handleAttachmentDrop.bind(_assertThisInitialized(_this));
|
|
124
|
-
_this.handleAttachmentClick = _this.handleAttachmentClick.bind(_assertThisInitialized(_this));
|
|
125
|
-
_this.handleImagePaste = _this.handleImagePaste.bind(_assertThisInitialized(_this));
|
|
126
|
-
_this.handleDropzoneRef = _this.handleDropzoneRef.bind(_assertThisInitialized(_this));
|
|
127
|
-
_this.isChatInputInvalid = _this.isChatInputInvalid.bind(_assertThisInitialized(_this));
|
|
128
|
-
_this.toggleActionsOpen = _this.toggleActionsOpen.bind(_assertThisInitialized(_this));
|
|
129
|
-
_this.setActionsOpen = _this.setActionsOpen.bind(_assertThisInitialized(_this));
|
|
130
|
-
_this.cancelAction = _this.cancelAction.bind(_assertThisInitialized(_this));
|
|
131
|
-
return _this;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
_createClass(ChatInput, [{
|
|
135
|
-
key: "componentDidMount",
|
|
136
|
-
value: function componentDidMount() {
|
|
137
|
-
this.props.registerChatInput(this);
|
|
138
|
-
}
|
|
139
|
-
}, {
|
|
140
|
-
key: "handleSendChatMessage",
|
|
141
|
-
value: function handleSendChatMessage(e) {
|
|
142
|
-
e.preventDefault();
|
|
143
|
-
|
|
144
|
-
if (this.props.messageActions.editing) {
|
|
145
|
-
this.props.messageActions.edit(null);
|
|
146
|
-
this.props.dispatch({
|
|
147
|
-
type: SEND_MESSAGE_UPDATE,
|
|
148
|
-
payload: {
|
|
149
|
-
discussionId: this.props.discussion.id,
|
|
150
|
-
id: this.props.messageActions.editing.id,
|
|
151
|
-
message: this.state.chatInput,
|
|
152
|
-
attachment: this.state.fileAttachments
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
} else {
|
|
156
|
-
this.props.dispatch({
|
|
157
|
-
type: SEND_MESSAGE,
|
|
158
|
-
payload: {
|
|
159
|
-
id: this.props.discussion.id,
|
|
160
|
-
message: this.state.chatInput,
|
|
161
|
-
attachment: this.state.fileAttachments,
|
|
162
|
-
parentId: this.props.messageActions.replying && this.props.messageActions.replying.id
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
|
|
166
|
-
if (this.props.messageActions.replying) {
|
|
167
|
-
this.props.messageActions.reply(null);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
this.setState({
|
|
172
|
-
chatInput: '',
|
|
173
|
-
fileAttachments: []
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
}, {
|
|
177
|
-
key: "handleChatHotKey",
|
|
178
|
-
value: function handleChatHotKey(_ref2) {
|
|
179
|
-
var e = _ref2.nativeEvent;
|
|
180
|
-
|
|
181
|
-
if (e.keyCode === 13 && !e.shiftKey && (this.state.chatInput.trim().length > 0 || this.state.fileAttachments.length > 0)) {
|
|
182
|
-
// Handle enter (but not shift enter.)
|
|
183
|
-
this.handleSendChatMessage(e);
|
|
184
|
-
} else if (e.keyCode === 13 && !e.shiftKey) {
|
|
185
|
-
e.preventDefault();
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
}, {
|
|
189
|
-
key: "handleChatInput",
|
|
190
|
-
value: function handleChatInput(event, value) {
|
|
191
|
-
this.setState({
|
|
192
|
-
chatInput: value
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
}, {
|
|
196
|
-
key: "editMessage",
|
|
197
|
-
value: function editMessage(message) {
|
|
198
|
-
var _message$content = _toArray(message.content),
|
|
199
|
-
textToken = _message$content[0],
|
|
200
|
-
attachmentTokens = _message$content.slice(1);
|
|
201
|
-
|
|
202
|
-
this.setState({
|
|
203
|
-
chatInput: textToken.value,
|
|
204
|
-
fileAttachments: attachmentTokens
|
|
205
|
-
});
|
|
206
|
-
this.contentEditable.focus();
|
|
207
|
-
}
|
|
208
|
-
}, {
|
|
209
|
-
key: "focus",
|
|
210
|
-
value: function focus() {
|
|
211
|
-
this.contentEditable.focus();
|
|
212
|
-
}
|
|
213
|
-
}, {
|
|
214
|
-
key: "cancelAction",
|
|
215
|
-
value: function cancelAction() {
|
|
216
|
-
this.props.messageActions.edit(null);
|
|
217
|
-
this.props.messageActions.reply(null);
|
|
218
|
-
this.setState({
|
|
219
|
-
chatInput: '',
|
|
220
|
-
fileAttachments: []
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
}, {
|
|
224
|
-
key: "handleAttachmentDrop",
|
|
225
|
-
value: function handleAttachmentDrop(files) {
|
|
226
|
-
var _this2 = this;
|
|
227
|
-
|
|
228
|
-
var notAlreadyAttached = files.filter(function (file) {
|
|
229
|
-
return !_this2.state.fileAttachments.find(function (fa) {
|
|
230
|
-
return fa.name === file.name;
|
|
231
|
-
});
|
|
232
|
-
}); // Store the dropped/selected file.
|
|
233
|
-
|
|
234
|
-
this.setState({
|
|
235
|
-
fileAttachments: this.state.fileAttachments.concat(notAlreadyAttached)
|
|
236
|
-
}); // And in case the action menu was open, close it.
|
|
237
|
-
|
|
238
|
-
this.setActionsOpen(false);
|
|
239
|
-
}
|
|
240
|
-
}, {
|
|
241
|
-
key: "handleAttachmentClick",
|
|
242
|
-
value: function handleAttachmentClick() {
|
|
243
|
-
this.dropzone.open();
|
|
244
|
-
}
|
|
245
|
-
}, {
|
|
246
|
-
key: "handleImagePaste",
|
|
247
|
-
value: function handleImagePaste(e) {
|
|
248
|
-
var _this3 = this;
|
|
249
|
-
|
|
250
|
-
// Get the pasted image file
|
|
251
|
-
var files = _toConsumableArray((e.clipboardData || e.originalEvent.clipboardData).items).filter(function (i) {
|
|
252
|
-
return /image/.test(i.type);
|
|
253
|
-
}).map(function (i) {
|
|
254
|
-
return i.getAsFile();
|
|
255
|
-
});
|
|
256
|
-
|
|
257
|
-
var notAlreadyAttached = files.filter(function (file) {
|
|
258
|
-
return !_this3.state.fileAttachments.find(function (fa) {
|
|
259
|
-
return fa.name === file.name;
|
|
260
|
-
});
|
|
261
|
-
});
|
|
262
|
-
|
|
263
|
-
if (notAlreadyAttached.length > 0) {
|
|
264
|
-
// Add preview property to files
|
|
265
|
-
notAlreadyAttached.forEach(function (f) {
|
|
266
|
-
f.preview = URL.createObjectURL(f);
|
|
267
|
-
}); // Store the pasted image file.
|
|
268
|
-
|
|
269
|
-
this.setState({
|
|
270
|
-
fileAttachments: this.state.fileAttachments.concat(notAlreadyAttached)
|
|
271
|
-
});
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
}, {
|
|
275
|
-
key: "handleDropzoneRef",
|
|
276
|
-
value: function handleDropzoneRef(dropzone) {
|
|
277
|
-
this.dropzone = dropzone;
|
|
278
|
-
}
|
|
279
|
-
}, {
|
|
280
|
-
key: "toggleActionsOpen",
|
|
281
|
-
value: function toggleActionsOpen() {
|
|
282
|
-
this.setState(function (state) {
|
|
283
|
-
return {
|
|
284
|
-
actionsOpen: !state.actionsOpen
|
|
285
|
-
};
|
|
286
|
-
});
|
|
287
|
-
}
|
|
288
|
-
}, {
|
|
289
|
-
key: "setActionsOpen",
|
|
290
|
-
value: function setActionsOpen(actionsOpen) {
|
|
291
|
-
this.setState({
|
|
292
|
-
actionsOpen: actionsOpen
|
|
293
|
-
});
|
|
294
|
-
}
|
|
295
|
-
}, {
|
|
296
|
-
key: "isChatInputInvalid",
|
|
297
|
-
value: function isChatInputInvalid() {
|
|
298
|
-
return !this.state.chatInput && this.state.fileAttachments.length === 0;
|
|
299
|
-
}
|
|
300
|
-
}, {
|
|
301
|
-
key: "render",
|
|
302
|
-
value: function render() {
|
|
303
|
-
var _this4 = this;
|
|
304
|
-
|
|
305
|
-
return /*#__PURE__*/React.createElement(Dropzone, {
|
|
306
|
-
disableClick: true,
|
|
307
|
-
ref: this.handleDropzoneRef,
|
|
308
|
-
onDrop: this.handleAttachmentDrop,
|
|
309
|
-
multiple: true,
|
|
310
|
-
style: {},
|
|
311
|
-
className: "discussion__dropzone"
|
|
312
|
-
}, /*#__PURE__*/React.createElement("form", {
|
|
313
|
-
onSubmit: this.handleSendChatMessage,
|
|
314
|
-
className: "message-form message-form--default ".concat(this.props.messageActions.editing ? 'is-editing' : '', " ").concat(this.props.messageActions.replying ? 'is-replying' : '')
|
|
315
|
-
}, !this.props.discussion.isArchived && /*#__PURE__*/React.createElement(ButtonDropdown, {
|
|
316
|
-
isOpen: this.state.actionsOpen,
|
|
317
|
-
toggle: this.toggleActionsOpen,
|
|
318
|
-
direction: "up",
|
|
319
|
-
"aria-label": "More discussion options"
|
|
320
|
-
}, /*#__PURE__*/React.createElement(DropdownToggle, {
|
|
321
|
-
color: "subtle" // tabIndex={2}
|
|
322
|
-
|
|
323
|
-
}, /*#__PURE__*/React.createElement("i", {
|
|
324
|
-
className: "fa fa-fw fa-plus",
|
|
325
|
-
"aria-hidden": "true"
|
|
326
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
327
|
-
className: "sr-only"
|
|
328
|
-
}, "Add File or Invite Person")), /*#__PURE__*/React.createElement(DropdownMenu, null, /*#__PURE__*/React.createElement(DropdownItem, {
|
|
329
|
-
onClick: this.handleAttachmentClick
|
|
330
|
-
}, /*#__PURE__*/React.createElement("i", {
|
|
331
|
-
className: "fa fa-fw fa-paperclip"
|
|
332
|
-
}), " Add File"), /*#__PURE__*/React.createElement(DropdownItem, {
|
|
333
|
-
onClick: this.props.toggleInvitationForm
|
|
334
|
-
}, /*#__PURE__*/React.createElement("i", {
|
|
335
|
-
className: "fa fa-fw fa-plus"
|
|
336
|
-
}), " Invite Person"))), /*#__PURE__*/React.createElement(Popover, {
|
|
337
|
-
className: "reply-popover",
|
|
338
|
-
placement: "top-start",
|
|
339
|
-
hideArrow: true,
|
|
340
|
-
isOpen: !!this.props.messageActions.replying,
|
|
341
|
-
target: "chatInput"
|
|
342
|
-
}, this.props.messageActions.replying && /*#__PURE__*/React.createElement(PopoverBody, null, "\u21AA In reply to", ' ', this.props.messageActions.replying.createdBy.displayName)), /*#__PURE__*/React.createElement("div", {
|
|
343
|
-
className: "message-form__input",
|
|
344
|
-
id: "chatInput"
|
|
345
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
346
|
-
style: {
|
|
347
|
-
display: 'flex',
|
|
348
|
-
flexDirection: 'row'
|
|
349
|
-
}
|
|
350
|
-
}, this.state.fileAttachments.map(function (attachment) {
|
|
351
|
-
return /*#__PURE__*/React.createElement(UploadCard, {
|
|
352
|
-
key: attachment.value ? attachment.value.documentId : attachment.name,
|
|
353
|
-
discussion: _this4.props.discussion,
|
|
354
|
-
message: _this4.props.messageActions.editing,
|
|
355
|
-
attachment: attachment,
|
|
356
|
-
remove: _this4.handleAttachmentCancel
|
|
357
|
-
});
|
|
358
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
359
|
-
className: classNames('message-form__placeholder', {
|
|
360
|
-
'is-hidden': this.state.chatInput !== '' || this.props.discussion.isArchived
|
|
361
|
-
})
|
|
362
|
-
}, "Type your message here\u2026"), !this.props.discussion.isArchived ? /*#__PURE__*/React.createElement(ContentEditable, {
|
|
363
|
-
ref: function ref(element) {
|
|
364
|
-
return _this4.contentEditable = element;
|
|
365
|
-
} // tabIndex={1}
|
|
366
|
-
,
|
|
367
|
-
tagName: "div",
|
|
368
|
-
className: "message-form__editor",
|
|
369
|
-
contentEditable: "plaintext-only",
|
|
370
|
-
html: this.state.chatInput,
|
|
371
|
-
onChange: this.handleChatInput,
|
|
372
|
-
onKeyPress: this.handleChatHotKey,
|
|
373
|
-
onFocus: this.handleFocus,
|
|
374
|
-
onBlur: this.handleBlur,
|
|
375
|
-
onPaste: this.handleImagePaste,
|
|
376
|
-
"aria-label": "Type your message here\u2026"
|
|
377
|
-
}) : /*#__PURE__*/React.createElement("div", {
|
|
378
|
-
className: "message-form__editor is-disabled text-danger"
|
|
379
|
-
}, "This discussion has been archived and is read-only.")), (this.props.messageActions.editing || this.props.messageActions.replying) && /*#__PURE__*/React.createElement("button", {
|
|
380
|
-
type: "button",
|
|
381
|
-
className: "btn btn-subtle btn-cancel",
|
|
382
|
-
onClick: this.cancelAction,
|
|
383
|
-
"aria-label": "Cancel Discussion Message" // tabIndex={3}
|
|
384
|
-
|
|
385
|
-
}, /*#__PURE__*/React.createElement("i", {
|
|
386
|
-
className: "fa fa-fw fa-times",
|
|
387
|
-
"aria-hidden": "true"
|
|
388
|
-
})), !this.props.discussion.isArchived && /*#__PURE__*/React.createElement("button", {
|
|
389
|
-
type: "submit",
|
|
390
|
-
className: "btn btn-subtle btn-send",
|
|
391
|
-
disabled: this.isChatInputInvalid(),
|
|
392
|
-
"aria-label": "Send Discussion Message" // tabIndex={3}
|
|
393
|
-
|
|
394
|
-
}, this.props.messageActions.editing ? /*#__PURE__*/React.createElement("i", {
|
|
395
|
-
className: "fa fa-fw fa-check",
|
|
396
|
-
"aria-hidden": "true"
|
|
397
|
-
}) : /*#__PURE__*/React.createElement("i", {
|
|
398
|
-
className: "fa fa-fw fa-paper-plane",
|
|
399
|
-
"aria-hidden": "true"
|
|
400
|
-
}))), this.state.hasFocus && /*#__PURE__*/React.createElement("div", {
|
|
401
|
-
className: "markdown-help"
|
|
402
|
-
}, /*#__PURE__*/React.createElement("strong", {
|
|
403
|
-
className: "markdown-help__sample"
|
|
404
|
-
}, "**Bold**"), /*#__PURE__*/React.createElement("em", {
|
|
405
|
-
className: "markdown-help__sample"
|
|
406
|
-
}, "_Italics_"), /*#__PURE__*/React.createElement("span", {
|
|
407
|
-
className: "markdown-help__sample"
|
|
408
|
-
}, "~~", /*#__PURE__*/React.createElement("strike", null, "Strike"), "~~"), /*#__PURE__*/React.createElement("span", {
|
|
409
|
-
className: "markdown-help__sample"
|
|
410
|
-
}, ">Blockquote")));
|
|
411
|
-
}
|
|
412
|
-
}]);
|
|
413
|
-
|
|
414
|
-
return ChatInput;
|
|
415
|
-
}(Component);
|
|
416
|
-
|
|
417
|
-
export var ConnectedChatInputForm = compose(connect(null))(ChatInput);
|
|
418
|
-
export var ChatInputForm = function ChatInputForm(props) {
|
|
419
|
-
return /*#__PURE__*/React.createElement(ConnectedChatInputForm, props);
|
|
420
|
-
}; // (
|
|
421
|
-
// <Provider>
|
|
422
|
-
// <ConnectedChatInputForm {...props} />
|
|
423
|
-
// </Provider>
|
|
424
|
-
// );
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import moment from 'moment';
|
|
3
|
-
|
|
4
|
-
var DateBanner = function DateBanner(props) {
|
|
5
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
6
|
-
className: "date-divider"
|
|
7
|
-
}, /*#__PURE__*/React.createElement("hr", null), /*#__PURE__*/React.createElement("span", null, moment(props.date).format('MMMM Do, YYYY')), /*#__PURE__*/React.createElement("hr", null));
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export { DateBanner };
|