@atlaskit/editor-plugin-insert-block 1.14.4 → 1.14.5

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 CHANGED
@@ -1,5 +1,14 @@
1
1
  # @atlaskit/editor-plugin-insert-block
2
2
 
3
+ ## 1.14.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [`8c1e1dea50327`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8c1e1dea50327) -
8
+ [ED-24967] Add in code English locale targeting for `platform_editor_element_level_templates`
9
+ experiment
10
+ - Updated dependencies
11
+
3
12
  ## 1.14.4
4
13
 
5
14
  ### Patch Changes
@@ -212,11 +212,13 @@ var insertBlockPlugin = exports.insertBlockPlugin = function insertBlockPlugin(_
212
212
  // This is not the most ideal plugin to add this to, but it is suitable for experiment purpose
213
213
  // If we decide to ship the feature, we will consider a separate plugin if needed.
214
214
  // Experiment one-pager: https://hello.atlassian.net/wiki/spaces/ETM/pages/3983684902/Experiment+Drive+element+usage+via+element+templates
215
- quickInsert: function quickInsert() {
215
+ quickInsert: function quickInsert(intl) {
216
216
  var _options$UNSAFE_edito;
217
- if (
217
+ var locale = intl.locale;
218
+ var isEligible = locale.startsWith('en') &&
218
219
  // @ts-ignore
219
- ['full-page', 'full-width'].includes((_options$UNSAFE_edito = options.UNSAFE_editorAppearance) !== null && _options$UNSAFE_edito !== void 0 ? _options$UNSAFE_edito : '') && (0, _experiments.editorExperiment)('element-level-templates', true, {
220
+ ['full-page', 'full-width'].includes((_options$UNSAFE_edito = options.UNSAFE_editorAppearance) !== null && _options$UNSAFE_edito !== void 0 ? _options$UNSAFE_edito : '');
221
+ if (isEligible && (0, _experiments.editorExperiment)('element-level-templates', true, {
220
222
  exposure: true
221
223
  })) {
222
224
  return (0, _templateOptions.templateOptions)(api);
@@ -203,11 +203,15 @@ export const insertBlockPlugin = ({
203
203
  // This is not the most ideal plugin to add this to, but it is suitable for experiment purpose
204
204
  // If we decide to ship the feature, we will consider a separate plugin if needed.
205
205
  // Experiment one-pager: https://hello.atlassian.net/wiki/spaces/ETM/pages/3983684902/Experiment+Drive+element+usage+via+element+templates
206
- quickInsert: () => {
206
+ quickInsert: intl => {
207
207
  var _options$UNSAFE_edito;
208
- if (
208
+ const {
209
+ locale
210
+ } = intl;
211
+ const isEligible = locale.startsWith('en') &&
209
212
  // @ts-ignore
210
- ['full-page', 'full-width'].includes((_options$UNSAFE_edito = options.UNSAFE_editorAppearance) !== null && _options$UNSAFE_edito !== void 0 ? _options$UNSAFE_edito : '') && editorExperiment('element-level-templates', true, {
213
+ ['full-page', 'full-width'].includes((_options$UNSAFE_edito = options.UNSAFE_editorAppearance) !== null && _options$UNSAFE_edito !== void 0 ? _options$UNSAFE_edito : '');
214
+ if (isEligible && editorExperiment('element-level-templates', true, {
211
215
  exposure: true
212
216
  })) {
213
217
  return templateOptions(api);
@@ -202,11 +202,13 @@ export var insertBlockPlugin = function insertBlockPlugin(_ref) {
202
202
  // This is not the most ideal plugin to add this to, but it is suitable for experiment purpose
203
203
  // If we decide to ship the feature, we will consider a separate plugin if needed.
204
204
  // Experiment one-pager: https://hello.atlassian.net/wiki/spaces/ETM/pages/3983684902/Experiment+Drive+element+usage+via+element+templates
205
- quickInsert: function quickInsert() {
205
+ quickInsert: function quickInsert(intl) {
206
206
  var _options$UNSAFE_edito;
207
- if (
207
+ var locale = intl.locale;
208
+ var isEligible = locale.startsWith('en') &&
208
209
  // @ts-ignore
209
- ['full-page', 'full-width'].includes((_options$UNSAFE_edito = options.UNSAFE_editorAppearance) !== null && _options$UNSAFE_edito !== void 0 ? _options$UNSAFE_edito : '') && editorExperiment('element-level-templates', true, {
210
+ ['full-page', 'full-width'].includes((_options$UNSAFE_edito = options.UNSAFE_editorAppearance) !== null && _options$UNSAFE_edito !== void 0 ? _options$UNSAFE_edito : '');
211
+ if (isEligible && editorExperiment('element-level-templates', true, {
210
212
  exposure: true
211
213
  })) {
212
214
  return templateOptions(api);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-insert-block",
3
- "version": "1.14.4",
3
+ "version": "1.14.5",
4
4
  "description": "Insert block plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -64,7 +64,7 @@
64
64
  "@atlaskit/primitives": "^12.1.0",
65
65
  "@atlaskit/theme": "^13.0.0",
66
66
  "@atlaskit/tmp-editor-statsig": "^2.1.0",
67
- "@atlaskit/tokens": "^1.59.0",
67
+ "@atlaskit/tokens": "^1.60.0",
68
68
  "@atlaskit/tooltip": "18.7.2",
69
69
  "@babel/runtime": "^7.0.0",
70
70
  "@emotion/react": "^11.7.1",