@procore/core-react 12.26.0 → 12.26.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/dist/AnchorNavigation/AnchorNavigation.styles.js +3 -3
- package/dist/Avatar/Avatar.styles.js +5 -5
- package/dist/AvatarStack/AvatarStack.styles.js +7 -7
- package/dist/Badge/Badge.styles.js +2 -2
- package/dist/BadgePill/BadgePill.styles.js +4 -4
- package/dist/Banner/Banner.styles.js +10 -10
- package/dist/Box/Box.styles.js +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.styles.js +4 -4
- package/dist/Button/Button.styles.js +5 -5
- package/dist/Calendar/Calendar.styles.js +8 -8
- package/dist/Card/Card.styles.js +1 -1
- package/dist/Checkbox/Checkbox.styles.js +6 -6
- package/dist/Checkbox/CheckboxTooltip.js +1 -1
- package/dist/ContactItem/ContactItem.styles.js +5 -5
- package/dist/Content/Content.styles.js +2 -2
- package/dist/DateInput/DateInput.styles.js +6 -6
- package/dist/DeprecatedTextEditorOutput/DeprecatedTextEditorOutput.styles.js +1 -1
- package/dist/DetailPage/DetailPage.styles.js +7 -7
- package/dist/Dropdown/Dropdown.styles.js +3 -3
- package/dist/DropdownFlyout/DropdownFlyout.styles.js +4 -4
- package/dist/Dropzone/Dropzone.js +1 -1
- package/dist/Dropzone/Dropzone.styles.js +9 -9
- package/dist/EmptyState/EmptyState.styles.js +6 -6
- package/dist/Field/Field.styles.js +3 -3
- package/dist/FileList/FileList.styles.js +4 -4
- package/dist/FileSelect/FileExplorer/FileExplorer.styles.js +9 -9
- package/dist/FileSelect/FileExplorer/FileExplorerSidebar.styles.js +3 -3
- package/dist/FileSelect/FileSelect.styles.js +2 -2
- package/dist/FileSelect/FileSelectDropzone/FileSelectDropzone.styles.js +3 -3
- package/dist/FileSelect/FileTokenList/FileTokenList.styles.js +2 -2
- package/dist/FileSelect/GridSource/GridSource.styles.js +6 -6
- package/dist/FileSelect/LocalSource/LocalSource.styles.js +4 -4
- package/dist/FileSelect/SourceItem/SourceItem.styles.js +3 -3
- package/dist/FileSelect/ThumbnailList/ThumbnailList.styles.js +6 -6
- package/dist/FileSelect/TreeSource/TreeSource.styles.js +1 -1
- package/dist/FileToken/FileToken.styles.js +4 -4
- package/dist/FilterToken/FilterToken.styles.js +5 -5
- package/dist/FlexList/FlexList.styles.js +1 -1
- package/dist/Form/Form.styles.js +14 -14
- package/dist/Form/StyledFormikForm.styles.js +2 -2
- package/dist/GhostPlaceholder/GhostPlaceholder.styles.js +2 -2
- package/dist/Grid/Grid.styles.js +2 -2
- package/dist/GroupSelect/GroupSelect.styles.js +1 -1
- package/dist/Input/Input.styles.js +1 -1
- package/dist/Link/Link.styles.js +1 -1
- package/dist/ListPage/ListPage.styles.js +8 -8
- package/dist/Loader/Loader.styles.js +2 -2
- package/dist/MenuImperative/MenuImperative.styles.js +10 -10
- package/dist/Modal/Modal.styles.js +13 -13
- package/dist/MultiSelect/MultiSelect.styles.js +6 -6
- package/dist/NextMenu/NextMenu.styles.js +3 -3
- package/dist/NextTextEditor/NextTextEditor.js +1 -1
- package/dist/NextTextEditor/NextTextEditor.js.map +1 -1
- package/dist/NextTextEditor/NextTextEditor.types.d.ts +1 -1
- package/dist/NextTextEditor/NextTextEditor.types.js.map +1 -1
- package/dist/NextTextEditor/utils/config.js +2 -2
- package/dist/NextTextEditor/utils/config.js.map +1 -1
- package/dist/NextTextEditorOutput/NextTextEditorOutput.js +10 -6
- package/dist/NextTextEditorOutput/NextTextEditorOutput.js.map +1 -1
- package/dist/NextTextEditorOutput/NextTextEditorOutput.styles.js +2 -2
- package/dist/NextTextEditorOutput/NextTextEditorOutput.styles.js.map +1 -1
- package/dist/Notation/Notation.js +1 -1
- package/dist/NumberInput/NumberInput.styles.js +7 -7
- package/dist/Overlay/OverlayArrow.styles.js +1 -1
- package/dist/PageLayout/PageLayout.styles.js +16 -16
- package/dist/PageTemplate/PageFooterTemplate/PageFooterTemplate.styles.js +1 -1
- package/dist/PageTemplate/PageHeaderTemplate/PageHeaderTemplate.styles.js +3 -3
- package/dist/PageTemplate/PagePaneTemplate/PagePaneTemplate.styles.js +2 -2
- package/dist/PageTemplate/PageTemplate/PageTemplate.styles.js +3 -3
- package/dist/Pagination/Pagination.styles.js +5 -5
- package/dist/Panel/Panel.styles.js +11 -11
- package/dist/Pill/Pill.styles.js +3 -3
- package/dist/PillSelect/PillSelect.styles.js +4 -4
- package/dist/Popover/Popover.styles.js +2 -2
- package/dist/Portal/Portal.styles.js +1 -1
- package/dist/ProgressBar/ProgressBar.styles.js +2 -2
- package/dist/RadioButton/RadioButton.styles.js +3 -3
- package/dist/Required/Required.styles.js +3 -3
- package/dist/Search/Search.styles.js +5 -5
- package/dist/Section/Section.styles.js +7 -7
- package/dist/SegmentedController/SegmentedController.styles.js +4 -4
- package/dist/Select/Select.styles.js +7 -7
- package/dist/Semantic/Semantic.styles.js +9 -9
- package/dist/Slider/Slider.styles.js +5 -5
- package/dist/Spinner/Spinner.styles.js +7 -7
- package/dist/SplitViewCard/SplitViewCard.styles.js +8 -8
- package/dist/SuperSelect/SuperSelect.presets.styles.js +1 -1
- package/dist/SuperSelect/SuperSelect.styles.js +37 -37
- package/dist/Switch/Switch.styles.js +4 -4
- package/dist/Table/Table.js +2 -0
- package/dist/Table/Table.js.map +1 -1
- package/dist/Table/Table.styles.js +28 -28
- package/dist/TableShelf/TableShelf.styles.js +5 -5
- package/dist/Tabs/Tabs.styles.js +15 -15
- package/dist/Tearsheet/Tearsheet.styles.js +5 -5
- package/dist/TextArea/TextArea.styles.js +1 -1
- package/dist/Thumbnail/Thumbnail.hooks.js +1 -0
- package/dist/Thumbnail/Thumbnail.hooks.js.map +1 -1
- package/dist/Thumbnail/Thumbnail.js +39 -16
- package/dist/Thumbnail/Thumbnail.js.map +1 -1
- package/dist/Thumbnail/Thumbnail.styles.d.ts +1 -2
- package/dist/Thumbnail/Thumbnail.styles.js +17 -17
- package/dist/Thumbnail/Thumbnail.styles.js.map +1 -1
- package/dist/ThumbnailGrid/ThumbnailGrid.styles.js +7 -7
- package/dist/TieredSelect/TieredSelect.styles.js +9 -9
- package/dist/Tile/Tile.styles.js +8 -8
- package/dist/Title/Title.styles.js +7 -7
- package/dist/Toast/Toast.styles.js +3 -3
- package/dist/ToggleButton/ToggleButton.styles.js +1 -1
- package/dist/Token/Token.js +12 -6
- package/dist/Token/Token.js.map +1 -1
- package/dist/Token/Token.styles.js +4 -4
- package/dist/Token/Token.styles.js.map +1 -1
- package/dist/Token/Token.types.d.ts +1 -0
- package/dist/Token/Token.types.js.map +1 -1
- package/dist/ToolHeader/ToolHeader.styles.js +6 -6
- package/dist/ToolLandingPage/ToolLandingPage.styles.js +3 -3
- package/dist/Tooltip/Tooltip.styles.js +2 -2
- package/dist/Tree/Tree.styles.js +9 -9
- package/dist/Typeahead/Typeahead.styles.js +3 -3
- package/dist/Typography/Typography.styles.js +1 -1
- package/dist/Typography/Typography.table.story.js +2 -2
- package/dist/_hooks/I18n.d.ts +34 -0
- package/dist/_locales/de-DE.json +3 -1
- package/dist/_locales/en-AU.json +3 -1
- package/dist/_locales/en-CA.json +3 -1
- package/dist/_locales/en-GB.json +3 -1
- package/dist/_locales/en.json +4 -1
- package/dist/_locales/es-ES.json +3 -1
- package/dist/_locales/es.json +3 -1
- package/dist/_locales/fr-CA.json +3 -1
- package/dist/_locales/fr-FR.json +3 -1
- package/dist/_locales/is-IS.json +3 -1
- package/dist/_locales/it-IT.json +3 -1
- package/dist/_locales/ja-JP.json +3 -1
- package/dist/_locales/pl-PL.json +3 -1
- package/dist/_locales/pseudo.json +4 -1
- package/dist/_locales/pt-BR.json +3 -1
- package/dist/_locales/th-TH.json +3 -1
- package/dist/_locales/zh-SG.json +3 -1
- package/dist/_locales/zh-TW.json +3 -1
- package/dist/_storyHelpers_/components/Deprecation.styles.js +1 -1
- package/dist/_storyHelpers_/components/StoryGrid.js +3 -3
- package/dist/_typedoc/AnchorNavigation/AnchorNavigation.types.json +3 -3
- package/dist/_typedoc/Avatar/Avatar.types.json +20 -20
- package/dist/_typedoc/AvatarStack/AvatarStack.types.json +24 -24
- package/dist/_typedoc/Badge/Badge.types.json +6 -6
- package/dist/_typedoc/Banner/Banner.types.json +13 -13
- package/dist/_typedoc/Box/Box.types.json +68 -68
- package/dist/_typedoc/Breadcrumbs/Breadcrumbs.types.json +10 -10
- package/dist/_typedoc/Button/Button.types.json +13 -13
- package/dist/_typedoc/Calendar/Calendar.types.json +80 -80
- package/dist/_typedoc/Card/Card.types.json +6 -6
- package/dist/_typedoc/Checkbox/Checkbox.types.json +8 -8
- package/dist/_typedoc/ContactItem/ContactItem.types.json +9 -9
- package/dist/_typedoc/DateInput/DateInput.types.json +35 -35
- package/dist/_typedoc/DateSelect/DateSelect.types.json +13 -13
- package/dist/_typedoc/DetailPage/DetailPage.types.json +5 -5
- package/dist/_typedoc/Dropdown/Dropdown.types.json +37 -37
- package/dist/_typedoc/DropdownFlyout/DropdownFlyout.types.json +30 -30
- package/dist/_typedoc/Dropzone/Dropzone.types.json +44 -44
- package/dist/_typedoc/EmptyState/EmptyState.types.json +16 -16
- package/dist/_typedoc/FileList/FileList.types.json +9 -9
- package/dist/_typedoc/FileSelect/FileSelect.types.json +27 -27
- package/dist/_typedoc/FileSelect/GridSource/GridSource.types.json +20 -20
- package/dist/_typedoc/FileSelect/LocalSource/LocalSource.types.json +14 -14
- package/dist/_typedoc/FileSelect/TreeSource/TreeSource.types.json +9 -9
- package/dist/_typedoc/Flex/Flex.types.json +27 -27
- package/dist/_typedoc/FlexList/FlexList.types.json +30 -30
- package/dist/_typedoc/Form/Form.types.json +754 -754
- package/dist/_typedoc/GhostPlaceholder/GhostPlaceholder.types.json +12 -12
- package/dist/_typedoc/Grid/Grid.types.json +8 -8
- package/dist/_typedoc/GroupSelect/GroupSelect.types.json +52 -52
- package/dist/_typedoc/Input/Input.types.json +2 -2
- package/dist/_typedoc/Link/Link.types.json +1 -1
- package/dist/_typedoc/ListPage/ListPage.types.json +13 -13
- package/dist/_typedoc/Menu/Menu.types.json +62 -62
- package/dist/_typedoc/MenuImperative/MenuImperative.types.json +74 -74
- package/dist/_typedoc/Modal/Modal.types.json +46 -46
- package/dist/_typedoc/MultiSelect/MultiSelect.types.json +31 -31
- package/dist/_typedoc/NextTile/NextTile.types.json +32 -32
- package/dist/_typedoc/Notation/Notation.types.json +4 -4
- package/dist/_typedoc/NumberInput/NumberInput.types.json +37 -37
- package/dist/_typedoc/OverlayTrigger/OverlayTrigger.types.json +32 -32
- package/dist/_typedoc/PageLayout/PageLayout.types.json +26 -26
- package/dist/_typedoc/Pagination/Pagination.types.json +7 -7
- package/dist/_typedoc/Panel/Panel.types.json +30 -30
- package/dist/_typedoc/Pill/Pill.types.json +2 -2
- package/dist/_typedoc/PillSelect/PillSelect.types.json +49 -49
- package/dist/_typedoc/Popover/Popover.types.json +15 -15
- package/dist/_typedoc/ProgressBar/ProgressBar.types.json +7 -7
- package/dist/_typedoc/RadioButton/RadioButton.types.json +6 -6
- package/dist/_typedoc/Required/Required.types.json +5 -5
- package/dist/_typedoc/Search/Search.types.json +18 -18
- package/dist/_typedoc/Section/Section.types.json +15 -15
- package/dist/_typedoc/SegmentedController/SegmentedController.types.json +21 -21
- package/dist/_typedoc/Select/Select.types.json +60 -60
- package/dist/_typedoc/SettingsPage/SettingsPage.types.json +10 -10
- package/dist/_typedoc/Slider/Slider.types.json +6 -6
- package/dist/_typedoc/Spinner/Spinner.types.json +9 -9
- package/dist/_typedoc/SplitViewCard/SplitViewCard.types.json +14 -14
- package/dist/_typedoc/Table/Table.types.json +101 -101
- package/dist/_typedoc/Tabs/Tabs.types.json +20 -20
- package/dist/_typedoc/Tearsheet/Tearsheet.types.json +17 -17
- package/dist/_typedoc/TextArea/TextArea.types.json +3 -3
- package/dist/_typedoc/TextEditor/TextEditorDocs.types.json +9 -9
- package/dist/_typedoc/TextEditor/TextEditorProvider.types.json +2 -2
- package/dist/_typedoc/TextEditorOutput/TextEditorOutputDocs.types.json +3 -3
- package/dist/_typedoc/Thumbnail/Thumbnail.types.json +19 -19
- package/dist/_typedoc/TieredDropdown/TieredDropdown.types.json +42 -42
- package/dist/_typedoc/TieredSelect/TieredSelect.types.json +28 -28
- package/dist/_typedoc/Tile/Tile.types.json +8 -8
- package/dist/_typedoc/Title/Title.types.json +1 -1
- package/dist/_typedoc/Toast/Toast.types.json +4 -4
- package/dist/_typedoc/ToggleButton/ToggleButton.types.json +4 -4
- package/dist/_typedoc/Token/Token.types.json +16 -6
- package/dist/_typedoc/ToolHeader/ToolHeader.types.json +10 -10
- package/dist/_typedoc/ToolLandingPage/ToolLandingPage.types.json +7 -7
- package/dist/_typedoc/Tooltip/Tooltip.types.json +13 -13
- package/dist/_typedoc/Tree/Tree.types.json +86 -86
- package/dist/_typedoc/Typeahead/Typeahead.types.json +2 -2
- package/dist/_typedoc/Typography/Typography.types.json +9 -9
- package/dist/_typedoc/_utils/types.json +3 -3
- package/package.json +1 -1
package/dist/Grid/Grid.styles.js
CHANGED
|
@@ -75,7 +75,7 @@ var getRowGutterVertical = function getRowGutterVertical(gutterY, breakpoint) {
|
|
|
75
75
|
};
|
|
76
76
|
export var StyledGridRow = /*#__PURE__*/styled.div.withConfig({
|
|
77
77
|
displayName: "StyledGridRow",
|
|
78
|
-
componentId: "core-
|
|
78
|
+
componentId: "core-12_26_2__sc-8pinsp-0"
|
|
79
79
|
})(["", " display:flex;flex-wrap:wrap;"], function (_ref) {
|
|
80
80
|
var $gutterX = _ref.$gutterX,
|
|
81
81
|
$gutterY = _ref.$gutterY;
|
|
@@ -87,7 +87,7 @@ export var StyledGridRow = /*#__PURE__*/styled.div.withConfig({
|
|
|
87
87
|
});
|
|
88
88
|
export var StyledGridCol = /*#__PURE__*/styled.div.withConfig({
|
|
89
89
|
displayName: "StyledGridCol",
|
|
90
|
-
componentId: "core-
|
|
90
|
+
componentId: "core-12_26_2__sc-8pinsp-1"
|
|
91
91
|
})(["flex-shrink:0;width:100%;max-width:100%;", ""], function (_ref2) {
|
|
92
92
|
var $span = _ref2.$span,
|
|
93
93
|
$offset = _ref2.$offset,
|
|
@@ -3,7 +3,7 @@ import { MultiSelect } from '../MultiSelect/MultiSelect';
|
|
|
3
3
|
import { colors } from '../_styles/colors';
|
|
4
4
|
export var StyledGroupSelectOption = /*#__PURE__*/styled(MultiSelect.Option).withConfig({
|
|
5
5
|
displayName: "StyledGroupSelectOption",
|
|
6
|
-
componentId: "core-
|
|
6
|
+
componentId: "core-12_26_2__sc-u5gu8j-0"
|
|
7
7
|
})(["", ""], function (_ref) {
|
|
8
8
|
var disabled = _ref.disabled;
|
|
9
9
|
return disabled && css(["color:", ";cursor:not-allowed;a,a:hover{color:", ";text-decoration:none;}"], colors.gray70, colors.gray70);
|
|
@@ -16,6 +16,6 @@ export function getInputStyles(_ref) {
|
|
|
16
16
|
}
|
|
17
17
|
export var StyledInput = /*#__PURE__*/styled.input.withConfig({
|
|
18
18
|
displayName: "StyledInput",
|
|
19
|
-
componentId: "core-
|
|
19
|
+
componentId: "core-12_26_2__sc-12sjkxg-0"
|
|
20
20
|
})(["", " padding:0 ", "px;&::-ms-clear{display:none;}&[type='number']{-moz-appearance:textfield;&::-webkit-inner-spin-button,&::-webkit-outer-spin-button{-webkit-appearance:none;margin:0;}}"], getInputStyles, spacing.md);
|
|
21
21
|
//# sourceMappingURL=Input.styles.js.map
|
package/dist/Link/Link.styles.js
CHANGED
|
@@ -17,6 +17,6 @@ function getLinkColors(_ref) {
|
|
|
17
17
|
}
|
|
18
18
|
export var StyledLink = /*#__PURE__*/styled.a.withConfig({
|
|
19
19
|
displayName: "StyledLink",
|
|
20
|
-
componentId: "core-
|
|
20
|
+
componentId: "core-12_26_2__sc-jfowrl-0"
|
|
21
21
|
})(["text-decoration:underline;&:hover{cursor:pointer;text-decoration:underline;}", " &.focus,&:focus{", ";}", ""], focusable, getBorderRadius('md'), getLinkColors);
|
|
22
22
|
//# sourceMappingURL=Link.styles.js.map
|
|
@@ -3,19 +3,19 @@ import { colors } from '../_styles/colors';
|
|
|
3
3
|
import { spacing } from '../_styles/spacing';
|
|
4
4
|
export var StyledListPageMain = /*#__PURE__*/styled.div.withConfig({
|
|
5
5
|
displayName: "StyledListPageMain",
|
|
6
|
-
componentId: "core-
|
|
6
|
+
componentId: "core-12_26_2__sc-1eq7fzi-0"
|
|
7
7
|
})(["display:flex;flex:1 0 auto;flex-direction:column;min-width:0;padding:", "px ", "px;width:100%;"], spacing.lg, spacing.xl);
|
|
8
8
|
export var StyledListPageBanner = /*#__PURE__*/styled.div.withConfig({
|
|
9
9
|
displayName: "StyledListPageBanner",
|
|
10
|
-
componentId: "core-
|
|
10
|
+
componentId: "core-12_26_2__sc-1eq7fzi-1"
|
|
11
11
|
})(["flex:0 0 auto;"]);
|
|
12
12
|
export var StyledListPageToolHeader = /*#__PURE__*/styled.div.withConfig({
|
|
13
13
|
displayName: "StyledListPageToolHeader",
|
|
14
|
-
componentId: "core-
|
|
14
|
+
componentId: "core-12_26_2__sc-1eq7fzi-2"
|
|
15
15
|
})(["flex:0 0 auto;padding-bottom:", "px;"], spacing.lg);
|
|
16
16
|
export var StyledListPageControl = /*#__PURE__*/styled.div.withConfig({
|
|
17
17
|
displayName: "StyledListPageControl",
|
|
18
|
-
componentId: "core-
|
|
18
|
+
componentId: "core-12_26_2__sc-1eq7fzi-3"
|
|
19
19
|
})(["flex:", ";", " ", ""], function (_ref) {
|
|
20
20
|
var $block = _ref.$block;
|
|
21
21
|
return $block ? '1 0 auto' : '0 0 auto';
|
|
@@ -32,18 +32,18 @@ export var StyledListPageControl = /*#__PURE__*/styled.div.withConfig({
|
|
|
32
32
|
});
|
|
33
33
|
export var StyledListPageContentControls = /*#__PURE__*/styled.div.withConfig({
|
|
34
34
|
displayName: "StyledListPageContentControls",
|
|
35
|
-
componentId: "core-
|
|
35
|
+
componentId: "core-12_26_2__sc-1eq7fzi-4"
|
|
36
36
|
})(["align-items:center;display:flex;flex:0 0 auto;justify-content:space-between;padding:", "px 0;", " + ", "{margin-left:", "px;}"], spacing.md, StyledListPageControl, StyledListPageControl, spacing.lg);
|
|
37
37
|
export var StyledListPageBody = /*#__PURE__*/styled.div.withConfig({
|
|
38
38
|
displayName: "StyledListPageBody",
|
|
39
|
-
componentId: "core-
|
|
39
|
+
componentId: "core-12_26_2__sc-1eq7fzi-5"
|
|
40
40
|
})(["display:flex;flex:1 0 auto;padding-top:", "px;"], spacing.md);
|
|
41
41
|
export var StyledListPageBodyContent = /*#__PURE__*/styled.div.withConfig({
|
|
42
42
|
displayName: "StyledListPageBodyContent",
|
|
43
|
-
componentId: "core-
|
|
43
|
+
componentId: "core-12_26_2__sc-1eq7fzi-6"
|
|
44
44
|
})(["flex:1 1 auto;"]);
|
|
45
45
|
export var StyledListPage = /*#__PURE__*/styled.div.withConfig({
|
|
46
46
|
displayName: "StyledListPage",
|
|
47
|
-
componentId: "core-
|
|
47
|
+
componentId: "core-12_26_2__sc-1eq7fzi-7"
|
|
48
48
|
})(["display:flex;flex-direction:row;height:100%;width:100%;", " + ", "{padding-top:", "px;}", " + ", "{border-top-color:", ";border-top-style:solid;border-top-width:1px;}", " + ", ",", " + ", "{border-top-color:", ";border-top-style:solid;border-top-width:1px;}", " + ", "{padding-top:0;}"], StyledListPageBanner, StyledListPageToolHeader, spacing.lg, StyledListPageContentControls, StyledListPageContentControls, colors.gray85, StyledListPageToolHeader, StyledListPageContentControls, StyledListPageToolHeader, StyledListPageBody, colors.gray85, StyledListPageContentControls, StyledListPageBody);
|
|
49
49
|
//# sourceMappingURL=ListPage.styles.js.map
|
|
@@ -7,11 +7,11 @@ export var loaderTransitionDuration = 250;
|
|
|
7
7
|
var movingStripes = /*#__PURE__*/keyframes(["from{background-position:", "px 0;}100%{background-position:0 ", "px;}"], backgroundSize, backgroundSize);
|
|
8
8
|
export var StyledLoader = /*#__PURE__*/styled.div.withConfig({
|
|
9
9
|
displayName: "StyledLoader",
|
|
10
|
-
componentId: "core-
|
|
10
|
+
componentId: "core-12_26_2__sc-wgvjj9-0"
|
|
11
11
|
})(["display:block;height:100%;left:0;min-width:12px;position:absolute;transition:width ", "ms ease-out;top:0;"], loaderTransitionDuration);
|
|
12
12
|
export var StyledGradient = /*#__PURE__*/styled.div.withConfig({
|
|
13
13
|
displayName: "StyledGradient",
|
|
14
|
-
componentId: "core-
|
|
14
|
+
componentId: "core-12_26_2__sc-wgvjj9-1"
|
|
15
15
|
})(["height:100%;", ""], function (_ref) {
|
|
16
16
|
var $animated = _ref.$animated;
|
|
17
17
|
return $animated ? css(["animation:", " 0.5s linear infinite;background-image:linear-gradient( 45deg,", " 26%,", " 25%,", " 51%,", " 50%,", " 76%,", " 75%,", " );background-size:", "px ", "px;"], movingStripes, color1, color2, color2, color1, color1, color2, color2, backgroundSize, backgroundSize) : css(["background-color:", ";"], colors.blue50);
|
|
@@ -11,15 +11,15 @@ var optionMinHeight = 32;
|
|
|
11
11
|
// Do not merge with StyledMenu, needed for max-height working in IE
|
|
12
12
|
export var StyledWrapper = /*#__PURE__*/styled.div.withConfig({
|
|
13
13
|
displayName: "StyledWrapper",
|
|
14
|
-
componentId: "core-
|
|
14
|
+
componentId: "core-12_26_2__sc-z984sz-0"
|
|
15
15
|
})(["border-radius:inherit;display:flex;max-height:inherit;min-width:inherit;outline:none;width:inherit;"]);
|
|
16
16
|
export var StyledMenu = /*#__PURE__*/styled.div.withConfig({
|
|
17
17
|
displayName: "StyledMenu",
|
|
18
|
-
componentId: "core-
|
|
18
|
+
componentId: "core-12_26_2__sc-z984sz-1"
|
|
19
19
|
})(["border-radius:inherit;display:flex;flex-direction:column;outline:0;width:100%;"]);
|
|
20
20
|
export var StyledOptions = /*#__PURE__*/styled.div.withConfig({
|
|
21
21
|
displayName: "StyledOptions",
|
|
22
|
-
componentId: "core-
|
|
22
|
+
componentId: "core-12_26_2__sc-z984sz-2"
|
|
23
23
|
})(["flex-basis:auto;flex-grow:1;flex-shrink:1;min-height:", "px;", ";padding:", "px 0;position:relative;&:focus-visible{", " margin:-1px;}"], optionMinHeight, function (_ref) {
|
|
24
24
|
var _ref$$scrollable = _ref.$scrollable,
|
|
25
25
|
$scrollable = _ref$$scrollable === void 0 ? true : _ref$$scrollable;
|
|
@@ -27,26 +27,26 @@ export var StyledOptions = /*#__PURE__*/styled.div.withConfig({
|
|
|
27
27
|
}, spacing.sm, getFocus());
|
|
28
28
|
export var StyledGrip = /*#__PURE__*/styled.div.withConfig({
|
|
29
29
|
displayName: "StyledGrip",
|
|
30
|
-
componentId: "core-
|
|
30
|
+
componentId: "core-12_26_2__sc-z984sz-3"
|
|
31
31
|
})(["padding:0 2px;height:24px;visibility:hidden;"]);
|
|
32
32
|
export var StyledHeader = /*#__PURE__*/styled.div.withConfig({
|
|
33
33
|
displayName: "StyledHeader",
|
|
34
|
-
componentId: "core-
|
|
34
|
+
componentId: "core-12_26_2__sc-z984sz-4"
|
|
35
35
|
})([""]);
|
|
36
36
|
export var StyledSearch = /*#__PURE__*/styled.div.withConfig({
|
|
37
37
|
displayName: "StyledSearch",
|
|
38
|
-
componentId: "core-
|
|
38
|
+
componentId: "core-12_26_2__sc-z984sz-5"
|
|
39
39
|
})(["padding:", "px ", "px ", "px;", " > *{pointer-events:none;}"], spacing.lg, spacing.lg, spacing.sm, StyledButton);
|
|
40
40
|
export var StyledGroup = /*#__PURE__*/styled.div.withConfig({
|
|
41
41
|
displayName: "StyledGroup",
|
|
42
|
-
componentId: "core-
|
|
42
|
+
componentId: "core-12_26_2__sc-z984sz-6"
|
|
43
43
|
})(["", " color:", ";cursor:", ";font-weight:", ";padding:", "px ", "px;&:not(:first-child){padding-top:", "px;}"], getTypographyIntent('body'), colors.gray15, function (_ref2) {
|
|
44
44
|
var $clickable = _ref2.$clickable;
|
|
45
45
|
return $clickable ? 'pointer' : 'default';
|
|
46
46
|
}, typographyWeights.semibold, spacing.xs, spacing.lg, spacing.md + spacing.xs);
|
|
47
47
|
export var StyledItem = /*#__PURE__*/styled.div.withConfig({
|
|
48
48
|
displayName: "StyledItem",
|
|
49
|
-
componentId: "core-
|
|
49
|
+
componentId: "core-12_26_2__sc-z984sz-7"
|
|
50
50
|
})(["", ";", " cursor:pointer;list-style-type:none;padding:", "px ", "px;a{color:", ";display:block;margin:-", "px -", "px;padding:", "px ", "px;text-decoration:none;&:hover{color:", ";text-decoration:none;}}&[data-highlighted='true']{background-color:", ";}", " &:hover,&:active{", "{visibility:visible;}}", "{color:inherit;cursor:pointer;}", " ", " ", ""], getTypographyIntent('body'), function (_ref3) {
|
|
51
51
|
var as = _ref3.as;
|
|
52
52
|
return as === 'a' && css(["display:block;text-decoration:none;"]);
|
|
@@ -75,10 +75,10 @@ export var StyledItem = /*#__PURE__*/styled.div.withConfig({
|
|
|
75
75
|
});
|
|
76
76
|
export var StyledDroppable = /*#__PURE__*/styled.div.withConfig({
|
|
77
77
|
displayName: "StyledDroppable",
|
|
78
|
-
componentId: "core-
|
|
78
|
+
componentId: "core-12_26_2__sc-z984sz-8"
|
|
79
79
|
})(["", ",", "{padding-left:28px;}"], StyledGroup, StyledItem);
|
|
80
80
|
export var StyledFooter = /*#__PURE__*/styled(Box).withConfig({
|
|
81
81
|
displayName: "StyledFooter",
|
|
82
|
-
componentId: "core-
|
|
82
|
+
componentId: "core-12_26_2__sc-z984sz-9"
|
|
83
83
|
})(["border-top:1px solid ", ";border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;"], colors.gray85);
|
|
84
84
|
//# sourceMappingURL=MenuImperative.styles.js.map
|
|
@@ -32,15 +32,15 @@ var screenWidthPixelBreakpoints = {
|
|
|
32
32
|
};
|
|
33
33
|
export var StyledModal = /*#__PURE__*/styled.div.withConfig({
|
|
34
34
|
displayName: "StyledModal",
|
|
35
|
-
componentId: "core-
|
|
35
|
+
componentId: "core-12_26_2__sc-1ijdug2-0"
|
|
36
36
|
})(["display:flex;height:100vh;position:absolute;opacity:0;transition:0.3s opacity ease;width:100vw;z-index:0;pointer-events:none;&.", "{opacity:1;pointer-events:auto;}&.", "{opacity:0;pointer-events:none;}"], fadeInClassName, fadeOutClassName);
|
|
37
37
|
export var StyledModalButtons = /*#__PURE__*/styled.div.withConfig({
|
|
38
38
|
displayName: "StyledModalButtons",
|
|
39
|
-
componentId: "core-
|
|
39
|
+
componentId: "core-12_26_2__sc-1ijdug2-1"
|
|
40
40
|
})(["display:flex;flex:0 0 auto;margin-left:", "px;> * + *{margin-left:", "px;}"], spacing.lg, spacing.sm);
|
|
41
41
|
export var StyledModalContainer = /*#__PURE__*/styled(Card).withConfig({
|
|
42
42
|
displayName: "StyledModalContainer",
|
|
43
|
-
componentId: "core-
|
|
43
|
+
componentId: "core-12_26_2__sc-1ijdug2-2"
|
|
44
44
|
})(["display:flex;flex-direction:row;position:absolute;z-index:2;", " ", " ", ""], function (_ref) {
|
|
45
45
|
var $compact = _ref.$compact;
|
|
46
46
|
if (!$compact) {
|
|
@@ -64,11 +64,11 @@ export var StyledModalContainer = /*#__PURE__*/styled(Card).withConfig({
|
|
|
64
64
|
});
|
|
65
65
|
export var StyledModalFooter = /*#__PURE__*/styled.div.withConfig({
|
|
66
66
|
displayName: "StyledModalFooter",
|
|
67
|
-
componentId: "core-
|
|
67
|
+
componentId: "core-12_26_2__sc-1ijdug2-3"
|
|
68
68
|
})(["align-items:center;display:flex;flex:0 0 auto;flex-wrap:wrap;justify-content:flex-end;padding:", "px ", "px ", "px;"], spacing.xl, spacing.xxl, spacing.xxl);
|
|
69
69
|
export var StyledModalBody = /*#__PURE__*/styled.div.withConfig({
|
|
70
70
|
displayName: "StyledModalBody",
|
|
71
|
-
componentId: "core-
|
|
71
|
+
componentId: "core-12_26_2__sc-1ijdug2-4"
|
|
72
72
|
})(["", " &:focus-visible{", "}box-sizing:border-box;color:", ";display:flex;flex-direction:column;overflow:auto;", " ", " > ", "{padding-left:0;padding-right:0;&:first-child > ", "{padding-top:0;}}", ""], getTypographyIntent('body'), getFocusInset(), colors.gray15, function (_ref4) {
|
|
73
73
|
var $noSideSpacing = _ref4.$noSideSpacing;
|
|
74
74
|
return css(["padding:", "px ", "px;"], spacing.xl, $noSideSpacing ? 0 : spacing.xxl);
|
|
@@ -85,7 +85,7 @@ export var StyledModalBody = /*#__PURE__*/styled.div.withConfig({
|
|
|
85
85
|
});
|
|
86
86
|
export var StyledModalContent = /*#__PURE__*/styled.div.withConfig({
|
|
87
87
|
displayName: "StyledModalContent",
|
|
88
|
-
componentId: "core-
|
|
88
|
+
componentId: "core-12_26_2__sc-1ijdug2-5"
|
|
89
89
|
})(["display:flex;flex-direction:column;max-height:90vh;overflow:hidden;width:100%;", ""], function (_ref7) {
|
|
90
90
|
var _ref7$$compact = _ref7.$compact,
|
|
91
91
|
$compact = _ref7$$compact === void 0 ? false : _ref7$$compact;
|
|
@@ -96,11 +96,11 @@ export var StyledModalContent = /*#__PURE__*/styled.div.withConfig({
|
|
|
96
96
|
});
|
|
97
97
|
export var StyledModalFooterNotation = /*#__PURE__*/styled(Typography).withConfig({
|
|
98
98
|
displayName: "StyledModalFooterNotation",
|
|
99
|
-
componentId: "core-
|
|
99
|
+
componentId: "core-12_26_2__sc-1ijdug2-6"
|
|
100
100
|
})(["flex-grow:1;"]);
|
|
101
101
|
export var StyledModalHeader = /*#__PURE__*/styled.div.withConfig({
|
|
102
102
|
displayName: "StyledModalHeader",
|
|
103
|
-
componentId: "core-
|
|
103
|
+
componentId: "core-12_26_2__sc-1ijdug2-7"
|
|
104
104
|
})(["align-items:flex-start;color:", ";display:flex;flex:0 0 auto;position:relative;", " ", ""], colors.gray10, function (_ref8) {
|
|
105
105
|
var $compact = _ref8.$compact,
|
|
106
106
|
$isBodyScrolled = _ref8.$isBodyScrolled;
|
|
@@ -118,7 +118,7 @@ export var StyledModalHeader = /*#__PURE__*/styled.div.withConfig({
|
|
|
118
118
|
});
|
|
119
119
|
export var StyledModalHeading = /*#__PURE__*/styled.div.withConfig({
|
|
120
120
|
displayName: "StyledModalHeading",
|
|
121
|
-
componentId: "core-
|
|
121
|
+
componentId: "core-12_26_2__sc-1ijdug2-8"
|
|
122
122
|
})(["", " align-items:center;display:flex;flex:1 1 auto;min-height:36px;padding-right:", "px;", ""], function (_ref0) {
|
|
123
123
|
var $compact = _ref0.$compact;
|
|
124
124
|
return getTypographyIntent($compact ? 'h3' : 'h2');
|
|
@@ -134,18 +134,18 @@ export var StyledModalHeading = /*#__PURE__*/styled.div.withConfig({
|
|
|
134
134
|
});
|
|
135
135
|
export var StyledModalCancel = /*#__PURE__*/styled.div.withConfig({
|
|
136
136
|
displayName: "StyledModalCancel",
|
|
137
|
-
componentId: "core-
|
|
137
|
+
componentId: "core-12_26_2__sc-1ijdug2-9"
|
|
138
138
|
})(["flex:0 0 auto;"]);
|
|
139
139
|
export var StyledModalScrim = /*#__PURE__*/styled.div.withConfig({
|
|
140
140
|
displayName: "StyledModalScrim",
|
|
141
|
-
componentId: "core-
|
|
141
|
+
componentId: "core-12_26_2__sc-1ijdug2-10"
|
|
142
142
|
})(["background:hsla(200,8%,10%,0.6);height:100vh;left:0;position:absolute;top:0;width:100vw;z-index:1;"]);
|
|
143
143
|
export var StyledModalWarningIcon = /*#__PURE__*/styled(Warning).withConfig({
|
|
144
144
|
displayName: "StyledModalWarningIcon",
|
|
145
|
-
componentId: "core-
|
|
145
|
+
componentId: "core-12_26_2__sc-1ijdug2-11"
|
|
146
146
|
})(["color:", ";margin-right:", "px;"], colors.yellow40, spacing.sm);
|
|
147
147
|
export var StyledModalFooterSummary = /*#__PURE__*/styled.div.withConfig({
|
|
148
148
|
displayName: "StyledModalFooterSummary",
|
|
149
|
-
componentId: "core-
|
|
149
|
+
componentId: "core-12_26_2__sc-1ijdug2-12"
|
|
150
150
|
})(["", " border-top:1px solid ", ";border-bottom:1px solid ", ";padding:", "px ", "px;color:", ";font-style:italic;background-color:", ";margin:-", "px -", "px ", "px -", "px;flex:1 1 100%;"], getTypographyIntent('small'), colors.gray85, colors.gray85, spacing.md, spacing.xxl, colors.gray15, colors.gray98, spacing.xl, spacing.xxl, spacing.xl, spacing.xxl);
|
|
151
151
|
//# sourceMappingURL=Modal.styles.js.map
|
|
@@ -6,26 +6,26 @@ import { getFocus } from '../_styles/mixins';
|
|
|
6
6
|
import { spacing } from '../_styles/spacing';
|
|
7
7
|
export var StyledMultiSelectValues = /*#__PURE__*/styled.div.withConfig({
|
|
8
8
|
displayName: "StyledMultiSelectValues",
|
|
9
|
-
componentId: "core-
|
|
9
|
+
componentId: "core-12_26_2__sc-s9ym9q-0"
|
|
10
10
|
})(["display:flex;flex-wrap:wrap;margin-bottom:2px;margin-left:", "px;margin-right:", "px;margin-top:2px;min-width:0;width:100%;"], spacing.md, spacing.xs);
|
|
11
11
|
export var StyledMultiSelectToken = /*#__PURE__*/styled.div.withConfig({
|
|
12
12
|
displayName: "StyledMultiSelectToken",
|
|
13
|
-
componentId: "core-
|
|
13
|
+
componentId: "core-12_26_2__sc-s9ym9q-1"
|
|
14
14
|
})(["margin-bottom:2px;margin-right:", "px;margin-top:2px;flex:0 1 auto;> div{max-width:178px;width:100%;}"], spacing.xs);
|
|
15
15
|
export var StyledMultiSelectSearchInput = /*#__PURE__*/styled.input.withConfig({
|
|
16
16
|
displayName: "StyledMultiSelectSearchInput",
|
|
17
|
-
componentId: "core-
|
|
17
|
+
componentId: "core-12_26_2__sc-s9ym9q-2"
|
|
18
18
|
})(["background-color:transparent;border-width:0;font-family:inherit;padding:0;height:24px;width:100%;", " ", " &::-ms-clear{display:none;}&:focus{box-shadow:none;outline:none;}&::placeholder{color:", ";}"], getTypographyIntent('body'), function (_ref) {
|
|
19
19
|
var $isNavigatingTokens = _ref.$isNavigatingTokens;
|
|
20
20
|
return $isNavigatingTokens && css(["color:transparent;"]);
|
|
21
21
|
}, colors.gray45);
|
|
22
22
|
export var StyledMultiSelectSearch = /*#__PURE__*/styled.div.withConfig({
|
|
23
23
|
displayName: "StyledMultiSelectSearch",
|
|
24
|
-
componentId: "core-
|
|
24
|
+
componentId: "core-12_26_2__sc-s9ym9q-3"
|
|
25
25
|
})(["margin-bottom:2px;margin-right:", "px;margin-top:2px;flex:1;max-width:100%;min-width:24px;"], spacing.xs);
|
|
26
26
|
export var StyledMultiSelectSearchIcon = /*#__PURE__*/styled.div.withConfig({
|
|
27
27
|
displayName: "StyledMultiSelectSearchIcon",
|
|
28
|
-
componentId: "core-
|
|
28
|
+
componentId: "core-12_26_2__sc-s9ym9q-4"
|
|
29
29
|
})(["align-items:center;align-self:flex-start;display:flex;height:34px;justify-content:flex-end;margin-left:", "px;margin-right:", "px;min-width:40px;width:40px;"], spacing.xs, spacing.md);
|
|
30
30
|
export var StyledMultiSelectClearIcon = StyledSelectClearIcon;
|
|
31
31
|
export var StyledMultiSelectArrowContainer = StyledSelectArrowContainer;
|
|
@@ -33,7 +33,7 @@ export var StyledMultiSelectArrow = StyledSelectArrow;
|
|
|
33
33
|
export var StyledMultiSelectMenu = StyledSelectMenu;
|
|
34
34
|
export var StyledMultiSelectButton = /*#__PURE__*/styled(StyledSelectButton).withConfig({
|
|
35
35
|
displayName: "StyledMultiSelectButton",
|
|
36
|
-
componentId: "core-
|
|
36
|
+
componentId: "core-12_26_2__sc-s9ym9q-5"
|
|
37
37
|
})(["height:auto;padding:0;white-space:normal;&:focus-within{", "}", ""], getFocus(), function (_ref2) {
|
|
38
38
|
var $emptyValue = _ref2.$emptyValue;
|
|
39
39
|
return $emptyValue && css(["", "{cursor:pointer;}"], StyledMultiSelectSearchInput);
|
|
@@ -6,14 +6,14 @@ export var optionMinHeight = 32;
|
|
|
6
6
|
export var defaultMenuHeight = 64;
|
|
7
7
|
export var StyledOptions = /*#__PURE__*/styled.div.withConfig({
|
|
8
8
|
displayName: "StyledOptions",
|
|
9
|
-
componentId: "core-
|
|
9
|
+
componentId: "core-12_26_2__sc-3o6zya-0"
|
|
10
10
|
})([""]);
|
|
11
11
|
export var StyledItem = /*#__PURE__*/styled.div.withConfig({
|
|
12
12
|
displayName: "StyledItem",
|
|
13
|
-
componentId: "core-
|
|
13
|
+
componentId: "core-12_26_2__sc-3o6zya-1"
|
|
14
14
|
})(["", ";padding:", "px ", "px;cursor:pointer;list-style-type:none;"], getTypographyIntent('body'), spacing.xs, spacing.md);
|
|
15
15
|
export var StyledGroup = /*#__PURE__*/styled.div.withConfig({
|
|
16
16
|
displayName: "StyledGroup",
|
|
17
|
-
componentId: "core-
|
|
17
|
+
componentId: "core-12_26_2__sc-3o6zya-2"
|
|
18
18
|
})(["", ";padding:", "px ", "px ", "px;font-weight:", ";background:white;list-style-type:none;"], getTypographyIntent('body'), spacing.md, spacing.md, spacing.xs, typographyWeights.semibold);
|
|
19
19
|
//# sourceMappingURL=NextMenu.styles.js.map
|
|
@@ -113,7 +113,7 @@ export function NextTextEditor(_ref) {
|
|
|
113
113
|
onKeyDown(data.domEvent);
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
|
-
onInit === null || onInit === void 0 ? void 0 : onInit();
|
|
116
|
+
onInit === null || onInit === void 0 ? void 0 : onInit(editor);
|
|
117
117
|
};
|
|
118
118
|
var handleBlur = function handleBlur(event, editor) {
|
|
119
119
|
onBlur === null || onBlur === void 0 ? void 0 : onBlur(event, editor);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NextTextEditor.js","names":["CKEditor","ClassicEditor","React","TextEditorContext","useOverridableFocusScope","useI18nContext","useZIndexContext","EditorStyles","useStickyToolbar","TextEditorTheme","useCKEditorCss","useTabAsNavigation","addButtonDataAttributes","addPluginsFromStringArray","getDefaultConfig","applyLegacyTinyMceCompatibility","isLegacyTinyMceConfig","NextTextEditor","_ref","disabled","error","value","initialValue","onChange","onEditorChange","onDirty","onInit","onKeyDown","onFocusOut","onBlur","init","externalConfig","config","stringPlugins","plugins","propLocale","locale","restProps","_objectWithoutProperties","_excluded","_useCKEditorCss","cssLoading","isLoading","editorRef","useRef","editorInstanceRef","initialValueRef","_React$useState","useState","_React$useState2","_slicedToArray","isDirtyState","setIsDirtyState","_useI18nContext","contextLocale","useEffect","undefined","current","_useZIndexContext","zIndex","_React$useContext","useContext","features","enableStickyToolbar","stickyToolbar","enableTabAsNavigation","tabAsNavigation","mergedConfig","useMemo","defaultConfig","configWithPlugins","length","externalResult","finalConfig","_objectSpread","focusScope","setProps","contain","handleChange","_event","editor","data","getData","isDirty","handleReady","setData","editing","view","document","on","domEvent","handleBlur","event","_useStickyToolbar","enabled","stickyConfig","_useTabAsNavigation","editorKey","concat","createElement","ref","key","_extends","onReady"],"sources":["../../src/NextTextEditor/NextTextEditor.tsx"],"sourcesContent":["import { CKEditor } from '@ckeditor/ckeditor5-react'\nimport type { EditorConfig } from 'ckeditor5'\nimport { ClassicEditor, type EventInfo } from 'ckeditor5'\nimport React from 'react'\n\nimport { TextEditorContext } from '../TextEditor/TextEditorProvider'\nimport { useOverridableFocusScope } from '../_hooks/FocusScopeOverride'\nimport { useI18nContext } from '../_hooks/I18n'\nimport { useZIndexContext } from '../_hooks/ZIndex'\nimport { EditorStyles } from './NextTextEditor.styles'\nimport type { NextTextEditorProps } from './NextTextEditor.types'\nimport { useStickyToolbar } from './StickyToolbar'\nimport { TextEditorTheme } from './textEditorTheming'\nimport { useCKEditorCss } from './useCKEditorCss'\nimport { useTabAsNavigation } from './useTabAsNavigation'\nimport {\n addButtonDataAttributes,\n addPluginsFromStringArray,\n getDefaultConfig,\n} from './utils'\n\nimport {\n applyLegacyTinyMceCompatibility,\n isLegacyTinyMceConfig,\n} from './plugins/LegacyPasteAdapter/legacyTinyMceAdapter'\n\nexport function NextTextEditor({\n disabled,\n error,\n value,\n initialValue,\n onChange,\n onEditorChange,\n onDirty,\n onInit,\n onKeyDown,\n onFocusOut,\n onBlur,\n init,\n config: externalConfig,\n plugins: stringPlugins,\n locale: propLocale,\n ...restProps\n}: NextTextEditorProps) {\n const { isLoading: cssLoading } = useCKEditorCss()\n\n const editorRef = React.useRef<HTMLDivElement>(null)\n const editorInstanceRef = React.useRef<ClassicEditor | null>(null)\n const initialValueRef = React.useRef<string>(value || initialValue || '')\n const [isDirtyState, setIsDirtyState] = React.useState(false)\n const { locale: contextLocale } = useI18nContext()\n const locale = propLocale || contextLocale\n\n React.useEffect(() => {\n if (value !== undefined) {\n initialValueRef.current = value\n }\n }, [value])\n\n const { value: zIndex } = useZIndexContext()\n\n const { features } = React.useContext(TextEditorContext)\n const enableStickyToolbar = !!features?.stickyToolbar\n const enableTabAsNavigation = !!features?.tabAsNavigation\n\n const mergedConfig = React.useMemo(() => {\n const defaultConfig = getDefaultConfig(locale)\n\n // Handle string plugins for backward compatibility\n const configWithPlugins = stringPlugins?.length\n ? addPluginsFromStringArray(defaultConfig, stringPlugins)\n : defaultConfig\n\n // Apply any external CKEditor config overrides provided by the consumer\n const externalResult =\n typeof externalConfig === 'function'\n ? externalConfig(configWithPlugins)\n : undefined\n // Merge default config (with plugins) and consumer overrides\n let finalConfig: EditorConfig = {\n ...configWithPlugins,\n ...(externalResult ?? {}),\n }\n // Apply TinyMCE legacy compatibility only if `init` contains a legacy config\n if (init && isLegacyTinyMceConfig(init)) {\n finalConfig = applyLegacyTinyMceCompatibility(finalConfig, init)\n }\n\n return finalConfig\n }, [externalConfig, init, locale, stringPlugins])\n\n const focusScope = useOverridableFocusScope()\n React.useEffect(() => {\n focusScope.setProps({ contain: false })\n }, [focusScope])\n\n const handleChange = (\n _event: EventInfo<string, unknown>,\n editor: ClassicEditor\n ) => {\n const data = editor.getData()\n const isDirty = data !== initialValueRef.current\n\n // Call onDirty only on first content modification\n if (isDirty && !isDirtyState) {\n setIsDirtyState(true)\n onDirty?.()\n }\n\n onChange?.(data, isDirty)\n onEditorChange?.(data)\n }\n\n const handleReady = (editor: ClassicEditor) => {\n addButtonDataAttributes(editor)\n editorInstanceRef.current = editor\n\n if (initialValue) {\n editor.setData(initialValue)\n }\n\n if (onKeyDown) {\n editor.editing.view.document.on('keydown', (_event, data) => {\n onKeyDown(data.domEvent as KeyboardEvent)\n })\n }\n\n onInit?.()\n }\n\n const handleBlur = (\n event: EventInfo<string, unknown>,\n editor: ClassicEditor\n ) => {\n onBlur?.(event, editor)\n onFocusOut?.()\n }\n\n const { config: stickyConfig } = useStickyToolbar({\n config: mergedConfig,\n enabled: enableStickyToolbar,\n editor: editorInstanceRef.current,\n editorRef,\n cssLoading,\n })\n\n const { config } = useTabAsNavigation({\n config: stickyConfig,\n enabled: enableTabAsNavigation,\n editor: editorInstanceRef.current,\n })\n\n const editorKey = `${locale}-${enableTabAsNavigation}`\n\n if (cssLoading) {\n return null\n }\n\n return (\n <div ref={editorRef} key={editorKey}>\n <EditorStyles error={error} zIndex={zIndex + 1} />\n <TextEditorTheme />\n <CKEditor\n {...restProps}\n editor={ClassicEditor}\n config={config}\n disabled={disabled}\n data={value}\n onChange={handleChange}\n onReady={handleReady}\n onBlur={handleBlur}\n />\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,SAASA,QAAQ,QAAQ,2BAA2B;AAEpD,SAASC,aAAa,QAAwB,WAAW;AACzD,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,iBAAiB,QAAQ,kCAAkC;AACpE,SAASC,wBAAwB,QAAQ,8BAA8B;AACvE,SAASC,cAAc,QAAQ,gBAAgB;AAC/C,SAASC,gBAAgB,QAAQ,kBAAkB;AACnD,SAASC,YAAY,QAAQ,yBAAyB;AAEtD,SAASC,gBAAgB,QAAQ,iBAAiB;AAClD,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SAASC,kBAAkB,QAAQ,sBAAsB;AACzD,SACEC,uBAAuB,EACvBC,yBAAyB,EACzBC,gBAAgB,QACX,SAAS;AAEhB,SACEC,+BAA+B,EAC/BC,qBAAqB,QAChB,mDAAmD;AAE1D,OAAO,SAASC,cAAcA,CAAAC,IAAA,EAiBN;EAAA,IAhBtBC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IACRC,KAAK,GAAAF,IAAA,CAALE,KAAK;IACLC,KAAK,GAAAH,IAAA,CAALG,KAAK;IACLC,YAAY,GAAAJ,IAAA,CAAZI,YAAY;IACZC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ACpB,CACE,CAAC;AAEV"}
|
|
1
|
+
{"version":3,"file":"NextTextEditor.js","names":["CKEditor","ClassicEditor","React","TextEditorContext","useOverridableFocusScope","useI18nContext","useZIndexContext","EditorStyles","useStickyToolbar","TextEditorTheme","useCKEditorCss","useTabAsNavigation","addButtonDataAttributes","addPluginsFromStringArray","getDefaultConfig","applyLegacyTinyMceCompatibility","isLegacyTinyMceConfig","NextTextEditor","_ref","disabled","error","value","initialValue","onChange","onEditorChange","onDirty","onInit","onKeyDown","onFocusOut","onBlur","init","externalConfig","config","stringPlugins","plugins","propLocale","locale","restProps","_objectWithoutProperties","_excluded","_useCKEditorCss","cssLoading","isLoading","editorRef","useRef","editorInstanceRef","initialValueRef","_React$useState","useState","_React$useState2","_slicedToArray","isDirtyState","setIsDirtyState","_useI18nContext","contextLocale","useEffect","undefined","current","_useZIndexContext","zIndex","_React$useContext","useContext","features","enableStickyToolbar","stickyToolbar","enableTabAsNavigation","tabAsNavigation","mergedConfig","useMemo","defaultConfig","configWithPlugins","length","externalResult","finalConfig","_objectSpread","focusScope","setProps","contain","handleChange","_event","editor","data","getData","isDirty","handleReady","setData","editing","view","document","on","domEvent","handleBlur","event","_useStickyToolbar","enabled","stickyConfig","_useTabAsNavigation","editorKey","concat","createElement","ref","key","_extends","onReady"],"sources":["../../src/NextTextEditor/NextTextEditor.tsx"],"sourcesContent":["import { CKEditor } from '@ckeditor/ckeditor5-react'\nimport type { EditorConfig } from 'ckeditor5'\nimport { ClassicEditor, type EventInfo } from 'ckeditor5'\nimport React from 'react'\n\nimport { TextEditorContext } from '../TextEditor/TextEditorProvider'\nimport { useOverridableFocusScope } from '../_hooks/FocusScopeOverride'\nimport { useI18nContext } from '../_hooks/I18n'\nimport { useZIndexContext } from '../_hooks/ZIndex'\nimport { EditorStyles } from './NextTextEditor.styles'\nimport type { NextTextEditorProps } from './NextTextEditor.types'\nimport { useStickyToolbar } from './StickyToolbar'\nimport { TextEditorTheme } from './textEditorTheming'\nimport { useCKEditorCss } from './useCKEditorCss'\nimport { useTabAsNavigation } from './useTabAsNavigation'\nimport {\n addButtonDataAttributes,\n addPluginsFromStringArray,\n getDefaultConfig,\n} from './utils'\n\nimport {\n applyLegacyTinyMceCompatibility,\n isLegacyTinyMceConfig,\n} from './plugins/LegacyPasteAdapter/legacyTinyMceAdapter'\n\nexport function NextTextEditor({\n disabled,\n error,\n value,\n initialValue,\n onChange,\n onEditorChange,\n onDirty,\n onInit,\n onKeyDown,\n onFocusOut,\n onBlur,\n init,\n config: externalConfig,\n plugins: stringPlugins,\n locale: propLocale,\n ...restProps\n}: NextTextEditorProps) {\n const { isLoading: cssLoading } = useCKEditorCss()\n\n const editorRef = React.useRef<HTMLDivElement>(null)\n const editorInstanceRef = React.useRef<ClassicEditor | null>(null)\n const initialValueRef = React.useRef<string>(value || initialValue || '')\n const [isDirtyState, setIsDirtyState] = React.useState(false)\n const { locale: contextLocale } = useI18nContext()\n const locale = propLocale || contextLocale\n\n React.useEffect(() => {\n if (value !== undefined) {\n initialValueRef.current = value\n }\n }, [value])\n\n const { value: zIndex } = useZIndexContext()\n\n const { features } = React.useContext(TextEditorContext)\n const enableStickyToolbar = !!features?.stickyToolbar\n const enableTabAsNavigation = !!features?.tabAsNavigation\n\n const mergedConfig = React.useMemo(() => {\n const defaultConfig = getDefaultConfig(locale)\n\n // Handle string plugins for backward compatibility\n const configWithPlugins = stringPlugins?.length\n ? addPluginsFromStringArray(defaultConfig, stringPlugins)\n : defaultConfig\n\n // Apply any external CKEditor config overrides provided by the consumer\n const externalResult =\n typeof externalConfig === 'function'\n ? externalConfig(configWithPlugins)\n : undefined\n // Merge default config (with plugins) and consumer overrides\n let finalConfig: EditorConfig = {\n ...configWithPlugins,\n ...(externalResult ?? {}),\n }\n // Apply TinyMCE legacy compatibility only if `init` contains a legacy config\n if (init && isLegacyTinyMceConfig(init)) {\n finalConfig = applyLegacyTinyMceCompatibility(finalConfig, init)\n }\n\n return finalConfig\n }, [externalConfig, init, locale, stringPlugins])\n\n const focusScope = useOverridableFocusScope()\n React.useEffect(() => {\n focusScope.setProps({ contain: false })\n }, [focusScope])\n\n const handleChange = (\n _event: EventInfo<string, unknown>,\n editor: ClassicEditor\n ) => {\n const data = editor.getData()\n const isDirty = data !== initialValueRef.current\n\n // Call onDirty only on first content modification\n if (isDirty && !isDirtyState) {\n setIsDirtyState(true)\n onDirty?.()\n }\n\n onChange?.(data, isDirty)\n onEditorChange?.(data)\n }\n\n const handleReady = (editor: ClassicEditor) => {\n addButtonDataAttributes(editor)\n editorInstanceRef.current = editor\n\n if (initialValue) {\n editor.setData(initialValue)\n }\n\n if (onKeyDown) {\n editor.editing.view.document.on('keydown', (_event, data) => {\n onKeyDown(data.domEvent as KeyboardEvent)\n })\n }\n\n onInit?.(editor)\n }\n\n const handleBlur = (\n event: EventInfo<string, unknown>,\n editor: ClassicEditor\n ) => {\n onBlur?.(event, editor)\n onFocusOut?.()\n }\n\n const { config: stickyConfig } = useStickyToolbar({\n config: mergedConfig,\n enabled: enableStickyToolbar,\n editor: editorInstanceRef.current,\n editorRef,\n cssLoading,\n })\n\n const { config } = useTabAsNavigation({\n config: stickyConfig,\n enabled: enableTabAsNavigation,\n editor: editorInstanceRef.current,\n })\n\n const editorKey = `${locale}-${enableTabAsNavigation}`\n\n if (cssLoading) {\n return null\n }\n\n return (\n <div ref={editorRef} key={editorKey}>\n <EditorStyles error={error} zIndex={zIndex + 1} />\n <TextEditorTheme />\n <CKEditor\n {...restProps}\n editor={ClassicEditor}\n config={config}\n disabled={disabled}\n data={value}\n onChange={handleChange}\n onReady={handleReady}\n onBlur={handleBlur}\n />\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,SAASA,QAAQ,QAAQ,2BAA2B;AAEpD,SAASC,aAAa,QAAwB,WAAW;AACzD,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,iBAAiB,QAAQ,kCAAkC;AACpE,SAASC,wBAAwB,QAAQ,8BAA8B;AACvE,SAASC,cAA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,UAAU,EAAE;IACd,OAAO,IAAI;EACb;EAEA,oBACEvC,KAAA,CAAAiG,aAAA;IAAKC,GAAG,EAAEzD,SAAU;IAAC0D,GAAG,EAAEJ;EAAU,gBAClC/F,KAAA,CAAAiG,aAAA,CAAC5F,YAAY;IAACa,KAAK,EAAEA,KAAM;IAACuC,MAAM,EAAEA,MAAM,GAAG;EAAE,CAAE,CAAC,eAClDzD,KAAA,CAAAiG,aAAA,CAAC1F,eAAe,MAAE,CAAC,eACnBP,KAAA,CAAAiG,aAAA,CAACnG,QAAQ,EAAAsG,QAAA,KACHjE,SAAS;IACb2C,MAAM,EAAE/E,aAAc;IACtB+B,MAAM,EAAEA,MAAO;IACfb,QAAQ,EAAEA,QAAS;IACnB8D,IAAI,EAAE5D,KAAM;IACZE,QAAQ,EAAEuD,YAAa;IACvByB,OAAO,EAAEnB,WAAY;IACrBvD,MAAM,EAAE8D;EAAW,EACpB,CACE,CAAC;AAEV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NextTextEditor.types.js","names":[],"sources":["../../src/NextTextEditor/NextTextEditor.types.ts"],"sourcesContent":["import type { CKEditor } from '@ckeditor/ckeditor5-react'\nimport type { ClassicEditor, EditorConfig } from 'ckeditor5'\nimport type React from 'react'\nimport type { Locale } from '../_hooks/I18n'\nimport type { LegacyTinyMceLike } from './plugins/LegacyPasteAdapter/legacyTinyMceAdapter'\n\nexport type NextTextEditorProps = Pick<\n React.ComponentProps<typeof CKEditor<ClassicEditor>>,\n 'onFocus' | 'onBlur' | 'onError' | 'onAfterDestroy' | 'disabled' | 'id'\n> & {\n /**\n * Indicates if the editor is in an error state\n *\n * @since 10.19.0\n */\n error?: boolean\n\n /**\n * @deprecated\n * `initialValue` has been deprecated and will be removed in a future version.\n * Please use the `value` prop instead\n *\n * @deprecatedSince 10.20.0\n * @since 10.19.0\n */\n initialValue?: string\n\n /**\n * The current value of the editor\n *\n * @since 10.19.0\n */\n value?: string\n\n /**\n * Callback fired when the editor is ready\n *\n * @since 10.19.0\n */\n onInit?: () => void\n\n /**\n * Callback fired when the editor content changes\n *\n * @param value - The current content of the editor\n * @param isDirty - Whether the content differs from the initial value\n * @since 10.19.0\n */\n onChange?: (value: string, isDirty?: boolean) => void\n\n /**\n * Callback fired when the editor content changes\n *\n * @param value - The current content of the editor\n * @since 12.26.0\n * @deprecated TinyMCE-specific. Will be removed after teams migrate to CKEditor standard API.\n */\n onEditorChange?: (value: string) => void\n\n /**\n * Callback fired when the editor becomes dirty (content differs from initial value)\n *\n * @since 12.26.0\n * @deprecated TinyMCE-specific. Will be removed after teams migrate to CKEditor standard API.\n */\n onDirty?: () => void\n\n /**\n * Callback fired when a key is pressed in the editor\n *\n * @param event - The keyboard event\n * @since 12.26.0\n * @deprecated TinyMCE-specific. Will be removed after teams migrate to CKEditor standard API.\n */\n onKeyDown?: (event: KeyboardEvent) => void\n\n /**\n * Callback fired when the editor loses focus\n *\n * @since 12.26.0\n * @deprecated TinyMCE-specific. Will be removed after teams migrate to CKEditor standard API.\n */\n onFocusOut?: () => void\n\n /**\n * Locale which will be used for localization. Can be passed directly or\n * set by wrapping components in I18n provider.\n * @since 10.19.0\n */\n locale?: Locale\n\n /**\n * Configuration function for customizing the editor\n *\n * @param defaultConfig - The default CKEditor configuration\n * @returns Customized configuration object\n * @since 12.26.0\n */\n config?: (defaultConfig: EditorConfig) => EditorConfig\n\n /**\n * Legacy TinyMCE-style config object (e.g., NO_IMAGE_PASTE_TINY_MCE_CONFIG()).\n * If provided, we auto-adapt it to CKEditor (paste_preprocess / paste_data_images).\n *\n * * @deprecated TinyMCE-specific. Will be removed after teams migrate to CKEditor standard API.\n *\n * TODO Remove after adapter decommission.\n * Decommission plan:\n * 1) Release CKEditor\n * 2) Remove TinyMCE\n * 3) Announce adapter decommission deadline\n * 4) Teams migrate to CKEditor standard API\n * 5) Delete this TinyMCE→CKEditor adapter API\n *\n * @since 12.26.0\n */\n init?: LegacyTinyMceLike | undefined\n\n /**\n * Array of plugin names to add to the editor in addition to the defaults.\n * This provides backward compatibility with the deprecated TinyMCE version of the editor.\n * Supports plugin names like 'link', 'image', 'table', etc.\n *\n * @since 12.26.0\n */\n plugins?: string[]\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"NextTextEditor.types.js","names":[],"sources":["../../src/NextTextEditor/NextTextEditor.types.ts"],"sourcesContent":["import type { CKEditor } from '@ckeditor/ckeditor5-react'\nimport type { ClassicEditor, EditorConfig } from 'ckeditor5'\nimport type React from 'react'\nimport type { Locale } from '../_hooks/I18n'\nimport type { LegacyTinyMceLike } from './plugins/LegacyPasteAdapter/legacyTinyMceAdapter'\n\nexport type NextTextEditorProps = Pick<\n React.ComponentProps<typeof CKEditor<ClassicEditor>>,\n 'onFocus' | 'onBlur' | 'onError' | 'onAfterDestroy' | 'disabled' | 'id'\n> & {\n /**\n * Indicates if the editor is in an error state\n *\n * @since 10.19.0\n */\n error?: boolean\n\n /**\n * @deprecated\n * `initialValue` has been deprecated and will be removed in a future version.\n * Please use the `value` prop instead\n *\n * @deprecatedSince 10.20.0\n * @since 10.19.0\n */\n initialValue?: string\n\n /**\n * The current value of the editor\n *\n * @since 10.19.0\n */\n value?: string\n\n /**\n * Callback fired when the editor is ready\n *\n * @since 10.19.0\n */\n onInit?: (editor: ClassicEditor) => void\n\n /**\n * Callback fired when the editor content changes\n *\n * @param value - The current content of the editor\n * @param isDirty - Whether the content differs from the initial value\n * @since 10.19.0\n */\n onChange?: (value: string, isDirty?: boolean) => void\n\n /**\n * Callback fired when the editor content changes\n *\n * @param value - The current content of the editor\n * @since 12.26.0\n * @deprecated TinyMCE-specific. Will be removed after teams migrate to CKEditor standard API.\n */\n onEditorChange?: (value: string) => void\n\n /**\n * Callback fired when the editor becomes dirty (content differs from initial value)\n *\n * @since 12.26.0\n * @deprecated TinyMCE-specific. Will be removed after teams migrate to CKEditor standard API.\n */\n onDirty?: () => void\n\n /**\n * Callback fired when a key is pressed in the editor\n *\n * @param event - The keyboard event\n * @since 12.26.0\n * @deprecated TinyMCE-specific. Will be removed after teams migrate to CKEditor standard API.\n */\n onKeyDown?: (event: KeyboardEvent) => void\n\n /**\n * Callback fired when the editor loses focus\n *\n * @since 12.26.0\n * @deprecated TinyMCE-specific. Will be removed after teams migrate to CKEditor standard API.\n */\n onFocusOut?: () => void\n\n /**\n * Locale which will be used for localization. Can be passed directly or\n * set by wrapping components in I18n provider.\n * @since 10.19.0\n */\n locale?: Locale\n\n /**\n * Configuration function for customizing the editor\n *\n * @param defaultConfig - The default CKEditor configuration\n * @returns Customized configuration object\n * @since 12.26.0\n */\n config?: (defaultConfig: EditorConfig) => EditorConfig\n\n /**\n * Legacy TinyMCE-style config object (e.g., NO_IMAGE_PASTE_TINY_MCE_CONFIG()).\n * If provided, we auto-adapt it to CKEditor (paste_preprocess / paste_data_images).\n *\n * * @deprecated TinyMCE-specific. Will be removed after teams migrate to CKEditor standard API.\n *\n * TODO Remove after adapter decommission.\n * Decommission plan:\n * 1) Release CKEditor\n * 2) Remove TinyMCE\n * 3) Announce adapter decommission deadline\n * 4) Teams migrate to CKEditor standard API\n * 5) Delete this TinyMCE→CKEditor adapter API\n *\n * @since 12.26.0\n */\n init?: LegacyTinyMceLike | undefined\n\n /**\n * Array of plugin names to add to the editor in addition to the defaults.\n * This provides backward compatibility with the deprecated TinyMCE version of the editor.\n * Supports plugin names like 'link', 'image', 'table', etc.\n *\n * @since 12.26.0\n */\n plugins?: string[]\n}\n"],"mappings":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Alignment, AutoLink, Bold, Clipboard, Essentials, FontBackgroundColor, FontColor, FontSize, GeneralHtmlSupport, Image, ImageInsert, ImageToolbar, Indent, IndentBlock, Italic, Link, List, ListProperties, Paragraph, Strikethrough, Table, TableCaption, TableCellProperties, TableColumnResize, TableProperties, TableToolbar, Underline } from 'ckeditor5';
|
|
2
|
-
import {
|
|
2
|
+
import { CK_EDITOR_LICENSE_KEY } from '../license_key';
|
|
3
3
|
import { CutPlugin } from '../plugins/CutPlugin';
|
|
4
4
|
import { IndentPaddingToMarginPlugin } from '../plugins/IndentPaddingToMarginPlugin';
|
|
5
5
|
import { PasteAsTextPlugin } from '../plugins/PasteAsTextPlugin';
|
|
@@ -54,7 +54,7 @@ var TEXT_COLOR_PALETTE = [{
|
|
|
54
54
|
export var getDefaultConfig = function getDefaultConfig() {
|
|
55
55
|
var locale = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'en';
|
|
56
56
|
return {
|
|
57
|
-
licenseKey:
|
|
57
|
+
licenseKey: CK_EDITOR_LICENSE_KEY,
|
|
58
58
|
language: getValidEditorLocale(locale),
|
|
59
59
|
translations: [getEditorTranslation(locale)],
|
|
60
60
|
plugins: [Alignment, AutoLink, Bold, Clipboard, Essentials, FontBackgroundColor, FontColor, FontSize, GeneralHtmlSupport, Indent, IndentBlock, Italic, Link, List, ListProperties, Paragraph, Strikethrough, Table, TableCaption, TableCellProperties, TableColumnResize, TableProperties, TableToolbar, Underline, Image, ImageInsert, ImageToolbar, CutPlugin, PastePlugin, PasteAsTextPlugin, IndentPaddingToMarginPlugin, TabSpacesPlugin],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","names":["Alignment","AutoLink","Bold","Clipboard","Essentials","FontBackgroundColor","FontColor","FontSize","GeneralHtmlSupport","Image","ImageInsert","ImageToolbar","Indent","IndentBlock","Italic","Link","List","ListProperties","Paragraph","Strikethrough","Table","TableCaption","TableCellProperties","TableColumnResize","TableProperties","TableToolbar","Underline","DEV_CK_EDITOR_LICENSE_KEY","CutPlugin","IndentPaddingToMarginPlugin","PasteAsTextPlugin","PastePlugin","TabSpacesPlugin","getEditorTranslation","getValidEditorLocale","TEXT_COLOR_PALETTE","color","getDefaultConfig","locale","arguments","length","undefined","licenseKey","language","translations","plugins","toolbar","fontSize","options","title","model","supportAllValues","fontColor","colors","fontBackgroundColor","indentBlock","offset","unit","htmlSupport","allow","name","styles","list","properties","useAttribute","startIndex","reversed","image","insert","integrations","table","contentToolbar","tableProperties","borderColors","backgroundColors","tableCellProperties","addButtonDataAttributes","editor","applyAttributes","toolbarElement","ui","view","element","toolbarChildren","Array","from","querySelectorAll","moreDropdownButtons","allToolbarElements","concat","toolbarItems","config","get","elementIndex","forEach","itemName","classList","contains","setAttribute","observer","MutationObserver","observe","childList","subtree","on","disconnect"],"sources":["../../../src/NextTextEditor/utils/config.ts"],"sourcesContent":["import type { ClassicEditor, EditorConfig } from 'ckeditor5'\nimport {\n Alignment,\n AutoLink,\n Bold,\n Clipboard,\n Essentials,\n FontBackgroundColor,\n FontColor,\n FontSize,\n GeneralHtmlSupport,\n Image,\n ImageInsert,\n ImageToolbar,\n Indent,\n IndentBlock,\n Italic,\n Link,\n List,\n ListProperties,\n Paragraph,\n Strikethrough,\n Table,\n TableCaption,\n TableCellProperties,\n TableColumnResize,\n TableProperties,\n TableToolbar,\n Underline,\n} from 'ckeditor5'\n\nimport { DEV_CK_EDITOR_LICENSE_KEY } from '../license_key'\nimport { CutPlugin } from '../plugins/CutPlugin'\nimport { IndentPaddingToMarginPlugin } from '../plugins/IndentPaddingToMarginPlugin'\nimport { PasteAsTextPlugin } from '../plugins/PasteAsTextPlugin'\nimport { PastePlugin } from '../plugins/PastePlugin'\nimport { TabSpacesPlugin } from '../plugins/TabSpacesPlugin'\nimport { getEditorTranslation, getValidEditorLocale } from './locale'\n\nconst TEXT_COLOR_PALETTE = [\n { color: '#BFEDD2' },\n { color: '#FBEEB8' },\n { color: '#F8CAC6' },\n { color: '#ECCAFA' },\n { color: '#C2E0F4' },\n { color: '#2DC26B' },\n { color: '#F1C40F' },\n { color: '#E03E2D' },\n { color: '#B96AD9' },\n { color: '#3598DB' },\n { color: '#169179' },\n { color: '#E67E23' },\n { color: '#BA372A' },\n { color: '#843FA1' },\n { color: '#236FA1' },\n { color: '#ECF0F1' },\n { color: '#CED4D9' },\n { color: '#95A5A6' },\n { color: '#7E8C8D' },\n { color: '#34495E' },\n { color: '#000000' },\n { color: '#FFFFFF' },\n]\n\nexport const getDefaultConfig = (locale: string = 'en'): EditorConfig => ({\n licenseKey: DEV_CK_EDITOR_LICENSE_KEY,\n language: getValidEditorLocale(locale),\n translations: [getEditorTranslation(locale)],\n plugins: [\n Alignment,\n AutoLink,\n Bold,\n Clipboard,\n Essentials,\n FontBackgroundColor,\n FontColor,\n FontSize,\n GeneralHtmlSupport,\n Indent,\n IndentBlock,\n Italic,\n Link,\n List,\n ListProperties,\n Paragraph,\n Strikethrough,\n Table,\n TableCaption,\n TableCellProperties,\n TableColumnResize,\n TableProperties,\n TableToolbar,\n Underline,\n Image,\n ImageInsert,\n ImageToolbar,\n CutPlugin,\n PastePlugin,\n PasteAsTextPlugin,\n IndentPaddingToMarginPlugin,\n TabSpacesPlugin,\n ],\n toolbar: [\n 'bold',\n 'italic',\n 'underline',\n 'strikethrough',\n '|',\n 'alignment:left',\n 'alignment:center',\n 'alignment:right',\n '|',\n 'bulletedList',\n 'numberedList',\n '|',\n 'outdent',\n 'indent',\n '|',\n 'cut',\n 'paste',\n 'pasteAsText',\n '|',\n 'fontSize',\n '|',\n 'fontColor',\n 'fontBackgroundColor',\n '|',\n 'undo',\n 'redo',\n ],\n fontSize: {\n options: [\n { title: '8pt', model: '8px' },\n { title: '10pt', model: '10px' },\n { title: '12pt', model: '12px' },\n { title: '14pt', model: '14px' },\n { title: '18pt', model: '18px' },\n { title: '24pt', model: '24px' },\n { title: '36pt', model: '36px' },\n ],\n supportAllValues: true,\n },\n fontColor: {\n colors: TEXT_COLOR_PALETTE,\n },\n fontBackgroundColor: {\n colors: TEXT_COLOR_PALETTE,\n },\n indentBlock: {\n offset: 40,\n unit: 'px',\n },\n htmlSupport: {\n allow: [\n {\n name: 'p',\n styles: {\n 'margin-left': true,\n },\n },\n ],\n },\n list: {\n properties: {\n styles: {\n useAttribute: true,\n },\n startIndex: true,\n reversed: true,\n },\n },\n image: {\n insert: {\n integrations: ['insertImageViaUrl'],\n },\n },\n table: {\n contentToolbar: [\n 'tableColumn',\n 'tableRow',\n 'mergeTableCells',\n 'tableProperties',\n 'tableCellProperties',\n ],\n tableProperties: {\n borderColors: TEXT_COLOR_PALETTE,\n backgroundColors: TEXT_COLOR_PALETTE,\n },\n tableCellProperties: {\n borderColors: TEXT_COLOR_PALETTE,\n backgroundColors: TEXT_COLOR_PALETTE,\n },\n },\n})\n\n// Add stable data attributes to toolbar buttons for the styling (or testing) purposes\nexport const addButtonDataAttributes = (editor: ClassicEditor) => {\n const applyAttributes = () => {\n const toolbarElement = editor.ui.view.toolbar.element\n if (!toolbarElement) {\n return\n }\n\n // Get buttons in the main toolbar\n const toolbarChildren = Array.from(\n toolbarElement.querySelectorAll('.ck-toolbar__items > *')\n )\n\n // Get buttons hidden in \"more\" dropdown\n const moreDropdownButtons = Array.from(\n toolbarElement.querySelectorAll('.ck-dropdown__panel .ck-list .ck-button')\n )\n\n const allToolbarElements = [...toolbarChildren, ...moreDropdownButtons]\n\n // Create mapping based on toolbar configuration order\n const toolbarItems = (editor.config.get('toolbar') || []) as string[]\n let elementIndex = 0\n\n toolbarItems.forEach((itemName) => {\n const element = allToolbarElements[elementIndex]\n if (\n itemName !== '|' &&\n element &&\n !element.classList.contains('ck-toolbar__separator')\n ) {\n // Use the toolbar item name as the stable identifier\n element.setAttribute('data-cke-command', itemName)\n }\n elementIndex++\n })\n }\n\n // Apply attributes initially\n applyAttributes()\n\n // Re-apply when dropdown menus are opened (buttons get created dynamically)\n const toolbarElement = editor.ui.view.toolbar.element\n if (toolbarElement) {\n const observer = new MutationObserver(() => {\n applyAttributes()\n })\n observer.observe(toolbarElement, {\n childList: true,\n subtree: true,\n })\n editor.on('destroy', () => {\n observer.disconnect()\n })\n }\n}\n"],"mappings":"AACA,SACEA,SAAS,EACTC,QAAQ,EACRC,IAAI,EACJC,SAAS,EACTC,UAAU,EACVC,mBAAmB,EACnBC,SAAS,EACTC,QAAQ,EACRC,kBAAkB,EAClBC,KAAK,EACLC,WAAW,EACXC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C1CtB,eAAe,CAAC,CAAC;IACnB,CAAC,CAAC;IACFqB,QAAQ,CAACE,OAAO,CAACtB,cAAc,EAAE;MAC/BuB,SAAS,EAAE,IAAI;MACfC,OAAO,EAAE;IACX,CAAC,CAAC;IACF1B,MAAM,CAAC2B,EAAE,CAAC,SAAS,EAAE,YAAM;MACzBL,QAAQ,CAACM,UAAU,CAAC,CAAC;IACvB,CAAC,CAAC;EACJ;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"config.js","names":["Alignment","AutoLink","Bold","Clipboard","Essentials","FontBackgroundColor","FontColor","FontSize","GeneralHtmlSupport","Image","ImageInsert","ImageToolbar","Indent","IndentBlock","Italic","Link","List","ListProperties","Paragraph","Strikethrough","Table","TableCaption","TableCellProperties","TableColumnResize","TableProperties","TableToolbar","Underline","CK_EDITOR_LICENSE_KEY","CutPlugin","IndentPaddingToMarginPlugin","PasteAsTextPlugin","PastePlugin","TabSpacesPlugin","getEditorTranslation","getValidEditorLocale","TEXT_COLOR_PALETTE","color","getDefaultConfig","locale","arguments","length","undefined","licenseKey","language","translations","plugins","toolbar","fontSize","options","title","model","supportAllValues","fontColor","colors","fontBackgroundColor","indentBlock","offset","unit","htmlSupport","allow","name","styles","list","properties","useAttribute","startIndex","reversed","image","insert","integrations","table","contentToolbar","tableProperties","borderColors","backgroundColors","tableCellProperties","addButtonDataAttributes","editor","applyAttributes","toolbarElement","ui","view","element","toolbarChildren","Array","from","querySelectorAll","moreDropdownButtons","allToolbarElements","concat","toolbarItems","config","get","elementIndex","forEach","itemName","classList","contains","setAttribute","observer","MutationObserver","observe","childList","subtree","on","disconnect"],"sources":["../../../src/NextTextEditor/utils/config.ts"],"sourcesContent":["import type { ClassicEditor, EditorConfig } from 'ckeditor5'\nimport {\n Alignment,\n AutoLink,\n Bold,\n Clipboard,\n Essentials,\n FontBackgroundColor,\n FontColor,\n FontSize,\n GeneralHtmlSupport,\n Image,\n ImageInsert,\n ImageToolbar,\n Indent,\n IndentBlock,\n Italic,\n Link,\n List,\n ListProperties,\n Paragraph,\n Strikethrough,\n Table,\n TableCaption,\n TableCellProperties,\n TableColumnResize,\n TableProperties,\n TableToolbar,\n Underline,\n} from 'ckeditor5'\n\nimport { CK_EDITOR_LICENSE_KEY } from '../license_key'\nimport { CutPlugin } from '../plugins/CutPlugin'\nimport { IndentPaddingToMarginPlugin } from '../plugins/IndentPaddingToMarginPlugin'\nimport { PasteAsTextPlugin } from '../plugins/PasteAsTextPlugin'\nimport { PastePlugin } from '../plugins/PastePlugin'\nimport { TabSpacesPlugin } from '../plugins/TabSpacesPlugin'\nimport { getEditorTranslation, getValidEditorLocale } from './locale'\n\nconst TEXT_COLOR_PALETTE = [\n { color: '#BFEDD2' },\n { color: '#FBEEB8' },\n { color: '#F8CAC6' },\n { color: '#ECCAFA' },\n { color: '#C2E0F4' },\n { color: '#2DC26B' },\n { color: '#F1C40F' },\n { color: '#E03E2D' },\n { color: '#B96AD9' },\n { color: '#3598DB' },\n { color: '#169179' },\n { color: '#E67E23' },\n { color: '#BA372A' },\n { color: '#843FA1' },\n { color: '#236FA1' },\n { color: '#ECF0F1' },\n { color: '#CED4D9' },\n { color: '#95A5A6' },\n { color: '#7E8C8D' },\n { color: '#34495E' },\n { color: '#000000' },\n { color: '#FFFFFF' },\n]\n\nexport const getDefaultConfig = (locale: string = 'en'): EditorConfig => ({\n licenseKey: CK_EDITOR_LICENSE_KEY,\n language: getValidEditorLocale(locale),\n translations: [getEditorTranslation(locale)],\n plugins: [\n Alignment,\n AutoLink,\n Bold,\n Clipboard,\n Essentials,\n FontBackgroundColor,\n FontColor,\n FontSize,\n GeneralHtmlSupport,\n Indent,\n IndentBlock,\n Italic,\n Link,\n List,\n ListProperties,\n Paragraph,\n Strikethrough,\n Table,\n TableCaption,\n TableCellProperties,\n TableColumnResize,\n TableProperties,\n TableToolbar,\n Underline,\n Image,\n ImageInsert,\n ImageToolbar,\n CutPlugin,\n PastePlugin,\n PasteAsTextPlugin,\n IndentPaddingToMarginPlugin,\n TabSpacesPlugin,\n ],\n toolbar: [\n 'bold',\n 'italic',\n 'underline',\n 'strikethrough',\n '|',\n 'alignment:left',\n 'alignment:center',\n 'alignment:right',\n '|',\n 'bulletedList',\n 'numberedList',\n '|',\n 'outdent',\n 'indent',\n '|',\n 'cut',\n 'paste',\n 'pasteAsText',\n '|',\n 'fontSize',\n '|',\n 'fontColor',\n 'fontBackgroundColor',\n '|',\n 'undo',\n 'redo',\n ],\n fontSize: {\n options: [\n { title: '8pt', model: '8px' },\n { title: '10pt', model: '10px' },\n { title: '12pt', model: '12px' },\n { title: '14pt', model: '14px' },\n { title: '18pt', model: '18px' },\n { title: '24pt', model: '24px' },\n { title: '36pt', model: '36px' },\n ],\n supportAllValues: true,\n },\n fontColor: {\n colors: TEXT_COLOR_PALETTE,\n },\n fontBackgroundColor: {\n colors: TEXT_COLOR_PALETTE,\n },\n indentBlock: {\n offset: 40,\n unit: 'px',\n },\n htmlSupport: {\n allow: [\n {\n name: 'p',\n styles: {\n 'margin-left': true,\n },\n },\n ],\n },\n list: {\n properties: {\n styles: {\n useAttribute: true,\n },\n startIndex: true,\n reversed: true,\n },\n },\n image: {\n insert: {\n integrations: ['insertImageViaUrl'],\n },\n },\n table: {\n contentToolbar: [\n 'tableColumn',\n 'tableRow',\n 'mergeTableCells',\n 'tableProperties',\n 'tableCellProperties',\n ],\n tableProperties: {\n borderColors: TEXT_COLOR_PALETTE,\n backgroundColors: TEXT_COLOR_PALETTE,\n },\n tableCellProperties: {\n borderColors: TEXT_COLOR_PALETTE,\n backgroundColors: TEXT_COLOR_PALETTE,\n },\n },\n})\n\n// Add stable data attributes to toolbar buttons for the styling (or testing) purposes\nexport const addButtonDataAttributes = (editor: ClassicEditor) => {\n const applyAttributes = () => {\n const toolbarElement = editor.ui.view.toolbar.element\n if (!toolbarElement) {\n return\n }\n\n // Get buttons in the main toolbar\n const toolbarChildren = Array.from(\n toolbarElement.querySelectorAll('.ck-toolbar__items > *')\n )\n\n // Get buttons hidden in \"more\" dropdown\n const moreDropdownButtons = Array.from(\n toolbarElement.querySelectorAll('.ck-dropdown__panel .ck-list .ck-button')\n )\n\n const allToolbarElements = [...toolbarChildren, ...moreDropdownButtons]\n\n // Create mapping based on toolbar configuration order\n const toolbarItems = (editor.config.get('toolbar') || []) as string[]\n let elementIndex = 0\n\n toolbarItems.forEach((itemName) => {\n const element = allToolbarElements[elementIndex]\n if (\n itemName !== '|' &&\n element &&\n !element.classList.contains('ck-toolbar__separator')\n ) {\n // Use the toolbar item name as the stable identifier\n element.setAttribute('data-cke-command', itemName)\n }\n elementIndex++\n })\n }\n\n // Apply attributes initially\n applyAttributes()\n\n // Re-apply when dropdown menus are opened (buttons get created dynamically)\n const toolbarElement = editor.ui.view.toolbar.element\n if (toolbarElement) {\n const observer = new MutationObserver(() => {\n applyAttributes()\n })\n observer.observe(toolbarElement, {\n childList: true,\n subtree: true,\n })\n editor.on('destroy', () => {\n observer.disconnect()\n })\n }\n}\n"],"mappings":"AACA,SACEA,SAAS,EACTC,QAAQ,EACRC,IAAI,EACJC,SAAS,EACTC,UAAU,EACVC,mBAAmB,EACnBC,SAAS,EACTC,QAAQ,EACRC,kBAAkB,EAClBC,KAAK,EACLC,WAAW,EACXC,YAAY,EACZC,MAAM,EACNC,WAAW,EACXC,MAAM,EACNC,IAAI,EACJC,IAAI,EACJC,cAAc,EACdC,SAAS,EACTC,aAAa,EACbC,KAAK,EACLC,YAAY,EACZC,mBAAmB,EACnBC,iBAAiB,EACjBC,eAAe,EACfC,YAAY,EACZC,SAAS,QACJ,WAAW;AAElB,SAASC,qBAAqB,QAAQ,gBAAgB;AACtD,SAASC,SAAS,QAAQ,sBAAsB;AAChD,SAASC,2BAA2B,QAAQ,wCAAwC;AACpF,SAASC,iBAAiB,QAAQ,8BAA8B;AAChE,SAASC,WAAW,QAAQ,wBAAwB;AACpD,SAASC,eAAe,QAAQ,4BAA4B;AAC5D,SAASC,oBAAoB,EAAEC,oBAAoB,QAAQ,UAAU;A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gB,CAAC,yCAAyC,CAC3E,CAAC;IAED,IAAME,kBAAkB,MAAAC,MAAA,CAAON,eAAe,EAAKI,mBAAmB,CAAC;;IAEvE;IACA,IAAMG,YAAY,GAAIb,MAAM,CAACc,MAAM,CAACC,GAAG,CAAC,SAAS,CAAC,IAAI,EAAe;IACrE,IAAIC,YAAY,GAAG,CAAC;IAEpBH,YAAY,CAACI,OAAO,CAAC,UAACC,QAAQ,EAAK;MACjC,IAAMb,OAAO,GAAGM,kBAAkB,CAACK,YAAY,CAAC;MAChD,IACEE,QAAQ,KAAK,GAAG,IAChBb,OAAO,IACP,CAACA,OAAO,CAACc,SAAS,CAACC,QAAQ,CAAC,uBAAuB,CAAC,EACpD;QACA;QACAf,OAAO,CAACgB,YAAY,CAAC,kBAAkB,EAAEH,QAAQ,CAAC;MACpD;MACAF,YAAY,EAAE;IAChB,CAAC,CAAC;EACJ,CAAC;;EAED;EACAf,eAAe,CAAC,CAAC;;EAEjB;EACA,IAAMC,cAAc,GAAGF,MAAM,CAACG,EAAE,CAACC,IAAI,CAACnC,OAAO,CAACoC,OAAO;EACrD,IAAIH,cAAc,EAAE;IAClB,IAAMoB,QAAQ,GAAG,IAAIC,gBAAgB,CAAC,YAAM;MAC1CtB,eAAe,CAAC,CAAC;IACnB,CAAC,CAAC;IACFqB,QAAQ,CAACE,OAAO,CAACtB,cAAc,EAAE;MAC/BuB,SAAS,EAAE,IAAI;MACfC,OAAO,EAAE;IACX,CAAC,CAAC;IACF1B,MAAM,CAAC2B,EAAE,CAAC,SAAS,EAAE,YAAM;MACzBL,QAAQ,CAACM,UAAU,CAAC,CAAC;IACvB,CAAC,CAAC;EACJ;AACF,CAAC"}
|
|
@@ -3,6 +3,7 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
|
|
|
3
3
|
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], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
4
4
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
5
5
|
import React from 'react';
|
|
6
|
+
import { TextEditor } from '../TextEditor';
|
|
6
7
|
import { StyledEditor } from './NextTextEditorOutput.styles';
|
|
7
8
|
import { sanitizeTextEditorHtml } from './NextTextEditorOutput.utils';
|
|
8
9
|
|
|
@@ -15,14 +16,17 @@ export var NextTextEditorOutput = /*#__PURE__*/React.forwardRef(function NextTex
|
|
|
15
16
|
var value = _ref.value,
|
|
16
17
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
17
18
|
var sanitizedHtml = sanitizeTextEditorHtml(value || '');
|
|
19
|
+
var handleInit = function handleInit(editor) {
|
|
20
|
+
editor.enableReadOnlyMode('TextEditorOutput');
|
|
21
|
+
if (editor.ui.view.toolbar.element) {
|
|
22
|
+
editor.ui.view.toolbar.element.style.display = 'none';
|
|
23
|
+
}
|
|
24
|
+
};
|
|
18
25
|
return /*#__PURE__*/React.createElement(StyledEditor, _extends({}, props, {
|
|
19
26
|
ref: ref
|
|
20
|
-
}), /*#__PURE__*/React.createElement(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
__html: sanitizedHtml
|
|
24
|
-
},
|
|
25
|
-
contentEditable: false
|
|
27
|
+
}), /*#__PURE__*/React.createElement(TextEditor, {
|
|
28
|
+
value: sanitizedHtml,
|
|
29
|
+
onInit: handleInit
|
|
26
30
|
}));
|
|
27
31
|
});
|
|
28
32
|
NextTextEditorOutput.displayName = 'NextTextEditorOutput';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NextTextEditorOutput.js","names":["React","StyledEditor","sanitizeTextEditorHtml","NextTextEditorOutput","forwardRef","_ref","ref","value","props","_objectWithoutProperties","_excluded","sanitizedHtml","
|
|
1
|
+
{"version":3,"file":"NextTextEditorOutput.js","names":["React","TextEditor","StyledEditor","sanitizeTextEditorHtml","NextTextEditorOutput","forwardRef","_ref","ref","value","props","_objectWithoutProperties","_excluded","sanitizedHtml","handleInit","editor","enableReadOnlyMode","ui","view","toolbar","element","style","display","createElement","_extends","onInit","displayName"],"sources":["../../src/NextTextEditorOutput/NextTextEditorOutput.tsx"],"sourcesContent":["import React from 'react'\n\nimport type { ClassicEditor } from 'ckeditor5'\nimport { TextEditor } from '../TextEditor'\nimport type { DivAttributes } from '../_utils/types'\nimport { StyledEditor } from './NextTextEditorOutput.styles'\nimport type { NextTextEditorOutputProps } from './NextTextEditorOutput.types'\nimport { sanitizeTextEditorHtml } from './NextTextEditorOutput.utils'\n\n/**\n * Render formatted text from `TextEditor`\n *\n * @since 10.24.0\n */\nexport const NextTextEditorOutput = React.forwardRef<\n HTMLDivElement,\n NextTextEditorOutputProps & DivAttributes\n>(function NextTextEditorOutput({ value, ...props }, ref) {\n const sanitizedHtml = sanitizeTextEditorHtml(value || '')\n\n const handleInit = (editor: ClassicEditor) => {\n editor.enableReadOnlyMode('TextEditorOutput')\n if (editor.ui.view.toolbar.element) {\n editor.ui.view.toolbar.element.style.display = 'none'\n }\n }\n\n return (\n <StyledEditor {...props} ref={ref}>\n <TextEditor value={sanitizedHtml} onInit={handleInit} />\n </StyledEditor>\n )\n})\n\nNextTextEditorOutput.displayName = 'NextTextEditorOutput'\n"],"mappings":";;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AAGzB,SAASC,UAAU,QAAQ,eAAe;AAE1C,SAASC,YAAY,QAAQ,+BAA+B;AAE5D,SAASC,sBAAsB,QAAQ,8BAA8B;;AAErE;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMC,oBAAoB,gBAAGJ,KAAK,CAACK,UAAU,CAGlD,SAASD,oBAAoBA,CAAAE,IAAA,EAAsBC,GAAG,EAAE;EAAA,IAAxBC,KAAK,GAAAF,IAAA,CAALE,KAAK;IAAKC,KAAK,GAAAC,wBAAA,CAAAJ,IAAA,EAAAK,SAAA;EAC/C,IAAMC,aAAa,GAAGT,sBAAsB,CAACK,KAAK,IAAI,EAAE,CAAC;EAEzD,IAAMK,UAAU,GAAG,SAAbA,UAAUA,CAAIC,MAAqB,EAAK;IAC5CA,MAAM,CAACC,kBAAkB,CAAC,kBAAkB,CAAC;IAC7C,IAAID,MAAM,CAACE,EAAE,CAACC,IAAI,CAACC,OAAO,CAACC,OAAO,EAAE;MAClCL,MAAM,CAACE,EAAE,CAACC,IAAI,CAACC,OAAO,CAACC,OAAO,CAACC,KAAK,CAACC,OAAO,GAAG,MAAM;IACvD;EACF,CAAC;EAED,oBACErB,KAAA,CAAAsB,aAAA,CAACpB,YAAY,EAAAqB,QAAA,KAAKd,KAAK;IAAEF,GAAG,EAAEA;EAAI,iBAChCP,KAAA,CAAAsB,aAAA,CAACrB,UAAU;IAACO,KAAK,EAAEI,aAAc;IAACY,MAAM,EAAEX;EAAW,CAAE,CAC3C,CAAC;AAEnB,CAAC,CAAC;AAEFT,oBAAoB,CAACqB,WAAW,GAAG,sBAAsB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
export var StyledEditor = /*#__PURE__*/styled.div.withConfig({
|
|
3
3
|
displayName: "StyledEditor",
|
|
4
|
-
componentId: "core-
|
|
5
|
-
})([".ck-content{border:none;padding:0;p{margin:0;}}"]);
|
|
4
|
+
componentId: "core-12_26_2__sc-2s34a1-0"
|
|
5
|
+
})([".ck-content{border:none !important;padding:0 !important;p{margin:0;}}"]);
|
|
6
6
|
//# sourceMappingURL=NextTextEditorOutput.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NextTextEditorOutput.styles.js","names":["styled","StyledEditor","div","withConfig","displayName","componentId"],"sources":["../../src/NextTextEditorOutput/NextTextEditorOutput.styles.ts"],"sourcesContent":["import styled from 'styled-components'\n\nexport const StyledEditor = styled.div`\n .ck-content {\n border: none;\n padding: 0;\n\n p {\n margin: 0;\n }\n }\n`\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,mBAAmB;AAEtC,OAAO,IAAMC,YAAY,gBAAGD,MAAM,CAACE,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"NextTextEditorOutput.styles.js","names":["styled","StyledEditor","div","withConfig","displayName","componentId"],"sources":["../../src/NextTextEditorOutput/NextTextEditorOutput.styles.ts"],"sourcesContent":["import styled from 'styled-components'\n\nexport const StyledEditor = styled.div`\n .ck-content {\n border: none !important;\n padding: 0 !important;\n\n p {\n margin: 0;\n }\n }\n`\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,mBAAmB;AAEtC,OAAO,IAAMC,YAAY,gBAAGD,MAAM,CAACE,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,6EASrC"}
|
|
@@ -14,7 +14,7 @@ var variantColorMap = {
|
|
|
14
14
|
};
|
|
15
15
|
var StyledNotation = /*#__PURE__*/styled.i.withConfig({
|
|
16
16
|
displayName: "StyledNotation",
|
|
17
|
-
componentId: "core-
|
|
17
|
+
componentId: "core-12_26_2__sc-160q1m6-0"
|
|
18
18
|
})(["", " color:", ";font-style:italic;"], getTypographyIntent('small'), function (_ref) {
|
|
19
19
|
var $variant = _ref.$variant;
|
|
20
20
|
return $variant ? colors[variantColorMap[$variant]] : colors.gray15;
|