@elastic/eui 106.1.0 → 106.2.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/es/components/call_out/call_out.js +2 -1
- package/es/components/card/checkable_card/checkable_card.js +30 -5
- package/es/components/code/code_block.js +5 -2
- package/es/components/code/code_block_virtualized.js +5 -3
- package/es/components/markdown_editor/index.js +1 -0
- package/es/components/markdown_editor/markdown_editor.js +15 -4
- package/es/components/markdown_editor/markdown_editor_drop_zone.js +5 -3
- package/es/components/markdown_editor/markdown_editor_footer.js +12 -120
- package/es/components/markdown_editor/markdown_editor_footer.styles.js +0 -2
- package/es/components/markdown_editor/markdown_editor_help_button.js +144 -0
- package/es/components/markdown_editor/markdown_editor_help_button.styles.js +16 -0
- package/es/components/markdown_editor/markdown_editor_toolbar.js +28 -23
- package/es/components/popover/popover.js +2 -1
- package/eui.d.ts +84 -52
- package/i18ntokens.json +624 -624
- package/lib/components/call_out/call_out.js +3 -2
- package/lib/components/card/checkable_card/checkable_card.js +29 -4
- package/lib/components/code/code_block.js +5 -2
- package/lib/components/code/code_block_virtualized.js +5 -3
- package/lib/components/markdown_editor/index.js +7 -0
- package/lib/components/markdown_editor/markdown_editor.js +15 -4
- package/lib/components/markdown_editor/markdown_editor_drop_zone.js +5 -3
- package/lib/components/markdown_editor/markdown_editor_footer.js +10 -117
- package/lib/components/markdown_editor/markdown_editor_footer.styles.js +0 -2
- package/lib/components/markdown_editor/markdown_editor_help_button.js +151 -0
- package/lib/components/markdown_editor/markdown_editor_help_button.styles.js +22 -0
- package/lib/components/markdown_editor/markdown_editor_toolbar.js +28 -23
- package/lib/components/popover/popover.js +2 -1
- package/optimize/es/components/call_out/call_out.js +1 -0
- package/optimize/es/components/card/checkable_card/checkable_card.js +25 -5
- package/optimize/es/components/code/code_block.js +5 -2
- package/optimize/es/components/code/code_block_virtualized.js +5 -3
- package/optimize/es/components/markdown_editor/index.js +1 -0
- package/optimize/es/components/markdown_editor/markdown_editor.js +7 -3
- package/optimize/es/components/markdown_editor/markdown_editor_drop_zone.js +3 -2
- package/optimize/es/components/markdown_editor/markdown_editor_footer.js +12 -120
- package/optimize/es/components/markdown_editor/markdown_editor_footer.styles.js +0 -2
- package/optimize/es/components/markdown_editor/markdown_editor_help_button.js +139 -0
- package/optimize/es/components/markdown_editor/markdown_editor_help_button.styles.js +16 -0
- package/optimize/es/components/markdown_editor/markdown_editor_toolbar.js +20 -16
- package/optimize/es/components/popover/popover.js +2 -1
- package/optimize/lib/components/call_out/call_out.js +2 -1
- package/optimize/lib/components/card/checkable_card/checkable_card.js +24 -4
- package/optimize/lib/components/code/code_block.js +5 -2
- package/optimize/lib/components/code/code_block_virtualized.js +5 -3
- package/optimize/lib/components/markdown_editor/index.js +7 -0
- package/optimize/lib/components/markdown_editor/markdown_editor.js +7 -3
- package/optimize/lib/components/markdown_editor/markdown_editor_drop_zone.js +3 -2
- package/optimize/lib/components/markdown_editor/markdown_editor_footer.js +9 -118
- package/optimize/lib/components/markdown_editor/markdown_editor_footer.styles.js +0 -2
- package/optimize/lib/components/markdown_editor/markdown_editor_help_button.js +150 -0
- package/optimize/lib/components/markdown_editor/markdown_editor_help_button.styles.js +22 -0
- package/optimize/lib/components/markdown_editor/markdown_editor_toolbar.js +20 -16
- package/optimize/lib/components/popover/popover.js +2 -1
- package/package.json +1 -1
- package/test-env/components/call_out/call_out.js +3 -2
- package/test-env/components/card/checkable_card/checkable_card.js +24 -4
- package/test-env/components/code/code_block_virtualized.js +5 -3
- package/test-env/components/markdown_editor/index.js +7 -0
- package/test-env/components/markdown_editor/markdown_editor.js +15 -4
- package/test-env/components/markdown_editor/markdown_editor_drop_zone.js +5 -3
- package/test-env/components/markdown_editor/markdown_editor_footer.js +9 -118
- package/test-env/components/markdown_editor/markdown_editor_footer.styles.js +0 -2
- package/test-env/components/markdown_editor/markdown_editor_help_button.js +150 -0
- package/test-env/components/markdown_editor/markdown_editor_help_button.styles.js +22 -0
- package/test-env/components/markdown_editor/markdown_editor_toolbar.js +28 -23
- package/test-env/components/popover/popover.js +2 -1
|
@@ -4,7 +4,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.HEADINGS = exports.EuiCallOut = exports.COLORS = void 0;
|
|
7
|
+
exports.SIZES = exports.HEADINGS = exports.EuiCallOut = exports.COLORS = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
@@ -37,6 +37,7 @@ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i
|
|
|
37
37
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
38
38
|
var COLORS = exports.COLORS = ['primary', 'success', 'warning', 'danger', 'accent'];
|
|
39
39
|
var HEADINGS = exports.HEADINGS = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p'];
|
|
40
|
+
var SIZES = exports.SIZES = ['s', 'm'];
|
|
40
41
|
var EuiCallOut = exports.EuiCallOut = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
41
42
|
var title = _ref.title,
|
|
42
43
|
_ref$color = _ref.color,
|
|
@@ -116,7 +117,7 @@ EuiCallOut.propTypes = {
|
|
|
116
117
|
title: _propTypes.default.node,
|
|
117
118
|
iconType: _propTypes.default.oneOfType([_propTypes.default.oneOf(["accessibility", "addDataApp", "advancedSettingsApp", "agentApp", "aggregate", "analyzeEvent", "annotation", "anomalyChart", "anomalySwimLane", "apmApp", "apmTrace", "appSearchApp", "apps", "arrowDown", "arrowLeft", "arrowRight", "arrowUp", "arrowStart", "arrowEnd", "article", "asterisk", "at", "auditbeatApp", "beaker", "bell", "bellSlash", "beta", "bolt", "boxesHorizontal", "boxesVertical", "branch", "branchUser", "broom", "brush", "bug", "bullseye", "calendar", "canvasApp", "casesApp", "changePointDetection", "check", "checkCircle", "checkInCircleFilled", "cheer", "classificationJob", "clickLeft", "clickRight", "clock", "clockCounter", "cloudDrizzle", "cloudStormy", "cloudSunny", "cluster", "code", "codeApp", "color", "comment", "compute", "console", "consoleApp", "container", "continuityAbove", "continuityAboveBelow", "continuityBelow", "continuityWithin", "contrast", "contrastHigh", "controls", "controlsHorizontal", "controlsVertical", "copy", "copyClipboard", "createAdvancedJob", "createGenericJob", "createGeoJob", "createMultiMetricJob", "createPopulationJob", "createSingleMetricJob", "cross", "crossClusterReplicationApp", "crossInCircle", "crosshairs", "currency", "cut", "dashboardApp", "dataVisualizer", "database", "desktop", "devToolsApp", "diff", "discoverApp", "discuss", "document", "documentEdit", "documentation", "documents", "dot", "dotInCircle", "doubleArrowLeft", "doubleArrowRight", "download", "editorAlignCenter", "editorAlignLeft", "editorAlignRight", "editorBold", "editorChecklist", "editorCodeBlock", "editorComment", "editorDistributeHorizontal", "editorDistributeVertical", "editorHeading", "editorItalic", "editorItemAlignBottom", "editorItemAlignCenter", "editorItemAlignLeft", "editorItemAlignMiddle", "editorItemAlignRight", "editorItemAlignTop", "editorLink", "editorOrderedList", "editorPositionBottomLeft", "editorPositionBottomRight", "editorPositionTopLeft", "editorPositionTopRight", "editorRedo", "editorStrike", "editorTable", "editorUnderline", "editorUndo", "editorUnorderedList", "email", "empty", "emsApp", "endpoint", "eql", "eraser", "error", "errorFilled", "esqlVis", "exit", "expand", "expandMini", "export", "exportAction", "eye", "eyeClosed", "faceHappy", "faceNeutral", "faceSad", "fieldStatistics", "filebeatApp", "filter", "filterExclude", "filterIgnore", "filterInclude", "filterInCircle", "flask", "flag", "fleetApp", "fold", "folderCheck", "folderClosed", "folderExclamation", "folderOpen", "frameNext", "framePrevious", "fullScreen", "fullScreenExit", "function", "gear", "gisApp", "glasses", "globe", "grab", "grabHorizontal", "grabOmnidirectional", "gradient", "graphApp", "grid", "grokApp", "heart", "heartbeatApp", "heatmap", "help", "home", "info", "image", "importAction", "index", "indexClose", "indexEdit", "indexFlush", "indexManagementApp", "indexMapping", "indexOpen", "indexPatternApp", "indexRollupApp", "indexRuntime", "indexSettings", "indexTemporary", "infinity", "inputOutput", "inspect", "invert", "ip", "key", "keyboard", "kqlField", "kqlFunction", "kqlOperand", "kqlSelector", "kqlValue", "kubernetesNode", "kubernetesPod", "launch", "layers", "lensApp", "lettering", "lineDashed", "lineDotted", "lineSolid", "link", "list", "listAdd", "lock", "lockOpen", "logPatternAnalysis", "logRateAnalysis", "logoAWS", "logoAWSMono", "logoAerospike", "logoApache", "logoAppSearch", "logoAzure", "logoAzureMono", "logoBeats", "logoBusinessAnalytics", "logoCeph", "logoCloud", "logoCloudEnterprise", "logoCode", "logoCodesandbox", "logoCouchbase", "logoDocker", "logoDropwizard", "logoElastic", "logoElasticStack", "logoElasticsearch", "logoEnterpriseSearch", "logoEtcd", "logoGCP", "logoGCPMono", "logoGithub", "logoGmail", "logoGolang", "logoGoogleG", "logoHAproxy", "logoIBM", "logoIBMMono", "logoKafka", "logoKibana", "logoKubernetes", "logoLogging", "logoLogstash", "logoMaps", "logoMemcached", "logoMetrics", "logoMongodb", "logoMySQL", "logoNginx", "logoObservability", "logoOsquery", "logoPhp", "logoPostgres", "logoPrometheus", "logoRabbitmq", "logoRedis", "logoSecurity", "logoSiteSearch", "logoSketch", "logoSlack", "logoUptime", "logoVulnerabilityManagement", "logoWebhook", "logoWindows", "logoWorkplaceSearch", "logsApp", "logstashFilter", "logstashIf", "logstashInput", "logstashOutput", "logstashQueue", "machineLearningApp", "magnet", "magnifyWithExclamation", "magnifyWithMinus", "magnifyWithPlus", "managementApp", "mapMarker", "memory", "menu", "menuDown", "menuLeft", "menuRight", "menuUp", "merge", "metricbeatApp", "metricsApp", "minimize", "minus", "minusInCircle", "minusInCircleFilled", "minusInSquare", "mobile", "monitoringApp", "moon", "move", "namespace", "nested", "newChat", "node", "notebookApp", "number", "offline", "online", "outlierDetectionJob", "package", "packetbeatApp", "pageSelect", "pagesSelect", "palette", "paperClip", "partial", "pause", "payment", "pencil", "percent", "pin", "pinFilled", "pipeBreaks", "pipelineApp", "pipeNoBreaks", "pivot", "play", "playFilled", "plugs", "plus", "plusInCircle", "plusInCircleFilled", "plusInSquare", "popout", "push", "question", "quote", "readOnly", "recentlyViewedApp", "refresh", "regressionJob", "reporter", "reportingApp", "returnKey", "save", "savedObjectsApp", "scale", "search", "searchProfilerApp", "section", "securityAnalyticsApp", "securityApp", "securitySignal", "securitySignalDetected", "securitySignalResolved", "sessionViewer", "shard", "share", "singleMetricViewer", "snowflake", "sortAscending", "sortDescending", "sortDown", "sortLeft", "sortRight", "sortUp", "sortable", "spaces", "spacesApp", "sparkles", "sqlApp", "starEmpty", "starEmptySpace", "starFilled", "starFilledSpace", "starMinusEmpty", "starMinusFilled", "starPlusEmpty", "starPlusFilled", "stats", "stop", "stopFilled", "stopSlash", "storage", "string", "submodule", "sun", "swatchInput", "symlink", "tableDensityCompact", "tableDensityExpanded", "tableDensityNormal", "tableOfContents", "tag", "tear", "temperature", "timeline", "timelineWithArrow", "timelionApp", "timeRefresh", "timeslider", "training", "transitionLeftIn", "transitionLeftOut", "transitionTopIn", "transitionTopOut", "trash", "unfold", "unlink", "upgradeAssistantApp", "uptimeApp", "user", "userAvatar", "users", "usersRolesApp", "vector", "videoPlayer", "visArea", "visAreaStacked", "visBarHorizontal", "visBarHorizontalStacked", "visBarVertical", "visBarVerticalStacked", "visGauge", "visGoal", "visLine", "visMapCoordinate", "visMapRegion", "visMetric", "visPie", "visTable", "visTagCloud", "visText", "visTimelion", "visVega", "visVisualBuilder", "visualizeApp", "vulnerabilityManagementApp", "warning", "warningFilled", "alert", "watchesApp", "web", "wordWrap", "wordWrapDisabled", "workplaceSearchApp", "wrench", "tokenAlias", "tokenAnnotation", "tokenArray", "tokenBinary", "tokenBoolean", "tokenClass", "tokenCompletionSuggester", "tokenConstant", "tokenDate", "tokenDimension", "tokenElement", "tokenEnum", "tokenEnumMember", "tokenEvent", "tokenException", "tokenField", "tokenFile", "tokenFlattened", "tokenFunction", "tokenGeo", "tokenHistogram", "tokenInterface", "tokenIP", "tokenJoin", "tokenKey", "tokenKeyword", "tokenMethod", "tokenMetricCounter", "tokenMetricGauge", "tokenModule", "tokenNamespace", "tokenNested", "tokenNull", "tokenNumber", "tokenObject", "tokenOperator", "tokenPackage", "tokenParameter", "tokenPercolator", "tokenProperty", "tokenRange", "tokenRankFeature", "tokenRankFeatures", "tokenRepo", "tokenSearchType", "tokenSemanticText", "tokenShape", "tokenString", "tokenStruct", "tokenSymbol", "tokenTag", "tokenText", "tokenTokenCount", "tokenVariable", "tokenVectorDense", "tokenDenseVector", "tokenVectorSparse"]).isRequired, _propTypes.default.string.isRequired, _propTypes.default.elementType.isRequired]),
|
|
118
119
|
color: _propTypes.default.any,
|
|
119
|
-
size: _propTypes.default.
|
|
120
|
+
size: _propTypes.default.any,
|
|
120
121
|
heading: _propTypes.default.any,
|
|
121
122
|
/**
|
|
122
123
|
* Passing an `onDismiss` callback will render a cross in the top right hand corner
|
|
@@ -8,6 +8,7 @@ exports.EuiCheckableCard = void 0;
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
10
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
11
|
+
var _tabbable = require("tabbable");
|
|
11
12
|
var _form = require("../../form");
|
|
12
13
|
var _panel = require("../../panel");
|
|
13
14
|
var _services = require("../../../services");
|
|
@@ -27,6 +28,12 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
27
28
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
28
29
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
29
30
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
31
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
32
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
33
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
34
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
35
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
36
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
30
37
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
31
38
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
32
39
|
var EuiCheckableCard = exports.EuiCheckableCard = function EuiCheckableCard(_ref) {
|
|
@@ -51,7 +58,16 @@ var EuiCheckableCard = exports.EuiCheckableCard = function EuiCheckableCard(_ref
|
|
|
51
58
|
var id = rest.id;
|
|
52
59
|
var labelEl = (0, _react.useRef)(null);
|
|
53
60
|
var inputEl = (0, _react.useRef)(null);
|
|
61
|
+
var childrenWrapperEl = (0, _react.useRef)(null);
|
|
54
62
|
var classes = (0, _classnames.default)('euiCheckableCard', className);
|
|
63
|
+
var _useState = (0, _react.useState)(false),
|
|
64
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
65
|
+
hasInteractiveChildren = _useState2[0],
|
|
66
|
+
setHasInteractiveChildren = _useState2[1];
|
|
67
|
+
(0, _react.useEffect)(function () {
|
|
68
|
+
var interactiveElements = childrenWrapperEl.current ? (0, _tabbable.tabbable)(childrenWrapperEl.current) : [];
|
|
69
|
+
setHasInteractiveChildren(interactiveElements.length > 0);
|
|
70
|
+
}, [children, childrenWrapperEl]);
|
|
55
71
|
var checkableElement;
|
|
56
72
|
if (checkableType === 'radio') {
|
|
57
73
|
checkableElement = (0, _react2.jsx)(_form.EuiRadio, _extends({
|
|
@@ -67,9 +83,13 @@ var EuiCheckableCard = exports.EuiCheckableCard = function EuiCheckableCard(_ref
|
|
|
67
83
|
}
|
|
68
84
|
var labelClasses = (0, _classnames.default)('euiCheckableCard__label');
|
|
69
85
|
var onChangeAffordance = function onChangeAffordance(e) {
|
|
70
|
-
if (labelEl.current
|
|
71
|
-
|
|
72
|
-
|
|
86
|
+
if (!labelEl.current || e.target === inputEl.current) return;
|
|
87
|
+
labelEl.current.click();
|
|
88
|
+
};
|
|
89
|
+
var onChildrenClick = function onChildrenClick() {
|
|
90
|
+
var _labelEl$current;
|
|
91
|
+
if (hasInteractiveChildren) return;
|
|
92
|
+
(_labelEl$current = labelEl.current) === null || _labelEl$current === void 0 || _labelEl$current.click();
|
|
73
93
|
};
|
|
74
94
|
return (0, _react2.jsx)(_panel.EuiSplitPanel.Outer, {
|
|
75
95
|
responsive: false,
|
|
@@ -90,9 +110,14 @@ var EuiCheckableCard = exports.EuiCheckableCard = function EuiCheckableCard(_ref
|
|
|
90
110
|
htmlFor: id,
|
|
91
111
|
"aria-describedby": children ? "".concat(id, "-details") : undefined
|
|
92
112
|
}), label), children && (0, _react2.jsx)("div", {
|
|
113
|
+
ref: childrenWrapperEl,
|
|
93
114
|
id: "".concat(id, "-details"),
|
|
94
115
|
className: "euiCheckableCard__children",
|
|
95
|
-
css: childStyles
|
|
116
|
+
css: childStyles,
|
|
117
|
+
onClick: disabled ? undefined : onChildrenClick,
|
|
118
|
+
style: {
|
|
119
|
+
cursor: !disabled && !hasInteractiveChildren ? 'pointer' : undefined
|
|
120
|
+
}
|
|
96
121
|
}, children)));
|
|
97
122
|
};
|
|
98
123
|
EuiCheckableCard.propTypes = {
|
|
@@ -18,7 +18,7 @@ var _code_block = require("./code_block.styles");
|
|
|
18
18
|
var _accessibility = require("../accessibility");
|
|
19
19
|
var _i18n = require("../i18n");
|
|
20
20
|
var _react2 = require("@emotion/react");
|
|
21
|
-
var _excluded = ["language", "transparentBackground", "paddingSize", "fontSize", "isCopyable", "copyAriaLabel", "whiteSpace", "children", "className", "overflowHeight", "isVirtualized", "lineNumbers"];
|
|
21
|
+
var _excluded = ["language", "transparentBackground", "paddingSize", "fontSize", "isCopyable", "copyAriaLabel", "whiteSpace", "children", "className", "overflowHeight", "isVirtualized", "lineNumbers", "aria-label"];
|
|
22
22
|
/*
|
|
23
23
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
24
24
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
@@ -75,6 +75,7 @@ var EuiCodeBlock = exports.EuiCodeBlock = function EuiCodeBlock(_ref) {
|
|
|
75
75
|
_isVirtualized = _ref.isVirtualized,
|
|
76
76
|
_ref$lineNumbers = _ref.lineNumbers,
|
|
77
77
|
lineNumbers = _ref$lineNumbers === void 0 ? false : _ref$lineNumbers,
|
|
78
|
+
ariaLabel = _ref['aria-label'],
|
|
78
79
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
79
80
|
var euiTheme = (0, _services.useEuiTheme)();
|
|
80
81
|
var language = (0, _react.useMemo)(function () {
|
|
@@ -166,13 +167,14 @@ var EuiCodeBlock = exports.EuiCodeBlock = function EuiCodeBlock(_ref) {
|
|
|
166
167
|
});
|
|
167
168
|
// pre tags don't accept aria-label without an
|
|
168
169
|
// appropriate role, we add a SR only text instead
|
|
169
|
-
var codeBlockLabelElement = (0, _react2.jsx)(_react.default.Fragment, null, _services.tabularCopyMarkers.hiddenNoCopyBoundary, (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("div", null, codeBlockLabel)), _services.tabularCopyMarkers.hiddenNoCopyBoundary);
|
|
170
|
+
var codeBlockLabelElement = (0, _react2.jsx)(_react.default.Fragment, null, _services.tabularCopyMarkers.hiddenNoCopyBoundary, (0, _react2.jsx)(_accessibility.EuiScreenReaderOnly, null, (0, _react2.jsx)("div", null, ariaLabel ? "".concat(ariaLabel, ", ") : undefined, codeBlockLabel)), _services.tabularCopyMarkers.hiddenNoCopyBoundary);
|
|
170
171
|
return (0, _react2.jsx)("div", {
|
|
171
172
|
css: cssStyles,
|
|
172
173
|
className: (0, _classnames.default)('euiCodeBlock', className),
|
|
173
174
|
style: overflowHeightStyles
|
|
174
175
|
}, isVirtualized ? (0, _react2.jsx)(_code_block_virtualized.EuiCodeBlockVirtualized, {
|
|
175
176
|
data: data,
|
|
177
|
+
label: codeBlockLabelElement,
|
|
176
178
|
rowHeight: fontSizeToRowHeightMap[fontSize],
|
|
177
179
|
overflowHeight: overflowHeight,
|
|
178
180
|
preProps: preProps,
|
|
@@ -187,6 +189,7 @@ var EuiCodeBlock = exports.EuiCodeBlock = function EuiCodeBlock(_ref) {
|
|
|
187
189
|
onClose: onKeyDown
|
|
188
190
|
}, isVirtualized ? (0, _react2.jsx)(_code_block_virtualized.EuiCodeBlockVirtualized, {
|
|
189
191
|
data: data,
|
|
192
|
+
label: codeBlockLabelElement,
|
|
190
193
|
rowHeight: fontSizeToRowHeightMap.l,
|
|
191
194
|
preProps: preFullscreenProps,
|
|
192
195
|
codeProps: codeProps
|
|
@@ -11,7 +11,7 @@ var _global_styling = require("../../global_styling");
|
|
|
11
11
|
var _auto_sizer = require("../auto_sizer");
|
|
12
12
|
var _utils = require("./utils");
|
|
13
13
|
var _react2 = require("@emotion/react");
|
|
14
|
-
var _excluded = ["style"],
|
|
14
|
+
var _excluded = ["style", "children"],
|
|
15
15
|
_excluded2 = ["style"];
|
|
16
16
|
/*
|
|
17
17
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
@@ -27,6 +27,7 @@ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i
|
|
|
27
27
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
|
|
28
28
|
var EuiCodeBlockVirtualized = exports.EuiCodeBlockVirtualized = function EuiCodeBlockVirtualized(_ref) {
|
|
29
29
|
var data = _ref.data,
|
|
30
|
+
label = _ref.label,
|
|
30
31
|
rowHeight = _ref.rowHeight,
|
|
31
32
|
overflowHeight = _ref.overflowHeight,
|
|
32
33
|
preProps = _ref.preProps,
|
|
@@ -34,14 +35,15 @@ var EuiCodeBlockVirtualized = exports.EuiCodeBlockVirtualized = function EuiCode
|
|
|
34
35
|
var VirtualizedOuterElement = (0, _react.useMemo)(function () {
|
|
35
36
|
return /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
36
37
|
var style = _ref2.style,
|
|
38
|
+
children = _ref2.children,
|
|
37
39
|
props = _objectWithoutProperties(_ref2, _excluded);
|
|
38
40
|
return (0, _react2.jsx)("pre", _extends({
|
|
39
41
|
style: (0, _global_styling.logicalStyles)(style)
|
|
40
42
|
}, props, {
|
|
41
43
|
ref: ref
|
|
42
|
-
}, preProps));
|
|
44
|
+
}, preProps), label, children);
|
|
43
45
|
});
|
|
44
|
-
}, [preProps]);
|
|
46
|
+
}, [preProps, label]);
|
|
45
47
|
var VirtualizedInnerElement = (0, _react.useMemo)(function () {
|
|
46
48
|
return /*#__PURE__*/(0, _react.forwardRef)(function (_ref3, ref) {
|
|
47
49
|
var style = _ref3.style,
|
|
@@ -15,6 +15,12 @@ Object.defineProperty(exports, "EuiMarkdownEditor", {
|
|
|
15
15
|
return _markdown_editor.EuiMarkdownEditor;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
+
Object.defineProperty(exports, "EuiMarkdownEditorHelpButton", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function get() {
|
|
21
|
+
return _markdown_editor_help_button.EuiMarkdownEditorHelpButton;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
18
24
|
Object.defineProperty(exports, "EuiMarkdownFormat", {
|
|
19
25
|
enumerable: true,
|
|
20
26
|
get: function get() {
|
|
@@ -52,6 +58,7 @@ Object.defineProperty(exports, "getDefaultEuiMarkdownUiPlugins", {
|
|
|
52
58
|
}
|
|
53
59
|
});
|
|
54
60
|
var _markdown_editor = require("./markdown_editor");
|
|
61
|
+
var _markdown_editor_help_button = require("./markdown_editor_help_button");
|
|
55
62
|
var _markdown_default_plugins = require("./plugins/markdown_default_plugins");
|
|
56
63
|
var _markdown_context = require("./markdown_context");
|
|
57
64
|
var _markdown_format = require("./markdown_format");
|
|
@@ -22,7 +22,7 @@ var _markdown_context = require("./markdown_context");
|
|
|
22
22
|
var _markdown_default_plugins = require("./plugins/markdown_default_plugins");
|
|
23
23
|
var _markdown_editor = require("./markdown_editor.styles");
|
|
24
24
|
var _react2 = require("@emotion/react");
|
|
25
|
-
var _excluded = ["className", "editorId", "value", "onChange", "height", "maxHeight", "autoExpandPreview", "parsingPluginList", "processingPluginList", "uiPlugins", "onParse", "errors", "aria-label", "aria-labelledby", "aria-describedby", "initialViewMode", "dropHandlers", "markdownFormatProps", "placeholder", "readOnly"];
|
|
25
|
+
var _excluded = ["className", "editorId", "value", "onChange", "height", "maxHeight", "autoExpandPreview", "parsingPluginList", "processingPluginList", "uiPlugins", "onParse", "errors", "aria-label", "aria-labelledby", "aria-describedby", "initialViewMode", "dropHandlers", "markdownFormatProps", "placeholder", "readOnly", "toolbarProps", "showFooter"];
|
|
26
26
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
27
27
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
28
28
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -122,6 +122,9 @@ var EuiMarkdownEditor = exports.EuiMarkdownEditor = /*#__PURE__*/(0, _react.forw
|
|
|
122
122
|
markdownFormatProps = _ref.markdownFormatProps,
|
|
123
123
|
placeholder = _ref.placeholder,
|
|
124
124
|
readOnly = _ref.readOnly,
|
|
125
|
+
toolbarProps = _ref.toolbarProps,
|
|
126
|
+
_ref$showFooter = _ref.showFooter,
|
|
127
|
+
showFooter = _ref$showFooter === void 0 ? true : _ref$showFooter,
|
|
125
128
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
126
129
|
var _useState = (0, _react.useState)(initialViewMode),
|
|
127
130
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -301,7 +304,7 @@ var EuiMarkdownEditor = exports.EuiMarkdownEditor = /*#__PURE__*/(0, _react.forw
|
|
|
301
304
|
}, (0, _react2.jsx)("div", _extends({
|
|
302
305
|
className: classes,
|
|
303
306
|
css: cssStyles
|
|
304
|
-
}, rest), (0, _react2.jsx)(_markdown_editor_toolbar.EuiMarkdownEditorToolbar, {
|
|
307
|
+
}, rest), (0, _react2.jsx)(_markdown_editor_toolbar.EuiMarkdownEditorToolbar, _extends({
|
|
305
308
|
ref: editorToolbarRef,
|
|
306
309
|
selectedNode: selectedNode,
|
|
307
310
|
markdownActions: markdownActions,
|
|
@@ -310,7 +313,7 @@ var EuiMarkdownEditor = exports.EuiMarkdownEditor = /*#__PURE__*/(0, _react.forw
|
|
|
310
313
|
},
|
|
311
314
|
viewMode: viewMode,
|
|
312
315
|
uiPlugins: toolbarPlugins
|
|
313
|
-
}), isPreviewing && (0, _react2.jsx)("div", {
|
|
316
|
+
}, toolbarProps)), isPreviewing && (0, _react2.jsx)("div", {
|
|
314
317
|
ref: previewRef,
|
|
315
318
|
className: classesPreview,
|
|
316
319
|
css: styles.euiMarkdownEditorPreview,
|
|
@@ -342,6 +345,7 @@ var EuiMarkdownEditor = exports.EuiMarkdownEditor = /*#__PURE__*/(0, _react.forw
|
|
|
342
345
|
selectionEnd: newSelectionPoint
|
|
343
346
|
});
|
|
344
347
|
},
|
|
348
|
+
showFooter: showFooter,
|
|
345
349
|
uiPlugins: toolbarPlugins,
|
|
346
350
|
errors: errors,
|
|
347
351
|
hasUnacceptedItems: hasUnacceptedItems,
|
|
@@ -476,6 +480,13 @@ EuiMarkdownEditor.propTypes = {
|
|
|
476
480
|
* Determines the text size. Choose `relative` to control the `font-size` based on the value of a parent container.
|
|
477
481
|
*/
|
|
478
482
|
textSize: _propTypes.default.any
|
|
479
|
-
})
|
|
483
|
+
}),
|
|
484
|
+
/**
|
|
485
|
+
* Props to customize the toolbar. `right` replaces the default preview/editor toggle with custom content.
|
|
486
|
+
*/
|
|
487
|
+
toolbarProps: _propTypes.default.shape({
|
|
488
|
+
right: _propTypes.default.node
|
|
489
|
+
}),
|
|
490
|
+
/** Controls whether the footer is shown */showFooter: _propTypes.default.bool
|
|
480
491
|
};
|
|
481
492
|
EuiMarkdownEditor.displayName = 'EuiMarkdownEditor';
|
|
@@ -76,7 +76,8 @@ var EuiMarkdownEditorDropZone = exports.EuiMarkdownEditorDropZone = function Eui
|
|
|
76
76
|
hasUnacceptedItems = props.hasUnacceptedItems,
|
|
77
77
|
setHasUnacceptedItems = props.setHasUnacceptedItems,
|
|
78
78
|
setEditorFooterHeight = props.setEditorFooterHeight,
|
|
79
|
-
isEditing = props.isEditing
|
|
79
|
+
isEditing = props.isEditing,
|
|
80
|
+
showFooter = props.showFooter;
|
|
80
81
|
var classes = (0, _classnames.default)('euiMarkdownEditorDropZone');
|
|
81
82
|
var styles = (0, _services.useEuiMemoizedStyles)(_markdown_editor_drop_zone.euiMarkdownEditorDropZoneStyles);
|
|
82
83
|
var cssStyles = [styles.euiMarkdownEditorDropZone, isDragging && !isDraggingError && styles.isDragging, isDraggingError && styles.isDraggingError, (hasUnacceptedItems || errors.length > 0) && styles.hasError];
|
|
@@ -183,7 +184,7 @@ var EuiMarkdownEditorDropZone = exports.EuiMarkdownEditorDropZone = function Eui
|
|
|
183
184
|
return (0, _react2.jsx)("div", _extends({}, rootProps, {
|
|
184
185
|
css: cssStyles,
|
|
185
186
|
className: classes
|
|
186
|
-
}), children, (0, _react2.jsx)(_markdown_editor_footer.EuiMarkdownEditorFooter, {
|
|
187
|
+
}), children, showFooter && (0, _react2.jsx)(_markdown_editor_footer.EuiMarkdownEditorFooter, {
|
|
187
188
|
ref: setEditorFooterRef,
|
|
188
189
|
uiPlugins: uiPlugins,
|
|
189
190
|
openFiles: function openFiles() {
|
|
@@ -230,5 +231,6 @@ EuiMarkdownEditorDropZone.propTypes = {
|
|
|
230
231
|
hasUnacceptedItems: _propTypes.default.bool.isRequired,
|
|
231
232
|
setHasUnacceptedItems: _propTypes.default.func.isRequired,
|
|
232
233
|
setEditorFooterHeight: _propTypes.default.func.isRequired,
|
|
233
|
-
isEditing: _propTypes.default.bool.isRequired
|
|
234
|
+
isEditing: _propTypes.default.bool.isRequired,
|
|
235
|
+
showFooter: _propTypes.default.bool
|
|
234
236
|
};
|
|
@@ -10,18 +10,13 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
10
10
|
var _services = require("../../services");
|
|
11
11
|
var _loading = require("../loading");
|
|
12
12
|
var _button = require("../button");
|
|
13
|
-
var _title = require("../title");
|
|
14
|
-
var _modal = require("../modal");
|
|
15
13
|
var _i18n = require("../i18n");
|
|
16
14
|
var _popover = require("../popover");
|
|
17
15
|
var _text = require("../text");
|
|
18
|
-
var _spacer = require("../spacer");
|
|
19
16
|
var _tool_tip = require("../tool_tip");
|
|
20
|
-
var _horizontal_rule = require("../horizontal_rule");
|
|
21
|
-
var _link = require("../link");
|
|
22
17
|
var _markdown_context = require("./markdown_context");
|
|
23
|
-
var _markdown_logo = _interopRequireDefault(require("./icons/markdown_logo"));
|
|
24
18
|
var _markdown_editor_footer = require("./markdown_editor_footer.styles");
|
|
19
|
+
var _markdown_editor_help_button = require("./markdown_editor_help_button");
|
|
25
20
|
var _react2 = require("@emotion/react");
|
|
26
21
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
27
22
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
@@ -37,7 +32,7 @@ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } /*
|
|
|
37
32
|
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
38
33
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
39
34
|
* Side Public License, v 1.
|
|
40
|
-
*/
|
|
35
|
+
*/
|
|
41
36
|
var EuiMarkdownEditorFooter = exports.EuiMarkdownEditorFooter = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
42
37
|
var uiPlugins = props.uiPlugins,
|
|
43
38
|
isUploadingFiles = props.isUploadingFiles,
|
|
@@ -48,16 +43,8 @@ var EuiMarkdownEditorFooter = exports.EuiMarkdownEditorFooter = /*#__PURE__*/(0,
|
|
|
48
43
|
var styles = (0, _services.useEuiMemoizedStyles)(_markdown_editor_footer.euiMarkdownEditorFooterStyles);
|
|
49
44
|
var _useState = (0, _react.useState)(false),
|
|
50
45
|
_useState2 = _slicedToArray(_useState, 2),
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
var _useState3 = (0, _react.useState)(false),
|
|
54
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
55
|
-
isShowingHelpPopover = _useState4[0],
|
|
56
|
-
setIsShowingHelpPopover = _useState4[1];
|
|
57
|
-
var _useState5 = (0, _react.useState)(false),
|
|
58
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
59
|
-
isPopoverOpen = _useState6[0],
|
|
60
|
-
setIsPopoverOpen = _useState6[1];
|
|
46
|
+
isPopoverOpen = _useState2[0],
|
|
47
|
+
setIsPopoverOpen = _useState2[1];
|
|
61
48
|
var onButtonClick = function onButtonClick() {
|
|
62
49
|
return setIsPopoverOpen(function (isPopoverOpen) {
|
|
63
50
|
return !isPopoverOpen;
|
|
@@ -80,13 +67,10 @@ var EuiMarkdownEditorFooter = exports.EuiMarkdownEditorFooter = /*#__PURE__*/(0,
|
|
|
80
67
|
supportedFileTypes: (0, _i18n.useEuiI18n)('euiMarkdownEditorFooter.supportedFileTypes', 'Supported files: {supportedFileTypes}', {
|
|
81
68
|
supportedFileTypes: supportedFileTypes
|
|
82
69
|
}),
|
|
83
|
-
showSyntaxErrors: (0, _i18n.useEuiI18n)('euiMarkdownEditorFooter.showSyntaxErrors', 'Show errors')
|
|
84
|
-
showMarkdownHelp: (0, _i18n.useEuiI18n)('euiMarkdownEditorFooter.showMarkdownHelp', 'Show markdown help')
|
|
70
|
+
showSyntaxErrors: (0, _i18n.useEuiI18n)('euiMarkdownEditorFooter.showSyntaxErrors', 'Show errors')
|
|
85
71
|
};
|
|
86
|
-
var syntaxTitle = (0, _i18n.useEuiI18n)('euiMarkdownEditorFooter.syntaxTitle', 'Syntax help');
|
|
87
72
|
var _useContext = (0, _react.useContext)(_markdown_context.EuiMarkdownContext),
|
|
88
73
|
readOnly = _useContext.readOnly;
|
|
89
|
-
var helpModalTitleId = (0, _services.useGeneratedHtmlId)();
|
|
90
74
|
if (isUploadingFiles) {
|
|
91
75
|
uploadButton = (0, _react2.jsx)(_button.EuiButtonIcon, {
|
|
92
76
|
size: "s",
|
|
@@ -146,108 +130,17 @@ var EuiMarkdownEditorFooter = exports.EuiMarkdownEditorFooter = /*#__PURE__*/(0,
|
|
|
146
130
|
}, message.toString());
|
|
147
131
|
})));
|
|
148
132
|
}
|
|
149
|
-
var uiPluginsWithHelpText = uiPlugins.filter(function (_ref2) {
|
|
150
|
-
var helpText = _ref2.helpText;
|
|
151
|
-
return !!helpText;
|
|
152
|
-
});
|
|
153
|
-
var hasUiPluginsWithHelpText = uiPluginsWithHelpText.length > 0;
|
|
154
|
-
var mdSyntaxHref = 'https://guides.github.com/features/mastering-markdown/';
|
|
155
|
-
var mdSyntaxLink = (0, _react2.jsx)(_link.EuiLink, {
|
|
156
|
-
href: mdSyntaxHref,
|
|
157
|
-
target: "_blank"
|
|
158
|
-
}, (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
159
|
-
token: "euiMarkdownEditorFooter.mdSyntaxLink",
|
|
160
|
-
default: "GitHub flavored markdown"
|
|
161
|
-
}));
|
|
162
|
-
var helpSyntaxButton;
|
|
163
|
-
if (hasUiPluginsWithHelpText) {
|
|
164
|
-
helpSyntaxButton = (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_tool_tip.EuiToolTip, {
|
|
165
|
-
content: syntaxTitle
|
|
166
|
-
}, (0, _react2.jsx)(_button.EuiButtonIcon, {
|
|
167
|
-
size: "s",
|
|
168
|
-
css: styles.euiMarkdownEditorFooter__helpButton,
|
|
169
|
-
className: "euiMarkdownEditorFooter__helpButton",
|
|
170
|
-
iconType: _markdown_logo.default,
|
|
171
|
-
color: "text",
|
|
172
|
-
"aria-label": ariaLabels.showMarkdownHelp,
|
|
173
|
-
onClick: function onClick() {
|
|
174
|
-
return setIsShowingHelpModal(!isShowingHelpModal);
|
|
175
|
-
},
|
|
176
|
-
isDisabled: readOnly
|
|
177
|
-
})), isShowingHelpModal && (0, _react2.jsx)(_modal.EuiModal, {
|
|
178
|
-
onClose: function onClose() {
|
|
179
|
-
return setIsShowingHelpModal(false);
|
|
180
|
-
},
|
|
181
|
-
"aria-labelledby": helpModalTitleId
|
|
182
|
-
}, (0, _react2.jsx)(_modal.EuiModalHeader, null, (0, _react2.jsx)(_title.EuiTitle, null, (0, _react2.jsx)("h1", {
|
|
183
|
-
id: helpModalTitleId
|
|
184
|
-
}, syntaxTitle))), (0, _react2.jsx)(_modal.EuiModalBody, null, (0, _react2.jsx)(_text.EuiText, null, (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
185
|
-
tokens: ['euiMarkdownEditorFooter.syntaxModalDescriptionPrefix', 'euiMarkdownEditorFooter.syntaxModalDescriptionSuffix'],
|
|
186
|
-
defaults: ['This editor uses', 'You can also utilize these additional syntax plugins to add rich content to your text.']
|
|
187
|
-
}, function (_ref3) {
|
|
188
|
-
var _ref4 = _slicedToArray(_ref3, 2),
|
|
189
|
-
syntaxModalDescriptionPrefix = _ref4[0],
|
|
190
|
-
syntaxModalDescriptionSuffix = _ref4[1];
|
|
191
|
-
return (0, _react2.jsx)("p", null, syntaxModalDescriptionPrefix, " ", mdSyntaxLink, ".", ' ', syntaxModalDescriptionSuffix);
|
|
192
|
-
})), (0, _react2.jsx)(_horizontal_rule.EuiHorizontalRule, null), uiPluginsWithHelpText.map(function (_ref5) {
|
|
193
|
-
var name = _ref5.name,
|
|
194
|
-
helpText = _ref5.helpText;
|
|
195
|
-
return (0, _react2.jsx)(_react.Fragment, {
|
|
196
|
-
key: name
|
|
197
|
-
}, (0, _react2.jsx)(_title.EuiTitle, {
|
|
198
|
-
size: "xxs"
|
|
199
|
-
}, (0, _react2.jsx)("p", null, (0, _react2.jsx)("strong", null, name))), (0, _react2.jsx)(_spacer.EuiSpacer, {
|
|
200
|
-
size: "s"
|
|
201
|
-
}), helpText, (0, _react2.jsx)(_spacer.EuiSpacer, {
|
|
202
|
-
size: "l"
|
|
203
|
-
}));
|
|
204
|
-
}), (0, _react2.jsx)(_horizontal_rule.EuiHorizontalRule, null)), (0, _react2.jsx)(_modal.EuiModalFooter, null, (0, _react2.jsx)(_button.EuiButton, {
|
|
205
|
-
onClick: function onClick() {
|
|
206
|
-
return setIsShowingHelpModal(false);
|
|
207
|
-
},
|
|
208
|
-
fill: true
|
|
209
|
-
}, (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
210
|
-
token: "euiMarkdownEditorFooter.closeButton",
|
|
211
|
-
default: "Close"
|
|
212
|
-
})))));
|
|
213
|
-
} else {
|
|
214
|
-
helpSyntaxButton = (0, _react2.jsx)(_popover.EuiPopover, {
|
|
215
|
-
button: (0, _react2.jsx)(_button.EuiButtonIcon, {
|
|
216
|
-
title: syntaxTitle,
|
|
217
|
-
size: "s",
|
|
218
|
-
css: styles.euiMarkdownEditorFooter__helpButton,
|
|
219
|
-
className: "euiMarkdownEditorFooter__helpButton",
|
|
220
|
-
iconType: _markdown_logo.default,
|
|
221
|
-
color: "text",
|
|
222
|
-
"aria-label": ariaLabels.showMarkdownHelp,
|
|
223
|
-
onClick: function onClick() {
|
|
224
|
-
return setIsShowingHelpPopover(!isShowingHelpPopover);
|
|
225
|
-
}
|
|
226
|
-
}),
|
|
227
|
-
isOpen: isShowingHelpPopover,
|
|
228
|
-
closePopover: function closePopover() {
|
|
229
|
-
return setIsShowingHelpPopover(false);
|
|
230
|
-
},
|
|
231
|
-
panelPaddingSize: "s",
|
|
232
|
-
anchorPosition: "upCenter",
|
|
233
|
-
"aria-labelledby": helpModalTitleId
|
|
234
|
-
}, (0, _react2.jsx)(_i18n.EuiI18n, {
|
|
235
|
-
tokens: ['euiMarkdownEditorFooter.syntaxPopoverDescription'],
|
|
236
|
-
defaults: ['This editor uses']
|
|
237
|
-
}, function (_ref6) {
|
|
238
|
-
var _ref7 = _slicedToArray(_ref6, 1),
|
|
239
|
-
syntaxPopoverDescription = _ref7[0];
|
|
240
|
-
return (0, _react2.jsx)("p", null, syntaxPopoverDescription, " ", mdSyntaxLink, ".");
|
|
241
|
-
}));
|
|
242
|
-
}
|
|
243
133
|
return (0, _react2.jsx)("div", {
|
|
244
134
|
ref: ref,
|
|
245
135
|
css: styles.euiMarkdownEditorFooter,
|
|
246
|
-
className: "euiMarkdownEditorFooter"
|
|
136
|
+
className: "euiMarkdownEditorFooter",
|
|
137
|
+
"data-test-subj": "euiMarkdownEditorFooter"
|
|
247
138
|
}, (0, _react2.jsx)("div", {
|
|
248
139
|
css: styles.euiMarkdownEditorFooter__actions,
|
|
249
140
|
className: "euiMarkdownEditorFooter__actions"
|
|
250
|
-
}, uploadButton, errorsButton),
|
|
141
|
+
}, uploadButton, errorsButton), (0, _react2.jsx)(_markdown_editor_help_button.EuiMarkdownEditorHelpButton, {
|
|
142
|
+
uiPlugins: uiPlugins
|
|
143
|
+
}));
|
|
251
144
|
});
|
|
252
145
|
EuiMarkdownEditorFooter.propTypes = {
|
|
253
146
|
uiPlugins: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
@@ -25,8 +25,6 @@ var euiMarkdownEditorFooterStyles = exports.euiMarkdownEditorFooterStyles = func
|
|
|
25
25
|
euiMarkdownEditorFooter__actions: /*#__PURE__*/(0, _react.css)("flex:1;display:inline-flex;align-items:center;gap:", euiTheme.size.xs, ";;label:euiMarkdownEditorFooter__actions;"),
|
|
26
26
|
// Override default button border radius to match the overall markdown editor
|
|
27
27
|
euiMarkdownEditorFooter__uploadError: /*#__PURE__*/(0, _react.css)("border-radius:", borderRadius, ";;label:euiMarkdownEditorFooter__uploadError;"),
|
|
28
|
-
// Override the default button icon width size
|
|
29
|
-
euiMarkdownEditorFooter__helpButton: /*#__PURE__*/(0, _react.css)(".euiIcon{", (0, _global_styling.logicalCSS)('width', '26px'), ";};label:euiMarkdownEditorFooter__helpButton;"),
|
|
30
28
|
euiMarkdownEditorFooter__popover: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('width', '300px'), ";;label:euiMarkdownEditorFooter__popover;")
|
|
31
29
|
};
|
|
32
30
|
};
|