@atlaskit/rovo-triggers 5.9.0 → 5.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/dist/cjs/common/utils/post-message-to-pubsub/index.js +4 -1
- package/dist/es2019/common/utils/post-message-to-pubsub/index.js +4 -1
- package/dist/esm/common/utils/post-message-to-pubsub/index.js +4 -1
- package/dist/types/types.d.ts +8 -0
- package/dist/types-ts4.5/types.d.ts +8 -0
- package/package.json +7 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/rovo-triggers
|
|
2
2
|
|
|
3
|
+
## 5.11.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`fc63a95670a7c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/fc63a95670a7c) -
|
|
8
|
+
Fix postMessage origin options
|
|
9
|
+
|
|
10
|
+
## 5.10.0
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- [`15228c9272ac3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/15228c9272ac3) -
|
|
15
|
+
Added overrideAutoSend param to insert-prompt payload to allow for overriding default auto-send
|
|
16
|
+
behavior for prompts
|
|
17
|
+
|
|
3
18
|
## 5.9.0
|
|
4
19
|
|
|
5
20
|
### Minor Changes
|
|
@@ -8,6 +8,7 @@ exports.useRovoPostMessageToPubsub = exports.isAllowedOrigin = exports.RovoPostM
|
|
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
9
|
var _react = require("react");
|
|
10
10
|
var _bindEventListener = require("bind-event-listener");
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
12
|
var _main = require("../../../main");
|
|
12
13
|
var ROVO_POST_MESSAGE_EVENT_TYPE = exports.ROVO_POST_MESSAGE_EVENT_TYPE = 'rovo-post-message';
|
|
13
14
|
var ROVO_POST_MESSAGE_ACK_EVENT_TYPE = exports.ROVO_POST_MESSAGE_ACK_EVENT_TYPE = 'rovo-post-message-ack';
|
|
@@ -40,7 +41,9 @@ var RovoPostMessagePubsubListener = exports.RovoPostMessagePubsubListener = func
|
|
|
40
41
|
eventType: ROVO_POST_MESSAGE_ACK_EVENT_TYPE,
|
|
41
42
|
payloadId: eventData.payloadId
|
|
42
43
|
};
|
|
43
|
-
(_event$source = event.source) === null || _event$source === void 0 || _event$source.postMessage(ackPayload)
|
|
44
|
+
(_event$source = event.source) === null || _event$source === void 0 || _event$source.postMessage(ackPayload, (0, _platformFeatureFlags.fg)('ai-mate-pub-sub-post-message-origin-fix') ? {
|
|
45
|
+
targetOrigin: '*'
|
|
46
|
+
} : undefined);
|
|
44
47
|
publish(event.data.payload);
|
|
45
48
|
}
|
|
46
49
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
2
|
import { bind } from 'bind-event-listener';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
4
|
import { usePublish } from '../../../main';
|
|
4
5
|
export const ROVO_POST_MESSAGE_EVENT_TYPE = 'rovo-post-message';
|
|
5
6
|
export const ROVO_POST_MESSAGE_ACK_EVENT_TYPE = 'rovo-post-message-ack';
|
|
@@ -30,7 +31,9 @@ export const RovoPostMessagePubsubListener = () => {
|
|
|
30
31
|
eventType: ROVO_POST_MESSAGE_ACK_EVENT_TYPE,
|
|
31
32
|
payloadId: eventData.payloadId
|
|
32
33
|
};
|
|
33
|
-
(_event$source = event.source) === null || _event$source === void 0 ? void 0 : _event$source.postMessage(ackPayload)
|
|
34
|
+
(_event$source = event.source) === null || _event$source === void 0 ? void 0 : _event$source.postMessage(ackPayload, fg('ai-mate-pub-sub-post-message-origin-fix') ? {
|
|
35
|
+
targetOrigin: '*'
|
|
36
|
+
} : undefined);
|
|
34
37
|
publish(event.data.payload);
|
|
35
38
|
}
|
|
36
39
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { bind } from 'bind-event-listener';
|
|
4
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
5
|
import { usePublish } from '../../../main';
|
|
5
6
|
export var ROVO_POST_MESSAGE_EVENT_TYPE = 'rovo-post-message';
|
|
6
7
|
export var ROVO_POST_MESSAGE_ACK_EVENT_TYPE = 'rovo-post-message-ack';
|
|
@@ -33,7 +34,9 @@ export var RovoPostMessagePubsubListener = function RovoPostMessagePubsubListene
|
|
|
33
34
|
eventType: ROVO_POST_MESSAGE_ACK_EVENT_TYPE,
|
|
34
35
|
payloadId: eventData.payloadId
|
|
35
36
|
};
|
|
36
|
-
(_event$source = event.source) === null || _event$source === void 0 || _event$source.postMessage(ackPayload)
|
|
37
|
+
(_event$source = event.source) === null || _event$source === void 0 || _event$source.postMessage(ackPayload, fg('ai-mate-pub-sub-post-message-origin-fix') ? {
|
|
38
|
+
targetOrigin: '*'
|
|
39
|
+
} : undefined);
|
|
37
40
|
publish(event.data.payload);
|
|
38
41
|
}
|
|
39
42
|
}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -132,6 +132,14 @@ export type ForgeAppAuthFailure = PayloadCore<'forge-auth-failure', {
|
|
|
132
132
|
*/
|
|
133
133
|
export type InsertPromptPayload = PayloadCore<'insert-prompt', {
|
|
134
134
|
prompt: string;
|
|
135
|
+
/**
|
|
136
|
+
* Overrides the default auto-send behavior for prompts.
|
|
137
|
+
* By default, prompts with backticks (`) are inserted as placeholders into the chat input
|
|
138
|
+
* (backticks indicate a placeholder), while prompts without backticks are sent immediately.
|
|
139
|
+
* Set this to true to insert prompts not containing backticks into the chat input for dynamic
|
|
140
|
+
* user completion, rather than sending them immediately.
|
|
141
|
+
*/
|
|
142
|
+
overrideAutoSend?: boolean;
|
|
135
143
|
} & PlaceholderParam>;
|
|
136
144
|
/** Inserts URLs as inline nodes into the chat input
|
|
137
145
|
* - URLs are deduplicated against existing content
|
|
@@ -132,6 +132,14 @@ export type ForgeAppAuthFailure = PayloadCore<'forge-auth-failure', {
|
|
|
132
132
|
*/
|
|
133
133
|
export type InsertPromptPayload = PayloadCore<'insert-prompt', {
|
|
134
134
|
prompt: string;
|
|
135
|
+
/**
|
|
136
|
+
* Overrides the default auto-send behavior for prompts.
|
|
137
|
+
* By default, prompts with backticks (`) are inserted as placeholders into the chat input
|
|
138
|
+
* (backticks indicate a placeholder), while prompts without backticks are sent immediately.
|
|
139
|
+
* Set this to true to insert prompts not containing backticks into the chat input for dynamic
|
|
140
|
+
* user completion, rather than sending them immediately.
|
|
141
|
+
*/
|
|
142
|
+
overrideAutoSend?: boolean;
|
|
135
143
|
} & PlaceholderParam>;
|
|
136
144
|
/** Inserts URLs as inline nodes into the chat input
|
|
137
145
|
* - URLs are deduplicated against existing content
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/rovo-triggers",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.11.0",
|
|
4
4
|
"description": "Provides various trigger events to drive Rovo Chat functionality, such as a publish-subscribe and URL parameter hooks",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"publishConfig": {
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"atlaskit:src": "src/index.ts",
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@atlaskit/adf-schema": "^51.5.0",
|
|
33
|
+
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
33
34
|
"@babel/runtime": "^7.0.0",
|
|
34
35
|
"bind-event-listener": "^3.0.0"
|
|
35
36
|
},
|
|
@@ -85,5 +86,10 @@
|
|
|
85
86
|
"import-no-extraneous-disable-for-examples-and-docs"
|
|
86
87
|
]
|
|
87
88
|
}
|
|
89
|
+
},
|
|
90
|
+
"platform-feature-flags": {
|
|
91
|
+
"ai-mate-pub-sub-post-message-origin-fix": {
|
|
92
|
+
"type": "boolean"
|
|
93
|
+
}
|
|
88
94
|
}
|
|
89
95
|
}
|