@contentful/field-editor-markdown 1.2.0 → 1.3.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/dist/cjs/MarkdownActions.js +235 -0
- package/dist/cjs/MarkdownEditor.js +180 -0
- package/dist/cjs/__fixtures__/FakeSdk.js +183 -0
- package/dist/cjs/__fixtures__/asset/index.js +37 -0
- package/dist/cjs/__fixtures__/content-type/index.js +16 -0
- package/dist/cjs/__fixtures__/entry/index.js +33 -0
- package/dist/cjs/__fixtures__/fixtures.js +71 -0
- package/dist/cjs/__fixtures__/locale/index.js +40 -0
- package/dist/cjs/__fixtures__/space/index.js +16 -0
- package/dist/cjs/codemirrorImports.js +9 -0
- package/dist/cjs/components/HeadingSelector.js +66 -0
- package/dist/cjs/components/InsertLinkSelector.js +86 -0
- package/dist/cjs/components/MarkdownBottomBar.js +111 -0
- package/dist/cjs/components/MarkdownConstraints.js +79 -0
- package/dist/cjs/components/MarkdownPreview.js +249 -0
- package/dist/cjs/components/MarkdownTabs.js +128 -0
- package/dist/cjs/components/MarkdownTextarea/CodeMirrorWrapper.js +383 -0
- package/dist/cjs/components/MarkdownTextarea/MarkdownCommands.js +233 -0
- package/dist/cjs/components/MarkdownTextarea/MarkdownTextarea.js +190 -0
- package/dist/cjs/components/MarkdownTextarea/createMarkdownEditor.js +101 -0
- package/dist/cjs/components/MarkdownToolbar.js +367 -0
- package/dist/cjs/components/icons.js +193 -0
- package/dist/cjs/dialogs/CheatsheetModalDialog.js +239 -0
- package/dist/cjs/dialogs/ConfirmInsertAssetModalDialog.js +94 -0
- package/dist/cjs/dialogs/EmdebExternalContentDialog.js +202 -0
- package/dist/cjs/dialogs/InsertLinkModalDialog.js +149 -0
- package/dist/cjs/dialogs/InsertTableModalDialog.js +140 -0
- package/dist/cjs/dialogs/SpecialCharacterModalDialog.js +146 -0
- package/dist/cjs/dialogs/ZenModeModalDialog.js +257 -0
- package/dist/cjs/dialogs/openMarkdownDialog.js +121 -0
- package/dist/cjs/dialogs/renderMarkdownDialog.js +108 -0
- package/dist/cjs/index.js +29 -0
- package/dist/cjs/types.js +20 -0
- package/dist/cjs/utils/insertAssetLinks.js +122 -0
- package/dist/cjs/utils/insertAssetLinks.spec.js +22 -0
- package/dist/cjs/utils/isValidUrl.js +22 -0
- package/dist/cjs/utils/linkOrganizer.js +187 -0
- package/dist/cjs/utils/linkOrganizer.spec.js +96 -0
- package/dist/cjs/utils/replaceMailtoAmp.js +15 -0
- package/dist/cjs/utils/replaceMailtoAmp.spec.js +22 -0
- package/dist/cjs/utils/specialCharacters.js +228 -0
- package/dist/cjs/utils/userAgent.js +28 -0
- package/dist/esm/MarkdownActions.js +186 -0
- package/dist/esm/MarkdownEditor.js +118 -0
- package/dist/esm/__fixtures__/FakeSdk.js +173 -0
- package/dist/esm/__fixtures__/asset/index.js +6 -0
- package/dist/esm/__fixtures__/content-type/index.js +2 -0
- package/dist/esm/__fixtures__/entry/index.js +5 -0
- package/dist/esm/__fixtures__/fixtures.js +6 -0
- package/dist/esm/__fixtures__/locale/index.js +15 -0
- package/dist/esm/__fixtures__/space/index.js +2 -0
- package/dist/esm/codemirrorImports.js +5 -0
- package/dist/esm/components/HeadingSelector.js +17 -0
- package/dist/esm/components/InsertLinkSelector.js +37 -0
- package/dist/esm/components/MarkdownBottomBar.js +46 -0
- package/dist/esm/components/MarkdownConstraints.js +25 -0
- package/dist/esm/components/MarkdownPreview.js +195 -0
- package/dist/esm/components/MarkdownTabs.js +74 -0
- package/dist/esm/components/MarkdownTextarea/CodeMirrorWrapper.js +329 -0
- package/dist/esm/components/MarkdownTextarea/MarkdownCommands.js +218 -0
- package/dist/esm/components/MarkdownTextarea/MarkdownTextarea.js +136 -0
- package/dist/esm/components/MarkdownTextarea/createMarkdownEditor.js +52 -0
- package/dist/esm/components/MarkdownToolbar.js +302 -0
- package/dist/esm/components/icons.js +112 -0
- package/dist/esm/dialogs/CheatsheetModalDialog.js +177 -0
- package/dist/esm/dialogs/ConfirmInsertAssetModalDialog.js +37 -0
- package/dist/esm/dialogs/EmdebExternalContentDialog.js +140 -0
- package/dist/esm/dialogs/InsertLinkModalDialog.js +92 -0
- package/dist/esm/dialogs/InsertTableModalDialog.js +78 -0
- package/dist/esm/dialogs/SpecialCharacterModalDialog.js +84 -0
- package/dist/esm/dialogs/ZenModeModalDialog.js +195 -0
- package/dist/esm/dialogs/openMarkdownDialog.js +72 -0
- package/dist/esm/dialogs/renderMarkdownDialog.js +59 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/types.js +10 -0
- package/dist/esm/utils/insertAssetLinks.js +99 -0
- package/dist/esm/utils/insertAssetLinks.spec.js +18 -0
- package/dist/esm/utils/isValidUrl.js +4 -0
- package/dist/esm/utils/linkOrganizer.js +152 -0
- package/dist/esm/utils/linkOrganizer.spec.js +53 -0
- package/dist/esm/utils/replaceMailtoAmp.js +5 -0
- package/dist/esm/utils/replaceMailtoAmp.spec.js +18 -0
- package/dist/esm/utils/specialCharacters.js +218 -0
- package/dist/esm/utils/userAgent.js +13 -0
- package/dist/{MarkdownActions.d.ts → types/MarkdownActions.d.ts} +38 -38
- package/dist/{MarkdownEditor.d.ts → types/MarkdownEditor.d.ts} +22 -22
- package/dist/types/__fixtures__/FakeSdk.d.ts +8 -0
- package/dist/types/__fixtures__/asset/index.d.ts +6 -0
- package/dist/types/__fixtures__/content-type/index.d.ts +2 -0
- package/dist/types/__fixtures__/entry/index.d.ts +5 -0
- package/dist/types/__fixtures__/fixtures.d.ts +6 -0
- package/dist/types/__fixtures__/locale/index.d.ts +42 -0
- package/dist/types/__fixtures__/space/index.d.ts +2 -0
- package/dist/{codemirrorImports.d.ts → types/codemirrorImports.d.ts} +5 -5
- package/dist/{components → types/components}/HeadingSelector.d.ts +7 -7
- package/dist/{components → types/components}/InsertLinkSelector.d.ts +9 -9
- package/dist/{components → types/components}/MarkdownBottomBar.d.ts +11 -11
- package/dist/{components → types/components}/MarkdownConstraints.d.ts +6 -6
- package/dist/{components → types/components}/MarkdownPreview.d.ts +14 -14
- package/dist/{components → types/components}/MarkdownTabs.d.ts +8 -8
- package/dist/{components → types/components}/MarkdownTextarea/CodeMirrorWrapper.d.ts +58 -58
- package/dist/{components → types/components}/MarkdownTextarea/MarkdownCommands.d.ts +33 -33
- package/dist/{components → types/components}/MarkdownTextarea/MarkdownTextarea.d.ts +17 -17
- package/dist/{components → types/components}/MarkdownTextarea/createMarkdownEditor.d.ts +55 -55
- package/dist/{components → types/components}/MarkdownToolbar.d.ts +12 -12
- package/dist/types/components/icons.d.ts +18 -0
- package/dist/{dialogs → types/dialogs}/CheatsheetModalDialog.d.ts +4 -4
- package/dist/{dialogs → types/dialogs}/ConfirmInsertAssetModalDialog.d.ts +23 -23
- package/dist/{dialogs → types/dialogs}/EmdebExternalContentDialog.d.ts +9 -9
- package/dist/{dialogs → types/dialogs}/InsertLinkModalDialog.d.ts +17 -17
- package/dist/{dialogs → types/dialogs}/InsertTableModalDialog.d.ts +13 -13
- package/dist/{dialogs → types/dialogs}/SpecialCharacterModalDialog.d.ts +9 -9
- package/dist/{dialogs → types/dialogs}/ZenModeModalDialog.d.ts +24 -24
- package/dist/{dialogs → types/dialogs}/openMarkdownDialog.d.ts +5 -5
- package/dist/{dialogs → types/dialogs}/renderMarkdownDialog.d.ts +8 -8
- package/dist/{index.d.ts → types/index.d.ts} +5 -5
- package/dist/{types.d.ts → types/types.d.ts} +75 -75
- package/dist/{utils → types/utils}/insertAssetLinks.d.ts +29 -29
- package/dist/types/utils/insertAssetLinks.spec.d.ts +1 -0
- package/dist/{utils → types/utils}/isValidUrl.d.ts +2 -2
- package/dist/{utils → types/utils}/linkOrganizer.d.ts +6 -6
- package/dist/types/utils/linkOrganizer.spec.d.ts +1 -0
- package/dist/{utils → types/utils}/replaceMailtoAmp.d.ts +1 -1
- package/dist/types/utils/replaceMailtoAmp.spec.d.ts +1 -0
- package/dist/{utils → types/utils}/specialCharacters.d.ts +4 -4
- package/dist/{utils → types/utils}/userAgent.d.ts +1 -1
- package/package.json +25 -11
- package/CHANGELOG.md +0 -308
- package/dist/components/icons.d.ts +0 -18
- package/dist/field-editor-markdown.cjs.development.js +0 -3605
- package/dist/field-editor-markdown.cjs.development.js.map +0 -1
- package/dist/field-editor-markdown.cjs.production.min.js +0 -216
- package/dist/field-editor-markdown.cjs.production.min.js.map +0 -1
- package/dist/field-editor-markdown.esm.js +0 -3595
- package/dist/field-editor-markdown.esm.js.map +0 -1
- package/dist/index.js +0 -8
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
Zen: function() {
|
|
13
|
+
return Zen;
|
|
14
|
+
},
|
|
15
|
+
Strikethrough: function() {
|
|
16
|
+
return Strikethrough;
|
|
17
|
+
},
|
|
18
|
+
Indent: function() {
|
|
19
|
+
return Indent;
|
|
20
|
+
},
|
|
21
|
+
Dedent: function() {
|
|
22
|
+
return Dedent;
|
|
23
|
+
},
|
|
24
|
+
Cubes: function() {
|
|
25
|
+
return Cubes;
|
|
26
|
+
},
|
|
27
|
+
Table: function() {
|
|
28
|
+
return Table;
|
|
29
|
+
},
|
|
30
|
+
SpecialChar: function() {
|
|
31
|
+
return SpecialChar;
|
|
32
|
+
},
|
|
33
|
+
OrgLinks: function() {
|
|
34
|
+
return OrgLinks;
|
|
35
|
+
},
|
|
36
|
+
Undo: function() {
|
|
37
|
+
return Undo;
|
|
38
|
+
},
|
|
39
|
+
Redo: function() {
|
|
40
|
+
return Redo;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
const _react = _interop_require_wildcard(require("react"));
|
|
44
|
+
const _emotion = require("emotion");
|
|
45
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
46
|
+
if (typeof WeakMap !== "function") return null;
|
|
47
|
+
var cacheBabelInterop = new WeakMap();
|
|
48
|
+
var cacheNodeInterop = new WeakMap();
|
|
49
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
50
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
51
|
+
})(nodeInterop);
|
|
52
|
+
}
|
|
53
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
54
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
55
|
+
return obj;
|
|
56
|
+
}
|
|
57
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
58
|
+
return {
|
|
59
|
+
default: obj
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
63
|
+
if (cache && cache.has(obj)) {
|
|
64
|
+
return cache.get(obj);
|
|
65
|
+
}
|
|
66
|
+
var newObj = {};
|
|
67
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
68
|
+
for(var key in obj){
|
|
69
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
70
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
71
|
+
if (desc && (desc.get || desc.set)) {
|
|
72
|
+
Object.defineProperty(newObj, key, desc);
|
|
73
|
+
} else {
|
|
74
|
+
newObj[key] = obj[key];
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
newObj.default = obj;
|
|
79
|
+
if (cache) {
|
|
80
|
+
cache.set(obj, newObj);
|
|
81
|
+
}
|
|
82
|
+
return newObj;
|
|
83
|
+
}
|
|
84
|
+
const srOnly = (0, _emotion.css)({
|
|
85
|
+
position: 'absolute',
|
|
86
|
+
width: '1px',
|
|
87
|
+
height: '1px',
|
|
88
|
+
padding: '0',
|
|
89
|
+
margin: '-1px',
|
|
90
|
+
overflow: 'hidden',
|
|
91
|
+
clip: 'rect(0, 0, 0, 0)',
|
|
92
|
+
border: '0'
|
|
93
|
+
});
|
|
94
|
+
const Zen = ({ label , ...rest })=>_react.createElement("svg", {
|
|
95
|
+
width: 14,
|
|
96
|
+
height: 14,
|
|
97
|
+
viewBox: "0 0 1792 1792",
|
|
98
|
+
...rest
|
|
99
|
+
}, _react.createElement("path", {
|
|
100
|
+
d: "M1411 541l-355 355 355 355 144-144q29-31 70-14 39 17 39 59v448q0 26-19 45t-45 19h-448q-42 0-59-40-17-39 14-69l144-144-355-355-355 355 144 144q31 30 14 69-17 40-59 40H192q-26 0-45-19t-19-45v-448q0-42 40-59 39-17 69 14l144 144 355-355-355-355-144 144q-19 19-45 19-12 0-24-5-40-17-40-59V192q0-26 19-45t45-19h448q42 0 59 40 17 39-14 69L541 381l355 355 355-355-144-144q-31-30-14-69 17-40 59-40h448q26 0 45 19t19 45v448q0 42-39 59-13 5-25 5-26 0-45-19z"
|
|
101
|
+
}), _react.createElement("span", {
|
|
102
|
+
className: srOnly
|
|
103
|
+
}, label));
|
|
104
|
+
const Strikethrough = ({ label , ...rest })=>_react.createElement("svg", {
|
|
105
|
+
width: 14,
|
|
106
|
+
height: 14,
|
|
107
|
+
viewBox: "0 0 1792 1792",
|
|
108
|
+
...rest
|
|
109
|
+
}, _react.createElement("path", {
|
|
110
|
+
d: "M1760 896q14 0 23 9t9 23v64q0 14-9 23t-23 9H32q-14 0-23-9t-9-23v-64q0-14 9-23t23-9h1728zM483 832q-28-35-51-80-48-98-48-188 0-181 134-309 133-127 393-127 50 0 167 19 66 12 177 48 10 38 21 118 14 123 14 183 0 18-5 45l-12 3-84-6-14-2q-50-149-103-205-88-91-210-91-114 0-182 59-67 58-67 146 0 73 66 140t279 129q69 20 173 66 58 28 95 52H483zm507 256h411q7 39 7 92 0 111-41 212-23 56-71 104-37 35-109 81-80 48-153 66-80 21-203 21-114 0-195-23l-140-40q-57-16-72-28-8-8-8-22v-13q0-108-2-156-1-30 0-68l2-37v-44l102-2q15 34 30 71t22.5 56 12.5 27q35 57 80 94 43 36 105 57 59 22 132 22 64 0 139-27 77-26 122-86 47-61 47-129 0-84-81-157-34-29-137-71z"
|
|
111
|
+
}), _react.createElement("span", {
|
|
112
|
+
className: srOnly
|
|
113
|
+
}, label));
|
|
114
|
+
const Indent = ({ label , ...rest })=>_react.createElement("svg", {
|
|
115
|
+
width: 14,
|
|
116
|
+
height: 14,
|
|
117
|
+
viewBox: "0 0 1792 1792",
|
|
118
|
+
...rest
|
|
119
|
+
}, _react.createElement("path", {
|
|
120
|
+
d: "M352 832q0 14-9 23L55 1143q-9 9-23 9-13 0-22.5-9.5T0 1120V544q0-13 9.5-22.5T32 512q14 0 23 9l288 288q9 9 9 23zm1440 480v192q0 13-9.5 22.5t-22.5 9.5H32q-13 0-22.5-9.5T0 1504v-192q0-13 9.5-22.5T32 1280h1728q13 0 22.5 9.5t9.5 22.5zm0-384v192q0 13-9.5 22.5t-22.5 9.5H672q-13 0-22.5-9.5T640 1120V928q0-13 9.5-22.5T672 896h1088q13 0 22.5 9.5t9.5 22.5zm0-384v192q0 13-9.5 22.5T1760 768H672q-13 0-22.5-9.5T640 736V544q0-13 9.5-22.5T672 512h1088q13 0 22.5 9.5t9.5 22.5zm0-384v192q0 13-9.5 22.5T1760 384H32q-13 0-22.5-9.5T0 352V160q0-13 9.5-22.5T32 128h1728q13 0 22.5 9.5t9.5 22.5z"
|
|
121
|
+
}), _react.createElement("span", {
|
|
122
|
+
className: srOnly
|
|
123
|
+
}, label));
|
|
124
|
+
const Dedent = ({ label , ...rest })=>_react.createElement("svg", {
|
|
125
|
+
width: 14,
|
|
126
|
+
height: 14,
|
|
127
|
+
viewBox: "0 0 1792 1792",
|
|
128
|
+
...rest
|
|
129
|
+
}, _react.createElement("path", {
|
|
130
|
+
d: "M384 544v576q0 13-9.5 22.5T352 1152q-14 0-23-9L41 855q-9-9-9-23t9-23l288-288q9-9 23-9 13 0 22.5 9.5T384 544zm1408 768v192q0 13-9.5 22.5t-22.5 9.5H32q-13 0-22.5-9.5T0 1504v-192q0-13 9.5-22.5T32 1280h1728q13 0 22.5 9.5t9.5 22.5zm0-384v192q0 13-9.5 22.5t-22.5 9.5H672q-13 0-22.5-9.5T640 1120V928q0-13 9.5-22.5T672 896h1088q13 0 22.5 9.5t9.5 22.5zm0-384v192q0 13-9.5 22.5T1760 768H672q-13 0-22.5-9.5T640 736V544q0-13 9.5-22.5T672 512h1088q13 0 22.5 9.5t9.5 22.5zm0-384v192q0 13-9.5 22.5T1760 384H32q-13 0-22.5-9.5T0 352V160q0-13 9.5-22.5T32 128h1728q13 0 22.5 9.5t9.5 22.5z"
|
|
131
|
+
}), _react.createElement("span", {
|
|
132
|
+
className: srOnly
|
|
133
|
+
}, label));
|
|
134
|
+
const Cubes = ({ label , ...rest })=>_react.createElement("svg", {
|
|
135
|
+
width: 18,
|
|
136
|
+
height: 14,
|
|
137
|
+
viewBox: "0 0 2304 1792",
|
|
138
|
+
...rest
|
|
139
|
+
}, _react.createElement("path", {
|
|
140
|
+
d: "M640 1632l384-192v-314l-384 164v342zm-64-454l404-173-404-173-404 173zm1088 454l384-192v-314l-384 164v342zm-64-454l404-173-404-173-404 173zm-448-293l384-165V454l-384 164v267zm-64-379l441-189-441-189-441 189zm1088 518v416q0 36-19 67t-52 47l-448 224q-25 14-57 14t-57-14l-448-224q-4-2-7-4-2 2-7 4l-448 224q-25 14-57 14t-57-14L71 1554q-33-16-52-47t-19-67v-416q0-38 21.5-70T78 906l434-186V320q0-38 21.5-70t56.5-48l448-192q23-10 50-10t50 10l448 192q35 16 56.5 48t21.5 70v400l434 186q36 16 57 48t21 70z"
|
|
141
|
+
}), _react.createElement("span", {
|
|
142
|
+
className: srOnly
|
|
143
|
+
}, label));
|
|
144
|
+
const Table = ({ label , ...rest })=>_react.createElement("svg", {
|
|
145
|
+
width: 14,
|
|
146
|
+
height: 14,
|
|
147
|
+
viewBox: "0 0 1792 1792",
|
|
148
|
+
...rest
|
|
149
|
+
}, _react.createElement("path", {
|
|
150
|
+
d: "M576 1376v-192q0-14-9-23t-23-9H224q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zm0-384V800q0-14-9-23t-23-9H224q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zm512 384v-192q0-14-9-23t-23-9H736q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zM576 608V416q0-14-9-23t-23-9H224q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zm512 384V800q0-14-9-23t-23-9H736q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zm512 384v-192q0-14-9-23t-23-9h-320q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zm-512-768V416q0-14-9-23t-23-9H736q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zm512 384V800q0-14-9-23t-23-9h-320q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zm0-384V416q0-14-9-23t-23-9h-320q-14 0-23 9t-9 23v192q0 14 9 23t23 9h320q14 0 23-9t9-23zm128-320v1088q0 66-47 113t-113 47H224q-66 0-113-47t-47-113V288q0-66 47-113t113-47h1344q66 0 113 47t47 113z"
|
|
151
|
+
}), _react.createElement("span", {
|
|
152
|
+
className: srOnly
|
|
153
|
+
}, label));
|
|
154
|
+
const SpecialChar = ({ label , ...rest })=>_react.createElement("svg", {
|
|
155
|
+
width: 14,
|
|
156
|
+
height: 14,
|
|
157
|
+
viewBox: "0 0 1792 1792",
|
|
158
|
+
...rest
|
|
159
|
+
}, _react.createElement("path", {
|
|
160
|
+
d: "M1360 1307l35 159q3 12-3 22.5t-17 14.5l-5 1q-4 2-10.5 3.5t-16 4.5-21.5 5.5-25.5 5-30 5-33.5 4.5-36.5 3-38.5 1q-234 0-409-130.5T511 1054h-95q-13 0-22.5-9.5T384 1022V909q0-13 9.5-22.5T416 877h66q-2-57 1-105h-67q-14 0-23-9t-9-23V626q0-14 9-23t23-9h98q67-210 243.5-338T1158 128q102 0 194 23 11 3 20 15 6 11 3 24l-43 159q-3 13-14 19.5t-24 2.5l-4-1q-4-1-11.5-2.5L1261 364l-22.5-3.5-26-3-29-2.5-29.5-1q-126 0-226 64T778 594h468q16 0 25 12 10 12 7 26l-24 114q-5 26-32 26H734q-3 37 0 105h459q15 0 25 12 9 12 6 27l-24 112q-2 11-11 18.5t-20 7.5H782q48 117 149.5 185.5T1160 1308q18 0 36-1.5t33.5-3.5 29.5-4.5 24.5-5 18.5-4.5l12-3 5-2q13-5 26 2 12 7 15 21z"
|
|
161
|
+
}), _react.createElement("span", {
|
|
162
|
+
className: srOnly
|
|
163
|
+
}, label));
|
|
164
|
+
const OrgLinks = ({ label , ...rest })=>_react.createElement("svg", {
|
|
165
|
+
width: 14,
|
|
166
|
+
height: 14,
|
|
167
|
+
viewBox: "0 0 1792 1792",
|
|
168
|
+
...rest
|
|
169
|
+
}, _react.createElement("path", {
|
|
170
|
+
d: "M1792 1248v320q0 40-28 68t-68 28h-320q-40 0-68-28t-28-68v-320q0-40 28-68t68-28h96V960H960v192h96q40 0 68 28t28 68v320q0 40-28 68t-68 28H736q-40 0-68-28t-28-68v-320q0-40 28-68t68-28h96V960H320v192h96q40 0 68 28t28 68v320q0 40-28 68t-68 28H96q-40 0-68-28t-28-68v-320q0-40 28-68t68-28h96V960q0-52 38-90t90-38h512V640h-96q-40 0-68-28t-28-68V224q0-40 28-68t68-28h320q40 0 68 28t28 68v320q0 40-28 68t-68 28h-96v192h512q52 0 90 38t38 90v192h96q40 0 68 28t28 68z"
|
|
171
|
+
}), _react.createElement("span", {
|
|
172
|
+
className: srOnly
|
|
173
|
+
}, label));
|
|
174
|
+
const Undo = ({ label , ...rest })=>_react.createElement("svg", {
|
|
175
|
+
width: 14,
|
|
176
|
+
height: 14,
|
|
177
|
+
viewBox: "0 0 1792 1792",
|
|
178
|
+
...rest
|
|
179
|
+
}, _react.createElement("path", {
|
|
180
|
+
d: "M1664 896q0 156-61 298t-164 245-245 164-298 61q-172 0-327-72.5T305 1387q-7-10-6.5-22.5t8.5-20.5l137-138q10-9 25-9 16 2 23 12 73 95 179 147t225 52q104 0 198.5-40.5T1258 1258t109.5-163.5T1408 896t-40.5-198.5T1258 534t-163.5-109.5T896 384q-98 0-188 35.5T548 521l137 138q31 30 14 69-17 40-59 40H192q-26 0-45-19t-19-45V256q0-42 40-59 39-17 69 14l130 129q107-101 244.5-156.5T896 128q156 0 298 61t245 164 164 245 61 298z"
|
|
181
|
+
}), _react.createElement("span", {
|
|
182
|
+
className: srOnly
|
|
183
|
+
}, label));
|
|
184
|
+
const Redo = ({ label , ...rest })=>_react.createElement("svg", {
|
|
185
|
+
width: 14,
|
|
186
|
+
height: 14,
|
|
187
|
+
viewBox: "0 0 1792 1792",
|
|
188
|
+
...rest
|
|
189
|
+
}, _react.createElement("path", {
|
|
190
|
+
d: "M1664 256v448q0 26-19 45t-45 19h-448q-42 0-59-40-17-39 14-69l138-138q-148-137-349-137-104 0-198.5 40.5T534 534 424.5 697.5 384 896t40.5 198.5T534 1258t163.5 109.5T896 1408q119 0 225-52t179-147q7-10 23-12 15 0 25 9l137 138q9 8 9.5 20.5t-7.5 22.5q-109 132-264 204.5T896 1664q-156 0-298-61t-245-164-164-245-61-298 61-298 164-245 245-164 298-61q147 0 284.5 55.5T1425 340l130-129q29-31 70-14 39 17 39 59z"
|
|
191
|
+
}), _react.createElement("span", {
|
|
192
|
+
className: srOnly
|
|
193
|
+
}, label));
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
CheatsheetModalDialog: function() {
|
|
13
|
+
return CheatsheetModalDialog;
|
|
14
|
+
},
|
|
15
|
+
openCheatsheetModal: function() {
|
|
16
|
+
return openCheatsheetModal;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _react = _interop_require_wildcard(require("react"));
|
|
20
|
+
const _f36components = require("@contentful/f36-components");
|
|
21
|
+
const _f36tokens = _interop_require_default(require("@contentful/f36-tokens"));
|
|
22
|
+
const _emotion = require("emotion");
|
|
23
|
+
const _types = require("../types");
|
|
24
|
+
function _interop_require_default(obj) {
|
|
25
|
+
return obj && obj.__esModule ? obj : {
|
|
26
|
+
default: obj
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
30
|
+
if (typeof WeakMap !== "function") return null;
|
|
31
|
+
var cacheBabelInterop = new WeakMap();
|
|
32
|
+
var cacheNodeInterop = new WeakMap();
|
|
33
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
34
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
35
|
+
})(nodeInterop);
|
|
36
|
+
}
|
|
37
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
38
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
39
|
+
return obj;
|
|
40
|
+
}
|
|
41
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
42
|
+
return {
|
|
43
|
+
default: obj
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
47
|
+
if (cache && cache.has(obj)) {
|
|
48
|
+
return cache.get(obj);
|
|
49
|
+
}
|
|
50
|
+
var newObj = {};
|
|
51
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
52
|
+
for(var key in obj){
|
|
53
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
54
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
55
|
+
if (desc && (desc.get || desc.set)) {
|
|
56
|
+
Object.defineProperty(newObj, key, desc);
|
|
57
|
+
} else {
|
|
58
|
+
newObj[key] = obj[key];
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
newObj.default = obj;
|
|
63
|
+
if (cache) {
|
|
64
|
+
cache.set(obj, newObj);
|
|
65
|
+
}
|
|
66
|
+
return newObj;
|
|
67
|
+
}
|
|
68
|
+
const styles = {
|
|
69
|
+
flexColumnContainer: (0, _emotion.css)({
|
|
70
|
+
display: 'flex',
|
|
71
|
+
flexWrap: 'nowrap'
|
|
72
|
+
}),
|
|
73
|
+
flexColumn: (0, _emotion.css)({
|
|
74
|
+
flexGrow: 1
|
|
75
|
+
}),
|
|
76
|
+
verticalDivider: (0, _emotion.css)({
|
|
77
|
+
borderRight: `1px solid ${_f36tokens.default.gray500}`,
|
|
78
|
+
paddingRight: _f36tokens.default.spacing3Xl,
|
|
79
|
+
marginRight: _f36tokens.default.spacing2Xl
|
|
80
|
+
}),
|
|
81
|
+
preview: (0, _emotion.css)({
|
|
82
|
+
display: 'inline-block',
|
|
83
|
+
paddingRight: _f36tokens.default.spacingL,
|
|
84
|
+
width: '50%'
|
|
85
|
+
}),
|
|
86
|
+
unOrderedListPreview: (0, _emotion.css)({
|
|
87
|
+
listStyleType: 'disc',
|
|
88
|
+
marginLeft: _f36tokens.default.spacingS
|
|
89
|
+
}),
|
|
90
|
+
orderedListPreview: (0, _emotion.css)({
|
|
91
|
+
listStyleType: 'decimal',
|
|
92
|
+
marginLeft: _f36tokens.default.spacingS
|
|
93
|
+
}),
|
|
94
|
+
markup: (0, _emotion.css)({
|
|
95
|
+
display: 'inline-block',
|
|
96
|
+
color: _f36tokens.default.gray600,
|
|
97
|
+
paddingLeft: _f36tokens.default.spacingL,
|
|
98
|
+
width: '50%'
|
|
99
|
+
}),
|
|
100
|
+
h1: (0, _emotion.css)({
|
|
101
|
+
fontSize: _f36tokens.default.fontSize2Xl
|
|
102
|
+
}),
|
|
103
|
+
h2: (0, _emotion.css)({
|
|
104
|
+
fontSize: _f36tokens.default.fontSizeXl
|
|
105
|
+
}),
|
|
106
|
+
h3: (0, _emotion.css)({
|
|
107
|
+
fontSize: _f36tokens.default.fontSizeL
|
|
108
|
+
}),
|
|
109
|
+
helpItem: (0, _emotion.css)({
|
|
110
|
+
marginBottom: _f36tokens.default.spacingS,
|
|
111
|
+
display: 'flex',
|
|
112
|
+
alignItems: 'flex-end',
|
|
113
|
+
height: _f36tokens.default.spacingXl
|
|
114
|
+
}),
|
|
115
|
+
helpLink: (0, _emotion.css)({
|
|
116
|
+
margin: 'auto'
|
|
117
|
+
}),
|
|
118
|
+
flexRowContainer: (0, _emotion.css)({
|
|
119
|
+
display: 'flex',
|
|
120
|
+
width: '100%',
|
|
121
|
+
justifyContent: 'center',
|
|
122
|
+
marginTop: _f36tokens.default.spacingXl
|
|
123
|
+
})
|
|
124
|
+
};
|
|
125
|
+
const CheatsheetModalDialog = ()=>{
|
|
126
|
+
return _react.createElement(_f36components.ModalContent, {
|
|
127
|
+
testId: "markdown-cheatsheet-dialog-content"
|
|
128
|
+
}, _react.createElement("div", {
|
|
129
|
+
className: styles.flexColumnContainer
|
|
130
|
+
}, _react.createElement("div", {
|
|
131
|
+
className: (0, _emotion.cx)(styles.flexColumn, styles.verticalDivider)
|
|
132
|
+
}, _react.createElement("div", {
|
|
133
|
+
className: styles.helpItem
|
|
134
|
+
}, _react.createElement(_f36components.Heading, {
|
|
135
|
+
marginBottom: "none",
|
|
136
|
+
as: "h1",
|
|
137
|
+
className: (0, _emotion.cx)(styles.preview, styles.h1)
|
|
138
|
+
}, "H1"), _react.createElement("div", {
|
|
139
|
+
className: styles.markup
|
|
140
|
+
}, "# heading")), _react.createElement("div", {
|
|
141
|
+
className: styles.helpItem
|
|
142
|
+
}, _react.createElement(_f36components.Heading, {
|
|
143
|
+
marginBottom: "none",
|
|
144
|
+
as: "h2",
|
|
145
|
+
className: (0, _emotion.cx)(styles.preview, styles.h2)
|
|
146
|
+
}, "H2"), _react.createElement("div", {
|
|
147
|
+
className: styles.markup
|
|
148
|
+
}, "## heading")), _react.createElement("div", {
|
|
149
|
+
className: styles.helpItem
|
|
150
|
+
}, _react.createElement(_f36components.Heading, {
|
|
151
|
+
marginBottom: "none",
|
|
152
|
+
as: "h3",
|
|
153
|
+
className: (0, _emotion.cx)(styles.preview, styles.h3)
|
|
154
|
+
}, "H3"), _react.createElement("div", {
|
|
155
|
+
className: styles.markup
|
|
156
|
+
}, "### heading")), _react.createElement("div", {
|
|
157
|
+
className: styles.helpItem
|
|
158
|
+
}, _react.createElement("strong", {
|
|
159
|
+
className: styles.preview
|
|
160
|
+
}, "bold"), _react.createElement("div", {
|
|
161
|
+
className: styles.markup
|
|
162
|
+
}, "__text__")), _react.createElement("div", {
|
|
163
|
+
className: styles.helpItem
|
|
164
|
+
}, _react.createElement("em", {
|
|
165
|
+
className: styles.preview
|
|
166
|
+
}, "italic"), _react.createElement("div", {
|
|
167
|
+
className: styles.markup
|
|
168
|
+
}, "*text*")), _react.createElement("div", {
|
|
169
|
+
className: styles.helpItem
|
|
170
|
+
}, _react.createElement("div", {
|
|
171
|
+
className: styles.preview
|
|
172
|
+
}, "strikethrough"), _react.createElement("div", {
|
|
173
|
+
className: styles.markup
|
|
174
|
+
}, "~~text~~")), _react.createElement("div", {
|
|
175
|
+
className: styles.helpItem
|
|
176
|
+
}, _react.createElement(_f36components.TextLink, {
|
|
177
|
+
as: "button",
|
|
178
|
+
className: styles.preview
|
|
179
|
+
}, "Link"), _react.createElement("div", {
|
|
180
|
+
className: styles.markup
|
|
181
|
+
}, "[text](url)"))), _react.createElement("div", {
|
|
182
|
+
className: styles.flexColumn
|
|
183
|
+
}, _react.createElement("div", {
|
|
184
|
+
className: styles.helpItem
|
|
185
|
+
}, _react.createElement("div", {
|
|
186
|
+
className: styles.preview
|
|
187
|
+
}, "Image"), _react.createElement("div", {
|
|
188
|
+
className: styles.markup
|
|
189
|
+
}, "")), _react.createElement("div", {
|
|
190
|
+
className: styles.helpItem
|
|
191
|
+
}, _react.createElement("div", {
|
|
192
|
+
className: styles.preview
|
|
193
|
+
}, "Unordered list"), _react.createElement("div", {
|
|
194
|
+
className: styles.markup
|
|
195
|
+
}, "* list item")), _react.createElement("div", {
|
|
196
|
+
className: styles.helpItem
|
|
197
|
+
}, _react.createElement("div", {
|
|
198
|
+
className: styles.preview
|
|
199
|
+
}, _react.createElement("div", null, "Ordered list")), _react.createElement("div", {
|
|
200
|
+
className: styles.markup
|
|
201
|
+
}, "1. list item")), _react.createElement("div", {
|
|
202
|
+
className: styles.helpItem
|
|
203
|
+
}, _react.createElement("div", {
|
|
204
|
+
className: styles.preview
|
|
205
|
+
}, _react.createElement("div", null, "Blockquote")), _react.createElement("div", {
|
|
206
|
+
className: styles.markup
|
|
207
|
+
}, "> quote")), _react.createElement("div", {
|
|
208
|
+
className: styles.helpItem
|
|
209
|
+
}, _react.createElement("div", {
|
|
210
|
+
className: styles.preview
|
|
211
|
+
}, "code span"), _react.createElement("div", {
|
|
212
|
+
className: styles.markup
|
|
213
|
+
}, "`code here`")), _react.createElement("div", {
|
|
214
|
+
className: styles.helpItem
|
|
215
|
+
}, _react.createElement("div", {
|
|
216
|
+
className: styles.preview
|
|
217
|
+
}, "code block"), _react.createElement("div", {
|
|
218
|
+
className: styles.markup
|
|
219
|
+
}, "```code here```")))), _react.createElement("div", {
|
|
220
|
+
className: styles.flexRowContainer
|
|
221
|
+
}, _react.createElement(_f36components.TextLink, {
|
|
222
|
+
className: styles.helpLink,
|
|
223
|
+
href: "https://help.github.com/en/github/writing-on-github/basic-writing-and-formatting-syntax",
|
|
224
|
+
target: "_blank",
|
|
225
|
+
rel: "noopener noreferrer"
|
|
226
|
+
}, "View the full GitHub-flavored Markdown syntax help (opens in a new window)")));
|
|
227
|
+
};
|
|
228
|
+
const openCheatsheetModal = (dialogs)=>{
|
|
229
|
+
return dialogs.openCurrent({
|
|
230
|
+
title: 'Markdown formatting help',
|
|
231
|
+
width: 'large',
|
|
232
|
+
minHeight: '415px',
|
|
233
|
+
shouldCloseOnEscapePress: true,
|
|
234
|
+
shouldCloseOnOverlayClick: true,
|
|
235
|
+
parameters: {
|
|
236
|
+
type: _types.MarkdownDialogType.cheatsheet
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
ConfirmInsertAssetModalDialog: function() {
|
|
13
|
+
return ConfirmInsertAssetModalDialog;
|
|
14
|
+
},
|
|
15
|
+
openConfirmInsertAsset: function() {
|
|
16
|
+
return openConfirmInsertAsset;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _react = _interop_require_wildcard(require("react"));
|
|
20
|
+
const _f36components = require("@contentful/f36-components");
|
|
21
|
+
const _types = require("../types");
|
|
22
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
23
|
+
if (typeof WeakMap !== "function") return null;
|
|
24
|
+
var cacheBabelInterop = new WeakMap();
|
|
25
|
+
var cacheNodeInterop = new WeakMap();
|
|
26
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
27
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
28
|
+
})(nodeInterop);
|
|
29
|
+
}
|
|
30
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
31
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
32
|
+
return obj;
|
|
33
|
+
}
|
|
34
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
35
|
+
return {
|
|
36
|
+
default: obj
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
40
|
+
if (cache && cache.has(obj)) {
|
|
41
|
+
return cache.get(obj);
|
|
42
|
+
}
|
|
43
|
+
var newObj = {};
|
|
44
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
45
|
+
for(var key in obj){
|
|
46
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
47
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
48
|
+
if (desc && (desc.get || desc.set)) {
|
|
49
|
+
Object.defineProperty(newObj, key, desc);
|
|
50
|
+
} else {
|
|
51
|
+
newObj[key] = obj[key];
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
newObj.default = obj;
|
|
56
|
+
if (cache) {
|
|
57
|
+
cache.set(obj, newObj);
|
|
58
|
+
}
|
|
59
|
+
return newObj;
|
|
60
|
+
}
|
|
61
|
+
const ConfirmInsertAssetModalDialog = ({ onClose , assets , locale })=>{
|
|
62
|
+
const localesNumber = assets.length;
|
|
63
|
+
return _react.createElement(_react.Fragment, null, _react.createElement(_f36components.ModalContent, {
|
|
64
|
+
testId: "confirm-insert-asset"
|
|
65
|
+
}, _react.createElement(_f36components.Paragraph, null, localesNumber === 1 ? `Link asset with missing file for locale ${locale}` : `Link assets with missing files for locale ${locale}`), _react.createElement(_f36components.Paragraph, null, localesNumber === 1 ? 'Do you want to link to the file in its fallback locale?' : 'Do you want to link to the files in their fallback locales?'), _react.createElement(_f36components.EntityList, null, assets.map(({ title , description , thumbnailUrl , thumbnailAltText })=>_react.createElement(_f36components.EntityList.Item, {
|
|
66
|
+
key: thumbnailUrl,
|
|
67
|
+
title: title,
|
|
68
|
+
thumbnailUrl: `${thumbnailUrl}?w=46&h=46&fit=thumb`,
|
|
69
|
+
thumbnailAltText: thumbnailAltText,
|
|
70
|
+
description: description
|
|
71
|
+
})))), _react.createElement(_f36components.ModalControls, null, _react.createElement(_f36components.Button, {
|
|
72
|
+
onClick: ()=>onClose(false),
|
|
73
|
+
variant: "secondary",
|
|
74
|
+
size: "small"
|
|
75
|
+
}, "Cancel"), _react.createElement(_f36components.Button, {
|
|
76
|
+
testId: "confirm-insert-asset",
|
|
77
|
+
onClick: ()=>onClose(true),
|
|
78
|
+
variant: "positive",
|
|
79
|
+
size: "small"
|
|
80
|
+
}, "Confirm")));
|
|
81
|
+
};
|
|
82
|
+
const openConfirmInsertAsset = (dialogs, options)=>{
|
|
83
|
+
return dialogs.openCurrent({
|
|
84
|
+
title: 'Confirm using fallback assets',
|
|
85
|
+
width: 'medium',
|
|
86
|
+
minHeight: '270px',
|
|
87
|
+
shouldCloseOnEscapePress: true,
|
|
88
|
+
shouldCloseOnOverlayClick: true,
|
|
89
|
+
parameters: {
|
|
90
|
+
type: _types.MarkdownDialogType.confirmInsertAsset,
|
|
91
|
+
...options
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
};
|