decap-cms-widget-markdown 3.1.2 → 3.1.4

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.
Files changed (75) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/decap-cms-widget-markdown.js +3 -3
  3. package/dist/decap-cms-widget-markdown.js.map +1 -1
  4. package/dist/esm/MarkdownControl/Toolbar.js +2 -2
  5. package/dist/esm/MarkdownControl/components/Shortcode.js +2 -2
  6. package/dist/esm/MarkdownControl/index.js +2 -2
  7. package/dist/esm/MarkdownControl/plugins/blocks/events/keyDown.js +10 -0
  8. package/dist/esm/MarkdownControl/plugins/blocks/locations/isCursorAfterSoftBreak.js +16 -0
  9. package/dist/esm/MarkdownControl/plugins/blocks/locations/isCursorCollapsedAfterSoftBreak.js +17 -0
  10. package/dist/esm/MarkdownControl/plugins/blocks/locations/isCursorInNonDefaultBlock copy.js +19 -0
  11. package/dist/esm/MarkdownControl/plugins/blocks/transforms/unwrapIfCursorAtStart.js +12 -4
  12. package/dist/esm/MarkdownControl/plugins/lists/events/keyDownShiftTab.js +2 -2
  13. package/dist/esm/MarkdownControl/plugins/lists/events/keyDownTab.js +2 -2
  14. package/dist/esm/MarkdownControl/plugins/lists/transforms/liftFirstMatchedParent.js +2 -2
  15. package/dist/esm/MarkdownControl/plugins/lists/transforms/unwrapSelectionFromList.js +2 -2
  16. package/dist/esm/MarkdownControl/renderers.js +17 -17
  17. package/dist/esm/MarkdownPreview.js +2 -2
  18. package/dist/esm/index.js +2 -2
  19. package/dist/esm/serializers/remarkAssertParents.js +2 -2
  20. package/dist/esm/serializers/remarkEscapeMarkdownEntities.js +2 -2
  21. package/dist/esm/serializers/remarkImagesToText.js +2 -2
  22. package/dist/esm/serializers/remarkPaddedLinks.js +2 -2
  23. package/dist/esm/serializers/remarkRehypeShortcodes.js +2 -2
  24. package/dist/esm/serializers/remarkSlate.js +12 -3
  25. package/dist/esm/serializers/remarkSquashReferences.js +2 -2
  26. package/dist/esm/serializers/slateRemark.js +2 -2
  27. package/package.json +2 -2
  28. package/src/MarkdownControl/plugins/blocks/events/keyDown.js +9 -0
  29. package/src/MarkdownControl/plugins/blocks/locations/isCursorCollapsedAfterSoftBreak.js +13 -0
  30. package/src/MarkdownControl/plugins/blocks/transforms/unwrapIfCursorAtStart.js +17 -4
  31. package/src/MarkdownControl/renderers.js +6 -1
  32. package/src/serializers/remarkSlate.js +9 -1
  33. package/dist/esm/MarkdownControl/PlateEditor.js +0 -149
  34. package/dist/esm/components/Icons.js +0 -174
  35. package/dist/esm/components/plate-ui/blockquote-element.js +0 -28
  36. package/dist/esm/components/plate-ui/button.js +0 -66
  37. package/dist/esm/components/plate-ui/code-block-combobox.js +0 -66
  38. package/dist/esm/components/plate-ui/code-block-element.css +0 -434
  39. package/dist/esm/components/plate-ui/code-block-element.js +0 -41
  40. package/dist/esm/components/plate-ui/code-leaf.js +0 -28
  41. package/dist/esm/components/plate-ui/code-line-element.js +0 -16
  42. package/dist/esm/components/plate-ui/code-syntax-leaf.js +0 -34
  43. package/dist/esm/components/plate-ui/command.js +0 -55
  44. package/dist/esm/components/plate-ui/dialog.js +0 -44
  45. package/dist/esm/components/plate-ui/dropdown-menu.js +0 -114
  46. package/dist/esm/components/plate-ui/editor.js +0 -71
  47. package/dist/esm/components/plate-ui/fixed-toolbar-buttons.js +0 -49
  48. package/dist/esm/components/plate-ui/fixed-toolbar.js +0 -9
  49. package/dist/esm/components/plate-ui/floating-toolbar-buttons.js +0 -34
  50. package/dist/esm/components/plate-ui/floating-toolbar.js +0 -50
  51. package/dist/esm/components/plate-ui/heading-element.js +0 -52
  52. package/dist/esm/components/plate-ui/input.js +0 -25
  53. package/dist/esm/components/plate-ui/insert-dropdown-menu.js +0 -200
  54. package/dist/esm/components/plate-ui/kbd-leaf.js +0 -27
  55. package/dist/esm/components/plate-ui/link-element.js +0 -34
  56. package/dist/esm/components/plate-ui/link-floating-toolbar.js +0 -116
  57. package/dist/esm/components/plate-ui/list-element.js +0 -38
  58. package/dist/esm/components/plate-ui/mark-toolbar-button.js +0 -34
  59. package/dist/esm/components/plate-ui/mode-dropdown-menu.js +0 -67
  60. package/dist/esm/components/plate-ui/more-dropdown-menu.js +0 -50
  61. package/dist/esm/components/plate-ui/paragraph-element.js +0 -9
  62. package/dist/esm/components/plate-ui/placeholder.js +0 -52
  63. package/dist/esm/components/plate-ui/popover.js +0 -45
  64. package/dist/esm/components/plate-ui/resizable.js +0 -50
  65. package/dist/esm/components/plate-ui/separator.js +0 -27
  66. package/dist/esm/components/plate-ui/table-cell-element.js +0 -97
  67. package/dist/esm/components/plate-ui/table-element.js +0 -182
  68. package/dist/esm/components/plate-ui/table-row-element.js +0 -27
  69. package/dist/esm/components/plate-ui/toolbar.js +0 -99
  70. package/dist/esm/components/plate-ui/tooltip.js +0 -49
  71. package/dist/esm/components/plate-ui/turn-into-dropdown-menu.js +0 -129
  72. package/dist/esm/style/global.css +0 -78
  73. package/dist/esm/style/input.css +0 -3
  74. package/dist/esm/style/output.css +0 -557
  75. package/dist/esm/styles/globals.css +0 -76
