@atlaskit/editor-plugin-insert-block 1.13.0 → 1.14.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 +16 -0
- package/dist/cjs/plugin.js +23 -3
- package/dist/cjs/ui/ElementBrowser/InsertMenu.js +47 -13
- package/dist/cjs/ui/ElementRail/index.js +186 -2
- package/dist/cjs/ui/ElementRail/useInsertMenuRailItems.js +63 -0
- package/dist/cjs/ui/templateOptions.js +128 -57
- package/dist/cjs/ui/templates.js +1130 -0
- package/dist/es2019/plugin.js +23 -3
- package/dist/es2019/ui/ElementBrowser/InsertMenu.js +61 -26
- package/dist/es2019/ui/ElementRail/index.js +189 -1
- package/dist/es2019/ui/ElementRail/useInsertMenuRailItems.js +54 -0
- package/dist/es2019/ui/templateOptions.js +78 -11
- package/dist/es2019/ui/templates.js +1118 -0
- package/dist/esm/plugin.js +23 -3
- package/dist/esm/ui/ElementBrowser/InsertMenu.js +47 -13
- package/dist/esm/ui/ElementRail/index.js +185 -2
- package/dist/esm/ui/ElementRail/useInsertMenuRailItems.js +56 -0
- package/dist/esm/ui/templateOptions.js +128 -57
- package/dist/esm/ui/templates.js +1124 -0
- package/dist/types/ui/ElementRail/index.d.ts +7 -4
- package/dist/types/ui/ElementRail/useInsertMenuRailItems.d.ts +4 -0
- package/dist/types/ui/ToolbarInsertBlock/create-items.d.ts +1 -1
- package/dist/types/ui/templateOptions.d.ts +3 -1
- package/dist/types/ui/templates.d.ts +522 -0
- package/dist/types-ts4.5/ui/ElementRail/index.d.ts +7 -4
- package/dist/types-ts4.5/ui/ElementRail/useInsertMenuRailItems.d.ts +4 -0
- package/dist/types-ts4.5/ui/ToolbarInsertBlock/create-items.d.ts +1 -1
- package/dist/types-ts4.5/ui/templateOptions.d.ts +3 -1
- package/dist/types-ts4.5/ui/templates.d.ts +522 -0
- package/package.json +6 -4
|
@@ -6,65 +6,136 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.templateOptions = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
10
|
+
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
9
11
|
var _actionList = _interopRequireDefault(require("../assets/action-list"));
|
|
10
12
|
var _approvalsTracker = _interopRequireDefault(require("../assets/approvals-tracker"));
|
|
11
13
|
var _decisionMatrix = _interopRequireDefault(require("../assets/decision-matrix"));
|
|
12
14
|
var _discussionNotes = _interopRequireDefault(require("../assets/discussion-notes"));
|
|
13
15
|
var _instructionsOutline = _interopRequireDefault(require("../assets/instructions-outline"));
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
16
|
+
var _templates = require("./templates");
|
|
17
|
+
var getTemplateInsertionPayload = function getTemplateInsertionPayload(templateType, source) {
|
|
18
|
+
return {
|
|
19
|
+
action: _analytics.ACTION.INSERTED,
|
|
20
|
+
actionSubject: _analytics.ACTION_SUBJECT.DOCUMENT,
|
|
21
|
+
actionSubjectId: 'elementTemplate',
|
|
22
|
+
attributes: {
|
|
23
|
+
inputMethod: source !== null && source !== void 0 ? source : _analytics.INPUT_METHOD.QUICK_INSERT,
|
|
24
|
+
templateType: templateType
|
|
25
|
+
},
|
|
26
|
+
eventType: _analytics.EVENT_TYPE.TRACK
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
var getTableWidth = function getTableWidth(api) {
|
|
30
|
+
var _api$table;
|
|
31
|
+
return api !== null && api !== void 0 && (_api$table = api.table) !== null && _api$table !== void 0 && (_api$table = _api$table.sharedState.currentState()) !== null && _api$table !== void 0 && _api$table.isFullWidthModeEnabled ? 1800 : 760;
|
|
32
|
+
};
|
|
33
|
+
var templateOptions = exports.templateOptions = function templateOptions(api) {
|
|
34
|
+
return [{
|
|
35
|
+
title: 'Discussion notes',
|
|
36
|
+
// @ts-ignore
|
|
37
|
+
id: 'discussionNotes',
|
|
38
|
+
description: 'Record discussion points and action items',
|
|
39
|
+
keywords: ['decisions', 'summary', 'meeting', 'chat', 'debrief', 'track', 'keep track', 'tasks', 'outstanding items', 'owners'],
|
|
40
|
+
// Place templates right after AI item
|
|
41
|
+
priority: 99,
|
|
42
|
+
icon: function icon() {
|
|
43
|
+
return /*#__PURE__*/_react.default.createElement(_discussionNotes.default, null);
|
|
44
|
+
},
|
|
45
|
+
action: function action(insert, state, source) {
|
|
46
|
+
var _api$analytics;
|
|
47
|
+
var tr = insert(_model.Fragment.fromJSON(state.schema, (0, _templates.discussionNotes)(getTableWidth(api))), {
|
|
48
|
+
// @ts-ignore
|
|
49
|
+
isTemplate: true
|
|
50
|
+
});
|
|
51
|
+
api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 || _api$analytics.actions.attachAnalyticsEvent(
|
|
52
|
+
// @ts-ignore
|
|
53
|
+
getTemplateInsertionPayload('discussionNotes', source))(tr);
|
|
54
|
+
return tr;
|
|
55
|
+
}
|
|
56
|
+
}, {
|
|
57
|
+
title: 'Approvals tracker',
|
|
58
|
+
// @ts-ignore
|
|
59
|
+
id: 'approvalsTracker',
|
|
60
|
+
description: 'Track reviewer approvals and dates',
|
|
61
|
+
keywords: ['reviews', 'requests', 'rejected requests', 'review dates', 'timeline', 'checklist', 'sme timeline', 'sme requests', 'sme check', 'table'],
|
|
62
|
+
priority: 99,
|
|
63
|
+
icon: function icon() {
|
|
64
|
+
return /*#__PURE__*/_react.default.createElement(_approvalsTracker.default, null);
|
|
65
|
+
},
|
|
66
|
+
action: function action(insert, state, source) {
|
|
67
|
+
var _api$analytics2;
|
|
68
|
+
var tr = insert(_model.Fragment.fromJSON(state.schema, (0, _templates.approvalsTracker)(getTableWidth(api))), {
|
|
69
|
+
// @ts-ignore
|
|
70
|
+
isTemplate: true
|
|
71
|
+
});
|
|
72
|
+
api === null || api === void 0 || (_api$analytics2 = api.analytics) === null || _api$analytics2 === void 0 || _api$analytics2.actions.attachAnalyticsEvent(
|
|
73
|
+
// @ts-ignore
|
|
74
|
+
getTemplateInsertionPayload('approvalsTracker', source))(tr);
|
|
75
|
+
return tr;
|
|
76
|
+
}
|
|
77
|
+
}, {
|
|
78
|
+
title: 'Decision matrix',
|
|
79
|
+
// @ts-ignore
|
|
80
|
+
id: 'decisionMatrix',
|
|
81
|
+
description: 'Compare options and make recommendations',
|
|
82
|
+
keywords: ['pros', 'cons', 'recommended', 'rationale', 'evaluation', 'options', 'choice', 'table'],
|
|
83
|
+
priority: 99,
|
|
84
|
+
icon: function icon() {
|
|
85
|
+
return /*#__PURE__*/_react.default.createElement(_decisionMatrix.default, null);
|
|
86
|
+
},
|
|
87
|
+
action: function action(insert, state, source) {
|
|
88
|
+
var _api$analytics3;
|
|
89
|
+
var tr = insert(_model.Fragment.fromJSON(state.schema, (0, _templates.decisionMatrix)(getTableWidth(api))), {
|
|
90
|
+
// @ts-ignore
|
|
91
|
+
isTemplate: true
|
|
92
|
+
});
|
|
93
|
+
api === null || api === void 0 || (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 || _api$analytics3.actions.attachAnalyticsEvent(
|
|
94
|
+
// @ts-ignore
|
|
95
|
+
getTemplateInsertionPayload('decisionMatrix', source))(tr);
|
|
96
|
+
return tr;
|
|
97
|
+
}
|
|
98
|
+
}, {
|
|
99
|
+
title: 'List of actions',
|
|
100
|
+
// @ts-ignore
|
|
101
|
+
id: 'actionList',
|
|
102
|
+
description: 'Track tasks, assignees and deadlines',
|
|
103
|
+
keywords: ['checklist', 'check', 'items', 'shopping list', 'jtbd', 'jobs to be done', 'due date', 'progress', 'task', 'tasks', 'prioritization', 'timeline', 'approvals', 'reviewers', 'review date'],
|
|
104
|
+
priority: 99,
|
|
105
|
+
icon: function icon() {
|
|
106
|
+
return /*#__PURE__*/_react.default.createElement(_actionList.default, null);
|
|
107
|
+
},
|
|
108
|
+
action: function action(insert, state, source) {
|
|
109
|
+
var _api$analytics4;
|
|
110
|
+
// @ts-ignore
|
|
111
|
+
var tr = insert(_model.Fragment.fromJSON(state.schema, _templates.actionList), {
|
|
112
|
+
isTemplate: true
|
|
113
|
+
});
|
|
114
|
+
api === null || api === void 0 || (_api$analytics4 = api.analytics) === null || _api$analytics4 === void 0 || _api$analytics4.actions.attachAnalyticsEvent(
|
|
115
|
+
// @ts-ignore
|
|
116
|
+
getTemplateInsertionPayload('actionList', source))(tr);
|
|
117
|
+
return tr;
|
|
118
|
+
}
|
|
119
|
+
}, {
|
|
120
|
+
title: 'Instructions outline',
|
|
121
|
+
// @ts-ignore
|
|
122
|
+
id: 'instructionsOutline',
|
|
123
|
+
description: 'Detailed steps for any process',
|
|
124
|
+
keywords: ['steps', 'manual', 'tasks', 'jobs to be done', 'jtbd', 'how-to', 'guide', 'journey', 'checklist', 'tutorial', 'map', 'brochure', 'columns', 'layout', 'help'],
|
|
125
|
+
priority: 99,
|
|
126
|
+
icon: function icon() {
|
|
127
|
+
return /*#__PURE__*/_react.default.createElement(_instructionsOutline.default, null);
|
|
128
|
+
},
|
|
129
|
+
action: function action(insert, state, source) {
|
|
130
|
+
var _api$analytics5;
|
|
131
|
+
// @ts-ignore
|
|
132
|
+
var tr = insert(_model.Fragment.fromJSON(state.schema, _templates.instructionsOutline), {
|
|
133
|
+
isTemplate: true
|
|
134
|
+
});
|
|
135
|
+
api === null || api === void 0 || (_api$analytics5 = api.analytics) === null || _api$analytics5 === void 0 || _api$analytics5.actions.attachAnalyticsEvent(
|
|
136
|
+
// @ts-ignore
|
|
137
|
+
getTemplateInsertionPayload('instructionsOutline', source))(tr);
|
|
138
|
+
return tr;
|
|
139
|
+
}
|
|
140
|
+
}];
|
|
141
|
+
};
|