@@ -1,174 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.iconVariants = exports.Icons = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _classVarianceAuthority = require("class-variance-authority");
9
- var _lucideReact = require("lucide-react");
10
- var _react2 = require("@emotion/react");
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
13
- const borderAll = props => (0, _react2.jsx)("svg", _extends({
14
- viewBox: "0 0 24 24",
15
- height: "48",
16
- width: "48",
17
- focusable: "false",
18
- role: "img",
19
- fill: "currentColor",
20
- xmlns: "http://www.w3.org/2000/svg"
21
- }, props), (0, _react2.jsx)("path", {
22
- d: "M3 6a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V6zm10 13h5a1 1 0 0 0 1-1v-5h-6v6zm-2-6H5v5a1 1 0 0 0 1 1h5v-6zm2-2h6V6a1 1 0 0 0-1-1h-5v6zm-2-6H6a1 1 0 0 0-1 1v5h6V5z"
23
- }));
24
- const borderBottom = props => (0, _react2.jsx)("svg", _extends({
25
- viewBox: "0 0 24 24",
26
- height: "48",
27
- width: "48",
28
- focusable: "false",
29
- role: "img",
30
- fill: "currentColor",
31
- xmlns: "http://www.w3.org/2000/svg"
32
- }, props), (0, _react2.jsx)("path", {
33
- d: "M13 5a1 1 0 1 0 0-2h-2a1 1 0 1 0 0 2h2zm-8 6a1 1 0 1 0-2 0v2a1 1 0 1 0 2 0v-2zm-2 7a1 1 0 1 1 2 0 1 1 0 0 0 1 1h12a1 1 0 0 0 1-1 1 1 0 1 1 2 0 3 3 0 0 1-3 3H6a3 3 0 0 1-3-3zm17-8a1 1 0 0 0-1 1v2a1 1 0 1 0 2 0v-2a1 1 0 0 0-1-1zM7 4a1 1 0 0 0-1-1 3 3 0 0 0-3 3 1 1 0 0 0 2 0 1 1 0 0 1 1-1 1 1 0 0 0 1-1zm11-1a1 1 0 1 0 0 2 1 1 0 0 1 1 1 1 1 0 1 0 2 0 3 3 0 0 0-3-3z"
34
- }));
35
- const borderLeft = props => (0, _react2.jsx)("svg", _extends({
36
- viewBox: "0 0 24 24",
37
- height: "48",
38
- width: "48",
39
- focusable: "false",
40
- role: "img",
41
- fill: "currentColor",
42
- xmlns: "http://www.w3.org/2000/svg"
43
- }, props), (0, _react2.jsx)("path", {
44
- d: "M6 21a1 1 0 1 0 0-2 1 1 0 0 1-1-1V6a1 1 0 0 1 1-1 1 1 0 0 0 0-2 3 3 0 0 0-3 3v12a3 3 0 0 0 3 3zm7-16a1 1 0 1 0 0-2h-2a1 1 0 1 0 0 2h2zm6 6a1 1 0 1 1 2 0v2a1 1 0 1 1-2 0v-2zm-5 9a1 1 0 0 1-1 1h-2a1 1 0 1 1 0-2h2a1 1 0 0 1 1 1zm4-17a1 1 0 1 0 0 2 1 1 0 0 1 1 1 1 1 0 1 0 2 0 3 3 0 0 0-3-3zm-1 17a1 1 0 0 0 1 1 3 3 0 0 0 3-3 1 1 0 1 0-2 0 1 1 0 0 1-1 1 1 1 0 0 0-1 1z"
45
- }));
46
- const borderNone = props => (0, _react2.jsx)("svg", _extends({
47
- viewBox: "0 0 24 24",
48
- height: "48",
49
- width: "48",
50
- focusable: "false",
51
- role: "img",
52
- fill: "currentColor",
53
- xmlns: "http://www.w3.org/2000/svg"
54
- }, props), (0, _react2.jsx)("path", {
55
- d: "M14 4a1 1 0 0 1-1 1h-2a1 1 0 1 1 0-2h2a1 1 0 0 1 1 1zm-9 7a1 1 0 1 0-2 0v2a1 1 0 1 0 2 0v-2zm14 0a1 1 0 1 1 2 0v2a1 1 0 1 1-2 0v-2zm-6 10a1 1 0 1 0 0-2h-2a1 1 0 1 0 0 2h2zM7 4a1 1 0 0 0-1-1 3 3 0 0 0-3 3 1 1 0 0 0 2 0 1 1 0 0 1 1-1 1 1 0 0 0 1-1zm11-1a1 1 0 1 0 0 2 1 1 0 0 1 1 1 1 1 0 1 0 2 0 3 3 0 0 0-3-3zM7 20a1 1 0 0 1-1 1 3 3 0 0 1-3-3 1 1 0 1 1 2 0 1 1 0 0 0 1 1 1 1 0 0 1 1 1zm11 1a1 1 0 1 1 0-2 1 1 0 0 0 1-1 1 1 0 1 1 2 0 3 3 0 0 1-3 3z"
56
- }));
57
- const borderRight = props => (0, _react2.jsx)("svg", _extends({
58
- viewBox: "0 0 24 24",
59
- height: "48",
60
- width: "48",
61
- focusable: "false",
62
- role: "img",
63
- fill: "currentColor",
64
- xmlns: "http://www.w3.org/2000/svg"
65
- }, props), (0, _react2.jsx)("path", {
66
- d: "M13 5a1 1 0 1 0 0-2h-2a1 1 0 1 0 0 2h2zm-8 6a1 1 0 1 0-2 0v2a1 1 0 1 0 2 0v-2zm9 9a1 1 0 0 1-1 1h-2a1 1 0 1 1 0-2h2a1 1 0 0 1 1 1zM6 3a1 1 0 0 1 0 2 1 1 0 0 0-1 1 1 1 0 0 1-2 0 3 3 0 0 1 3-3zm1 17a1 1 0 0 1-1 1 3 3 0 0 1-3-3 1 1 0 1 1 2 0 1 1 0 0 0 1 1 1 1 0 0 1 1 1zm11 1a1 1 0 1 1 0-2 1 1 0 0 0 1-1V6a1 1 0 0 0-1-1 1 1 0 1 1 0-2 3 3 0 0 1 3 3v12a3 3 0 0 1-3 3z"
67
- }));
68
- const borderTop = props => (0, _react2.jsx)("svg", _extends({
69
- viewBox: "0 0 24 24",
70
- height: "48",
71
- width: "48",
72
- focusable: "false",
73
- role: "img",
74
- fill: "currentColor",
75
- xmlns: "http://www.w3.org/2000/svg"
76
- }, props), (0, _react2.jsx)("path", {
77
- d: "M3 6a1 1 0 0 0 2 0 1 1 0 0 1 1-1h12a1 1 0 0 1 1 1 1 1 0 1 0 2 0 3 3 0 0 0-3-3H6a3 3 0 0 0-3 3zm2 5a1 1 0 1 0-2 0v2a1 1 0 1 0 2 0v-2zm14 0a1 1 0 1 1 2 0v2a1 1 0 1 1-2 0v-2zm-5 9a1 1 0 0 1-1 1h-2a1 1 0 1 1 0-2h2a1 1 0 0 1 1 1zm-8 1a1 1 0 1 0 0-2 1 1 0 0 1-1-1 1 1 0 1 0-2 0 3 3 0 0 0 3 3zm11-1a1 1 0 0 0 1 1 3 3 0 0 0 3-3 1 1 0 1 0-2 0 1 1 0 0 1-1 1 1 1 0 0 0-1 1z"
78
- }));
79
- const Icons = exports.Icons = {
80
- add: _lucideReact.Plus,
81
- alignCenter: _lucideReact.AlignCenter,
82
- alignJustify: _lucideReact.AlignJustify,
83
- alignLeft: _lucideReact.AlignLeft,
84
- alignRight: _lucideReact.AlignRight,
85
- arrowDown: _lucideReact.ChevronDown,
86
- bg: _lucideReact.PaintBucket,
87
- blockquote: _lucideReact.Quote,
88
- bold: _lucideReact.Bold,
89
- borderAll,
90
- borderBottom,
91
- borderLeft,
92
- borderNone,
93
- borderRight,
94
- borderTop,
95
- check: _lucideReact.Check,
96
- chevronRight: _lucideReact.ChevronRight,
97
- chevronsUpDown: _lucideReact.ChevronsUpDown,
98
- clear: _lucideReact.X,
99
- close: _lucideReact.X,
100
- code: _lucideReact.Code2,
101
- codeblock: _lucideReact.FileCode,
102
- color: _lucideReact.Baseline,
103
- column: _lucideReact.RectangleVertical,
104
- combine: _lucideReact.Combine,
105
- ungroup: _lucideReact.Ungroup,
106
- comment: _lucideReact.MessageSquare,
107
- commentAdd: _lucideReact.MessageSquarePlus,
108
- delete: _lucideReact.Trash,
109
- dragHandle: _lucideReact.GripVertical,
110
- editing: _lucideReact.Edit2,
111
- emoji: _lucideReact.Smile,
112
- externalLink: _lucideReact.ExternalLink,
113
- h1: _lucideReact.Heading1,
114
- h2: _lucideReact.Heading2,
115
- h3: _lucideReact.Heading3,
116
- h4: _lucideReact.Heading4,
117
- h5: _lucideReact.Heading5,
118
- h6: _lucideReact.Heading6,
119
- image: _lucideReact.Image,
120
- indent: _lucideReact.Indent,
121
- italic: _lucideReact.Italic,
122
- kbd: _lucideReact.Keyboard,
123
- lineHeight: _lucideReact.WrapText,
124
- link: _lucideReact.Link2,
125
- minus: _lucideReact.Minus,
126
- more: _lucideReact.MoreHorizontal,
127
- ol: _lucideReact.ListOrdered,
128
- outdent: _lucideReact.Outdent,
129
- paragraph: _lucideReact.Pilcrow,
130
- refresh: _lucideReact.RotateCcw,
131
- row: _lucideReact.RectangleHorizontal,
132
- search: _lucideReact.Search,
133
- settings: _lucideReact.Settings,
134
- strikethrough: _lucideReact.Strikethrough,
135
- subscript: _lucideReact.Subscript,
136
- superscript: _lucideReact.Superscript,
137
- table: _lucideReact.Table,
138
- text: _lucideReact.Text,
139
- trash: _lucideReact.Trash,
140
- ul: _lucideReact.List,
141
- underline: _lucideReact.Underline,
142
- unlink: _lucideReact.Link2Off,
143
- viewing: _lucideReact.Eye,
144
- // www
145
- gitHub: props => (0, _react2.jsx)("svg", _extends({
146
- viewBox: "0 0 438.549 438.549"
147
- }, props), (0, _react2.jsx)("path", {
148
- fill: "currentColor",
149
- d: "M409.132 114.573c-19.608-33.596-46.205-60.194-79.798-79.8-33.598-19.607-70.277-29.408-110.063-29.408-39.781 0-76.472 9.804-110.063 29.408-33.596 19.605-60.192 46.204-79.8 79.8C9.803 148.168 0 184.854 0 224.63c0 47.78 13.94 90.745 41.827 128.906 27.884 38.164 63.906 64.572 108.063 79.227 5.14.954 8.945.283 11.419-1.996 2.475-2.282 3.711-5.14 3.711-8.562 0-.571-.049-5.708-.144-15.417a2549.81 2549.81 0 01-.144-25.406l-6.567 1.136c-4.187.767-9.469 1.092-15.846 1-6.374-.089-12.991-.757-19.842-1.999-6.854-1.231-13.229-4.086-19.13-8.559-5.898-4.473-10.085-10.328-12.56-17.556l-2.855-6.57c-1.903-4.374-4.899-9.233-8.992-14.559-4.093-5.331-8.232-8.945-12.419-10.848l-1.999-1.431c-1.332-.951-2.568-2.098-3.711-3.429-1.142-1.331-1.997-2.663-2.568-3.997-.572-1.335-.098-2.43 1.427-3.289 1.525-.859 4.281-1.276 8.28-1.276l5.708.853c3.807.763 8.516 3.042 14.133 6.851 5.614 3.806 10.229 8.754 13.846 14.842 4.38 7.806 9.657 13.754 15.846 17.847 6.184 4.093 12.419 6.136 18.699 6.136 6.28 0 11.704-.476 16.274-1.423 4.565-.952 8.848-2.383 12.847-4.285 1.713-12.758 6.377-22.559 13.988-29.41-10.848-1.14-20.601-2.857-29.264-5.14-8.658-2.286-17.605-5.996-26.835-11.14-9.235-5.137-16.896-11.516-22.985-19.126-6.09-7.614-11.088-17.61-14.987-29.979-3.901-12.374-5.852-26.648-5.852-42.826 0-23.035 7.52-42.637 22.557-58.817-7.044-17.318-6.379-36.732 1.997-58.24 5.52-1.715 13.706-.428 24.554 3.853 10.85 4.283 18.794 7.952 23.84 10.994 5.046 3.041 9.089 5.618 12.135 7.708 17.705-4.947 35.976-7.421 54.818-7.421s37.117 2.474 54.823 7.421l10.849-6.849c7.419-4.57 16.18-8.758 26.262-12.565 10.088-3.805 17.802-4.853 23.134-3.138 8.562 21.509 9.325 40.922 2.279 58.24 15.036 16.18 22.559 35.787 22.559 58.817 0 16.178-1.958 30.497-5.853 42.966-3.9 12.471-8.941 22.457-15.125 29.979-6.191 7.521-13.901 13.85-23.131 18.986-9.232 5.14-18.182 8.85-26.84 11.136-8.662 2.286-18.415 4.004-29.263 5.146 9.894 8.562 14.842 22.077 14.842 40.539v60.237c0 3.422 1.19 6.279 3.572 8.562 2.379 2.279 6.136 2.95 11.276 1.995 44.163-14.653 80.185-41.062 108.068-79.226 27.88-38.161 41.825-81.126 41.825-128.906-.01-39.771-9.818-76.454-29.414-110.049z"
150
- })),
151
- logo: props => (0, _react2.jsx)("svg", _extends({
152
- xmlns: "http://www.w3.org/2000/svg",
153
- viewBox: "0 0 24 24"
154
- }, props), (0, _react2.jsx)("path", {
155
- fill: "currentColor",
156
- d: "M11.572 0c-.176 0-.31.001-.358.007a19.76 19.76 0 0 1-.364.033C7.443.346 4.25 2.185 2.228 5.012a11.875 11.875 0 0 0-2.119 5.243c-.096.659-.108.854-.108 1.747s.012 1.089.108 1.748c.652 4.506 3.86 8.292 8.209 9.695.779.25 1.6.422 2.534.525.363.04 1.935.04 2.299 0 1.611-.178 2.977-.577 4.323-1.264.207-.106.247-.134.219-.158-.02-.013-.9-1.193-1.955-2.62l-1.919-2.592-2.404-3.558a338.739 338.739 0 0 0-2.422-3.556c-.009-.002-.018 1.579-.023 3.51-.007 3.38-.01 3.515-.052 3.595a.426.426 0 0 1-.206.214c-.075.037-.14.044-.495.044H7.81l-.108-.068a.438.438 0 0 1-.157-.171l-.05-.106.006-4.703.007-4.705.072-.092a.645.645 0 0 1 .174-.143c.096-.047.134-.051.54-.051.478 0 .558.018.682.154.035.038 1.337 1.999 2.895 4.361a10760.433 10760.433 0 0 0 4.735 7.17l1.9 2.879.096-.063a12.317 12.317 0 0 0 2.466-2.163 11.944 11.944 0 0 0 2.824-6.134c.096-.66.108-.854.108-1.748 0-.893-.012-1.088-.108-1.747-.652-4.506-3.859-8.292-8.208-9.695a12.597 12.597 0 0 0-2.499-.523A33.119 33.119 0 0 0 11.573 0zm4.069 7.217c.347 0 .408.005.486.047a.473.473 0 0 1 .237.277c.018.06.023 1.365.018 4.304l-.006 4.218-.744-1.14-.746-1.14v-3.066c0-1.982.01-3.097.023-3.15a.478.478 0 0 1 .233-.296c.096-.05.13-.054.5-.054z"
157
- })),
158
- moon: _lucideReact.Moon,
159
- sun: _lucideReact.SunMedium,
160
- twitter: _lucideReact.Twitter
161
- };
162
- const iconVariants = exports.iconVariants = (0, _classVarianceAuthority.cva)('', {
163
- variants: {
164
- variant: {
165
- toolbar: 'h-5 w-5',
166
- menuItem: 'mr-2 h-5 w-5'
167
- },
168
- size: {
169
- sm: 'mr-2 h-4 w-4',
170
- md: 'mr-2 h-6 w-6'
171
- }
172
- },
173
- defaultVariants: {}
174
- });
@@ -1,28 +0,0 @@
1
- "use strict";
2
- 'use client';
3
-
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.BlockquoteElement = void 0;
8
- var _react = _interopRequireDefault(require("react"));
9
- var _cn = require("@udecode/cn");
10
- var _plateCommon = require("@udecode/plate-common");
11
- var _react2 = require("@emotion/react");
12
- const _excluded = ["className", "children"];
13
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
15
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
16
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
17
- const BlockquoteElement = exports.BlockquoteElement = (0, _cn.withRef)((_ref, ref) => {
18
- let {
19
- className,
20
- children
21
- } = _ref,
22
- props = _objectWithoutProperties(_ref, _excluded);
23
- return (0, _react2.jsx)(_plateCommon.PlateElement, _extends({
24
- ref: ref,
25
- asChild: true,
26
- className: (0, _cn.cn)('my-1 border-l-2 pl-6 italic', className)
27
- }, props), (0, _react2.jsx)("blockquote", null, children));
28
- });
@@ -1,66 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.buttonVariants = exports.Button = void 0;
7
- var React = _interopRequireWildcard(require("react"));
8
- var _reactSlot = require("@radix-ui/react-slot");
9
- var _cn = require("@udecode/cn");
10
- var _classVarianceAuthority = require("class-variance-authority");
11
- var _react2 = require("@emotion/react");
12
- const _excluded = ["className", "isMenu", "variant", "size", "asChild"];
13
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
14
- 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 && Object.prototype.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; }
15
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
16
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
17
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
18
- const buttonVariants = exports.buttonVariants = (0, _classVarianceAuthority.cva)('inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50', {
19
- variants: {
20
- variant: {
21
- default: 'bg-primary text-primary-foreground hover:bg-primary/90',
22
- destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive/90',
23
- outline: 'border border-input bg-background hover:bg-accent hover:text-accent-foreground',
24
- secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
25
- ghost: 'hover:bg-accent hover:text-accent-foreground',
26
- link: 'text-primary underline-offset-4 hover:underline',
27
- inlineLink: 'text-base text-primary underline underline-offset-4'
28
- },
29
- size: {
30
- default: 'h-10 px-4 py-2',
31
- xs: 'h-8 rounded-md px-3',
32
- sm: 'h-9 rounded-md px-3',
33
- sms: 'h-9 w-9 rounded-md px-0',
34
- lg: 'h-11 rounded-md px-8',
35
- icon: 'h-10 w-10',
36
- none: ''
37
- },
38
- isMenu: {
39
- true: 'h-auto w-full cursor-pointer justify-start'
40
- }
41
- },
42
- defaultVariants: {
43
- variant: 'default',
44
- size: 'default'
45
- }
46
- });
47
- const Button = exports.Button = (0, _cn.withRef)((_ref, ref) => {
48
- let {
49
- className,
50
- isMenu,
51
- variant,
52
- size,
53
- asChild = false
54
- } = _ref,
55
- props = _objectWithoutProperties(_ref, _excluded);
56
- const Comp = asChild ? _reactSlot.Slot : 'button';
57
- return (0, _react2.jsx)(Comp, _extends({
58
- className: (0, _cn.cn)(buttonVariants({
59
- isMenu,
60
- variant,
61
- size,
62
- className
63
- })),
64
- ref: ref
65
- }, props));
66
- });
@@ -1,66 +0,0 @@
1
- "use strict";
2
- 'use client';
3
-
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.CodeBlockCombobox = CodeBlockCombobox;
8
- var _react = _interopRequireWildcard(require("react"));
9
- var _cn = require("@udecode/cn");
10
- var _plateCodeBlock = require("@udecode/plate-code-block");
11
- var _icons = require("@/components/icons");
12
- var _button = require("./button");
13
- var _command = require("./command");
14
- var _popover = require("./popover");
15
- var _react2 = require("@emotion/react");
16
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
17
- 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 && Object.prototype.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; }
18
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
19
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
20
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
21
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
22
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
23
- const languages = [{
24
- value: 'text',
25
- label: 'Plain Text'
26
- }, ...Object.entries(_objectSpread(_objectSpread({}, _plateCodeBlock.CODE_BLOCK_LANGUAGES_POPULAR), _plateCodeBlock.CODE_BLOCK_LANGUAGES)).map(([key, val]) => ({
27
- value: key,
28
- label: val
29
- }))];
30
- function CodeBlockCombobox() {
31
- var _languages$find;
32
- const state = (0, _plateCodeBlock.useCodeBlockComboboxState)();
33
- const {
34
- commandItemProps
35
- } = (0, _plateCodeBlock.useCodeBlockCombobox)(state);
36
- const [open, setOpen] = (0, _react.useState)(false);
37
- if (state.readOnly) return null;
38
- return (0, _react2.jsx)(_popover.Popover, {
39
- open: open,
40
- onOpenChange: setOpen
41
- }, (0, _react2.jsx)(_popover.PopoverTrigger, {
42
- asChild: true
43
- }, (0, _react2.jsx)(_button.Button, {
44
- variant: "ghost",
45
- role: "combobox",
46
- "aria-expanded": open,
47
- className: "h-5 justify-between px-1 text-xs",
48
- size: "xs"
49
- }, state.value ? (_languages$find = languages.find(language => language.value === state.value)) === null || _languages$find === void 0 ? void 0 : _languages$find.label : 'Plain Text', (0, _react2.jsx)(_icons.Icons.chevronsUpDown, {
50
- className: "ml-2 h-4 w-4 shrink-0 opacity-50"
51
- }))), (0, _react2.jsx)(_popover.PopoverContent, {
52
- className: "w-[200px] p-0"
53
- }, (0, _react2.jsx)(_command.Command, null, (0, _react2.jsx)(_command.CommandInput, {
54
- placeholder: "Search language..."
55
- }), (0, _react2.jsx)(_command.CommandEmpty, null, "No language found."), (0, _react2.jsx)(_command.CommandList, null, languages.map(language => (0, _react2.jsx)(_command.CommandItem, {
56
- key: language.value,
57
- value: language.value,
58
- className: "cursor-pointer",
59
- onSelect: _value => {
60
- commandItemProps.onSelect(_value);
61
- setOpen(false);
62
- }
63
- }, (0, _react2.jsx)(_icons.Icons.check, {
64
- className: (0, _cn.cn)('mr-2 h-4 w-4', state.value === language.value ? 'opacity-100' : 'opacity-0')
65
- }), language.label))))));
66
- }