@pie-lib/editable-html-tip-tap 2.1.2-next.29 → 2.1.2-next.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/CharacterPicker.d.ts +31 -0
- package/dist/components/CharacterPicker.js +131 -0
- package/dist/components/EditableHtml.d.ts +11 -0
- package/dist/components/EditableHtml.js +291 -0
- package/dist/components/MenuBar.d.ts +11 -0
- package/dist/components/MenuBar.js +462 -0
- package/dist/components/TiptapContainer.d.ts +11 -0
- package/dist/components/TiptapContainer.js +154 -0
- package/dist/components/characters/characterUtils.d.ts +35 -0
- package/dist/components/characters/characterUtils.js +465 -0
- package/dist/components/characters/custom-popper.d.ts +14 -0
- package/dist/components/characters/custom-popper.js +32 -0
- package/dist/components/common/done-button.d.ts +30 -0
- package/dist/components/common/done-button.js +26 -0
- package/dist/components/common/toolbar-buttons.d.ts +38 -0
- package/dist/components/common/toolbar-buttons.js +91 -0
- package/dist/components/icons/CssIcon.d.ts +11 -0
- package/dist/components/icons/CssIcon.js +14 -0
- package/dist/components/icons/RespArea.d.ts +26 -0
- package/dist/components/icons/RespArea.js +42 -0
- package/dist/components/icons/TableIcons.d.ts +14 -0
- package/dist/components/icons/TableIcons.js +32 -0
- package/dist/components/icons/TextAlign.d.ts +18 -0
- package/dist/components/icons/TextAlign.js +134 -0
- package/dist/components/image/AltDialog.d.ts +22 -0
- package/dist/components/image/AltDialog.js +61 -0
- package/dist/components/image/ImageToolbar.d.ts +24 -0
- package/dist/components/image/ImageToolbar.js +80 -0
- package/dist/components/image/InsertImageHandler.d.ts +32 -0
- package/dist/components/image/InsertImageHandler.js +53 -0
- package/dist/components/media/MediaDialog.d.ts +43 -0
- package/dist/components/media/MediaDialog.js +389 -0
- package/dist/components/media/MediaToolbar.d.ts +19 -0
- package/dist/components/media/MediaToolbar.js +41 -0
- package/dist/components/media/MediaWrapper.d.ts +19 -0
- package/dist/components/respArea/DragInTheBlank/DragInTheBlank.d.ts +23 -0
- package/dist/components/respArea/DragInTheBlank/DragInTheBlank.js +58 -0
- package/dist/components/respArea/DragInTheBlank/choice.d.ts +56 -0
- package/dist/components/respArea/DragInTheBlank/choice.js +156 -0
- package/dist/components/respArea/ExplicitConstructedResponse.d.ts +20 -0
- package/dist/components/respArea/ExplicitConstructedResponse.js +83 -0
- package/dist/components/respArea/InlineDropdown.d.ts +18 -0
- package/dist/components/respArea/InlineDropdown.js +119 -0
- package/dist/components/respArea/MathTemplated.d.ts +19 -0
- package/dist/components/respArea/MathTemplated.js +97 -0
- package/dist/components/respArea/ToolbarIcon.d.ts +14 -0
- package/dist/components/respArea/ToolbarIcon.js +17 -0
- package/dist/components/respArea/inlineDropdownUtils.d.ts +15 -0
- package/dist/components/respArea/inlineDropdownUtils.js +15 -0
- package/dist/constants.d.ts +13 -0
- package/dist/constants.js +4 -0
- package/dist/extensions/css.d.ts +11 -0
- package/dist/extensions/css.js +115 -0
- package/dist/extensions/custom-toolbar-wrapper.d.ts +11 -0
- package/dist/extensions/custom-toolbar-wrapper.js +61 -0
- package/dist/extensions/div-node.d.ts +10 -0
- package/dist/extensions/div-node.js +42 -0
- package/dist/extensions/ensure-empty-root-div.d.ts +14 -0
- package/dist/extensions/ensure-empty-root-div.js +24 -0
- package/dist/extensions/ensure-list-item-content-is-div.d.ts +15 -0
- package/dist/extensions/ensure-list-item-content-is-div.js +31 -0
- package/dist/extensions/extended-list-item.d.ts +13 -0
- package/dist/extensions/extended-list-item.js +5 -0
- package/dist/extensions/extended-table-cell.d.ts +10 -0
- package/dist/extensions/extended-table-cell.js +6 -0
- package/dist/extensions/extended-table.d.ts +17 -0
- package/dist/extensions/extended-table.js +34 -0
- package/dist/extensions/heading-paragraph.d.ts +17 -0
- package/dist/extensions/heading-paragraph.js +30 -0
- package/dist/extensions/image-component.d.ts +22 -0
- package/dist/extensions/image-component.js +220 -0
- package/dist/extensions/image.d.ts +10 -0
- package/dist/extensions/image.js +68 -0
- package/dist/extensions/index.d.ts +16 -0
- package/dist/extensions/index.js +64 -0
- package/dist/extensions/math.d.ts +15 -0
- package/dist/extensions/math.js +158 -0
- package/dist/extensions/media.d.ts +19 -0
- package/dist/extensions/media.js +149 -0
- package/dist/extensions/responseArea.d.ts +27 -0
- package/dist/extensions/responseArea.js +259 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +7 -0
- package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +16 -0
- package/dist/styles/editorContainerStyles.d.ts +134 -0
- package/dist/theme.d.ts +9 -0
- package/dist/utils/helper.d.ts +9 -0
- package/dist/utils/helper.js +27 -0
- package/dist/utils/size.d.ts +9 -0
- package/dist/utils/size.js +14 -0
- package/package.json +40 -24
- package/CHANGELOG.json +0 -32
- package/CHANGELOG.md +0 -2532
- package/LICENSE.md +0 -5
- package/lib/components/CharacterPicker.js +0 -201
- package/lib/components/CharacterPicker.js.map +0 -1
- package/lib/components/EditableHtml.js +0 -376
- package/lib/components/EditableHtml.js.map +0 -1
- package/lib/components/MenuBar.js +0 -696
- package/lib/components/MenuBar.js.map +0 -1
- package/lib/components/TiptapContainer.js +0 -234
- package/lib/components/TiptapContainer.js.map +0 -1
- package/lib/components/characters/characterUtils.js +0 -378
- package/lib/components/characters/characterUtils.js.map +0 -1
- package/lib/components/characters/custom-popper.js +0 -44
- package/lib/components/characters/custom-popper.js.map +0 -1
- package/lib/components/common/done-button.js +0 -34
- package/lib/components/common/done-button.js.map +0 -1
- package/lib/components/common/toolbar-buttons.js +0 -144
- package/lib/components/common/toolbar-buttons.js.map +0 -1
- package/lib/components/icons/CssIcon.js +0 -25
- package/lib/components/icons/CssIcon.js.map +0 -1
- package/lib/components/icons/RespArea.js +0 -72
- package/lib/components/icons/RespArea.js.map +0 -1
- package/lib/components/icons/TableIcons.js +0 -53
- package/lib/components/icons/TableIcons.js.map +0 -1
- package/lib/components/icons/TextAlign.js +0 -157
- package/lib/components/icons/TextAlign.js.map +0 -1
- package/lib/components/image/AltDialog.js +0 -98
- package/lib/components/image/AltDialog.js.map +0 -1
- package/lib/components/image/ImageToolbar.js +0 -137
- package/lib/components/image/ImageToolbar.js.map +0 -1
- package/lib/components/image/InsertImageHandler.js +0 -135
- package/lib/components/image/InsertImageHandler.js.map +0 -1
- package/lib/components/media/MediaDialog.js +0 -594
- package/lib/components/media/MediaDialog.js.map +0 -1
- package/lib/components/media/MediaToolbar.js +0 -74
- package/lib/components/media/MediaToolbar.js.map +0 -1
- package/lib/components/media/MediaWrapper.js +0 -67
- package/lib/components/media/MediaWrapper.js.map +0 -1
- package/lib/components/respArea/DragInTheBlank/DragInTheBlank.js +0 -84
- package/lib/components/respArea/DragInTheBlank/DragInTheBlank.js.map +0 -1
- package/lib/components/respArea/DragInTheBlank/choice.js +0 -250
- package/lib/components/respArea/DragInTheBlank/choice.js.map +0 -1
- package/lib/components/respArea/ExplicitConstructedResponse.js +0 -136
- package/lib/components/respArea/ExplicitConstructedResponse.js.map +0 -1
- package/lib/components/respArea/InlineDropdown.js +0 -209
- package/lib/components/respArea/InlineDropdown.js.map +0 -1
- package/lib/components/respArea/MathTemplated.js +0 -130
- package/lib/components/respArea/MathTemplated.js.map +0 -1
- package/lib/components/respArea/ToolbarIcon.js +0 -81
- package/lib/components/respArea/ToolbarIcon.js.map +0 -1
- package/lib/components/respArea/inlineDropdownUtils.js +0 -67
- package/lib/components/respArea/inlineDropdownUtils.js.map +0 -1
- package/lib/constants.js +0 -11
- package/lib/constants.js.map +0 -1
- package/lib/extensions/css.js +0 -217
- package/lib/extensions/css.js.map +0 -1
- package/lib/extensions/custom-toolbar-wrapper.js +0 -92
- package/lib/extensions/custom-toolbar-wrapper.js.map +0 -1
- package/lib/extensions/div-node.js +0 -83
- package/lib/extensions/div-node.js.map +0 -1
- package/lib/extensions/ensure-empty-root-div.js +0 -48
- package/lib/extensions/ensure-empty-root-div.js.map +0 -1
- package/lib/extensions/ensure-list-item-content-is-div.js +0 -64
- package/lib/extensions/ensure-list-item-content-is-div.js.map +0 -1
- package/lib/extensions/extended-list-item.js +0 -15
- package/lib/extensions/extended-list-item.js.map +0 -1
- package/lib/extensions/extended-table-cell.js +0 -22
- package/lib/extensions/extended-table-cell.js.map +0 -1
- package/lib/extensions/extended-table.js +0 -75
- package/lib/extensions/extended-table.js.map +0 -1
- package/lib/extensions/heading-paragraph.js +0 -61
- package/lib/extensions/heading-paragraph.js.map +0 -1
- package/lib/extensions/image-component.js +0 -348
- package/lib/extensions/image-component.js.map +0 -1
- package/lib/extensions/image.js +0 -134
- package/lib/extensions/image.js.map +0 -1
- package/lib/extensions/index.js +0 -46
- package/lib/extensions/index.js.map +0 -1
- package/lib/extensions/math.js +0 -342
- package/lib/extensions/math.js.map +0 -1
- package/lib/extensions/media.js +0 -243
- package/lib/extensions/media.js.map +0 -1
- package/lib/extensions/responseArea.js +0 -446
- package/lib/extensions/responseArea.js.map +0 -1
- package/lib/index.js +0 -37
- package/lib/index.js.map +0 -1
- package/lib/styles/editorContainerStyles.js +0 -137
- package/lib/styles/editorContainerStyles.js.map +0 -1
- package/lib/theme.js +0 -8
- package/lib/theme.js.map +0 -1
- package/lib/utils/helper.js +0 -73
- package/lib/utils/helper.js.map +0 -1
- package/lib/utils/size.js +0 -26
- package/lib/utils/size.js.map +0 -1
- package/src/__tests__/EditableHtml.test.jsx +0 -554
- package/src/__tests__/constants.test.js +0 -19
- package/src/__tests__/div-to-paragraph-conversion.test.jsx +0 -125
- package/src/__tests__/extensions.test.js +0 -208
- package/src/__tests__/index.test.jsx +0 -154
- package/src/__tests__/size-utils.test.js +0 -64
- package/src/__tests__/theme.test.js +0 -17
- package/src/components/CharacterPicker.jsx +0 -207
- package/src/components/EditableHtml.jsx +0 -440
- package/src/components/MenuBar.jsx +0 -554
- package/src/components/TiptapContainer.jsx +0 -219
- package/src/components/__tests__/AltDialog.test.jsx +0 -147
- package/src/components/__tests__/CharacterPicker.test.jsx +0 -261
- package/src/components/__tests__/CssIcon.test.jsx +0 -46
- package/src/components/__tests__/DragInTheBlank.test.jsx +0 -255
- package/src/components/__tests__/ExplicitConstructedResponse.test.jsx +0 -204
- package/src/components/__tests__/ImageToolbar.test.jsx +0 -128
- package/src/components/__tests__/InlineDropdown.test.jsx +0 -388
- package/src/components/__tests__/InsertImageHandler.test.js +0 -161
- package/src/components/__tests__/MediaDialog.test.jsx +0 -293
- package/src/components/__tests__/MediaToolbar.test.jsx +0 -74
- package/src/components/__tests__/MediaWrapper.test.jsx +0 -81
- package/src/components/__tests__/MenuBar.test.jsx +0 -250
- package/src/components/__tests__/RespArea.test.jsx +0 -122
- package/src/components/__tests__/TableIcons.test.jsx +0 -149
- package/src/components/__tests__/TextAlign.test.jsx +0 -167
- package/src/components/__tests__/TiptapContainer.test.jsx +0 -138
- package/src/components/__tests__/characterUtils.test.js +0 -166
- package/src/components/__tests__/choice.test.jsx +0 -171
- package/src/components/__tests__/custom-popper.test.jsx +0 -82
- package/src/components/__tests__/done-button.test.jsx +0 -54
- package/src/components/__tests__/toolbar-buttons.test.jsx +0 -234
- package/src/components/characters/characterUtils.js +0 -447
- package/src/components/characters/custom-popper.js +0 -38
- package/src/components/common/done-button.jsx +0 -27
- package/src/components/common/toolbar-buttons.jsx +0 -122
- package/src/components/icons/CssIcon.jsx +0 -15
- package/src/components/icons/RespArea.jsx +0 -71
- package/src/components/icons/TableIcons.jsx +0 -52
- package/src/components/icons/TextAlign.jsx +0 -114
- package/src/components/image/AltDialog.jsx +0 -82
- package/src/components/image/ImageToolbar.jsx +0 -99
- package/src/components/image/InsertImageHandler.js +0 -107
- package/src/components/media/MediaDialog.jsx +0 -596
- package/src/components/media/MediaToolbar.jsx +0 -49
- package/src/components/media/MediaWrapper.jsx +0 -39
- package/src/components/respArea/DragInTheBlank/DragInTheBlank.jsx +0 -76
- package/src/components/respArea/DragInTheBlank/choice.jsx +0 -256
- package/src/components/respArea/ExplicitConstructedResponse.jsx +0 -135
- package/src/components/respArea/InlineDropdown.jsx +0 -220
- package/src/components/respArea/MathTemplated.jsx +0 -124
- package/src/components/respArea/ToolbarIcon.jsx +0 -66
- package/src/components/respArea/__tests__/MathTemplated.test.jsx +0 -210
- package/src/components/respArea/inlineDropdownUtils.js +0 -79
- package/src/constants.js +0 -5
- package/src/extensions/__tests__/css.test.js +0 -196
- package/src/extensions/__tests__/custom-toolbar-wrapper.test.jsx +0 -180
- package/src/extensions/__tests__/divNode.test.js +0 -87
- package/src/extensions/__tests__/ensure-empty-root-div.test.js +0 -57
- package/src/extensions/__tests__/ensure-list-item-content-is-div.test.js +0 -44
- package/src/extensions/__tests__/extended-list-item.test.js +0 -13
- package/src/extensions/__tests__/extended-table-cell.test.js +0 -22
- package/src/extensions/__tests__/extended-table.test.js +0 -183
- package/src/extensions/__tests__/image-component.test.jsx +0 -345
- package/src/extensions/__tests__/image.test.js +0 -237
- package/src/extensions/__tests__/math.test.js +0 -603
- package/src/extensions/__tests__/media-node-view.test.jsx +0 -298
- package/src/extensions/__tests__/media.test.js +0 -271
- package/src/extensions/__tests__/responseArea.test.js +0 -601
- package/src/extensions/css.js +0 -220
- package/src/extensions/custom-toolbar-wrapper.jsx +0 -78
- package/src/extensions/div-node.js +0 -86
- package/src/extensions/ensure-empty-root-div.js +0 -47
- package/src/extensions/ensure-list-item-content-is-div.js +0 -62
- package/src/extensions/extended-list-item.js +0 -10
- package/src/extensions/extended-table-cell.js +0 -19
- package/src/extensions/extended-table.js +0 -60
- package/src/extensions/heading-paragraph.js +0 -53
- package/src/extensions/image-component.jsx +0 -338
- package/src/extensions/image.js +0 -109
- package/src/extensions/index.js +0 -81
- package/src/extensions/math.js +0 -326
- package/src/extensions/media.js +0 -188
- package/src/extensions/responseArea.js +0 -401
- package/src/index.jsx +0 -5
- package/src/styles/editorContainerStyles.js +0 -145
- package/src/theme.js +0 -1
- package/src/utils/__tests__/helper.test.js +0 -126
- package/src/utils/helper.js +0 -69
- package/src/utils/size.js +0 -32
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
var _renderUi = require("@pie-lib/render-ui");
|
|
8
|
-
var styles = function styles(theme) {
|
|
9
|
-
return {
|
|
10
|
-
root: {
|
|
11
|
-
position: 'relative',
|
|
12
|
-
padding: '0px',
|
|
13
|
-
border: '1px solid #ccc',
|
|
14
|
-
borderRadius: '4px',
|
|
15
|
-
cursor: 'text',
|
|
16
|
-
'& [data-slate-editor="true"]': {
|
|
17
|
-
wordBreak: 'break-word',
|
|
18
|
-
overflow: 'visible',
|
|
19
|
-
maxHeight: '500px',
|
|
20
|
-
// needed in order to be able to put the focus before a void element when it is the first one in the editor
|
|
21
|
-
padding: '5px'
|
|
22
|
-
},
|
|
23
|
-
'&:first-child': {
|
|
24
|
-
marginTop: 0
|
|
25
|
-
},
|
|
26
|
-
'& ul, & ol': {
|
|
27
|
-
padding: '0 1rem',
|
|
28
|
-
margin: '1.25rem 1rem 1.25rem 0.4rem'
|
|
29
|
-
},
|
|
30
|
-
'& ul li p, & ol li p': {
|
|
31
|
-
marginTop: '0.25em',
|
|
32
|
-
marginBottom: '0.25em'
|
|
33
|
-
},
|
|
34
|
-
'& h1, & h2, & h3, & h4, & h5, & h6': {
|
|
35
|
-
lineHeight: 1.1,
|
|
36
|
-
marginTop: '2.5rem',
|
|
37
|
-
textWrap: 'pretty'
|
|
38
|
-
},
|
|
39
|
-
'& h1, & h2': {
|
|
40
|
-
marginTop: '3.5rem',
|
|
41
|
-
marginBottom: '1.5rem'
|
|
42
|
-
},
|
|
43
|
-
'& h1': {
|
|
44
|
-
fontSize: '1.4rem'
|
|
45
|
-
},
|
|
46
|
-
'& h2': {
|
|
47
|
-
fontSize: '1.2rem'
|
|
48
|
-
},
|
|
49
|
-
'& h3': {
|
|
50
|
-
fontSize: '1.1rem'
|
|
51
|
-
},
|
|
52
|
-
'& h4, & h5, & h6': {
|
|
53
|
-
fontSize: '1rem'
|
|
54
|
-
},
|
|
55
|
-
'& code': {
|
|
56
|
-
backgroundColor: 'var(--purple-light)',
|
|
57
|
-
borderRadius: '0.4rem',
|
|
58
|
-
color: 'var(--black)',
|
|
59
|
-
fontSize: '0.85rem',
|
|
60
|
-
padding: '0.25em 0.3em'
|
|
61
|
-
},
|
|
62
|
-
'& pre': {
|
|
63
|
-
background: 'var(--black)',
|
|
64
|
-
borderRadius: '0.5rem',
|
|
65
|
-
color: 'var(--white)',
|
|
66
|
-
fontFamily: '\'JetBrainsMono\', monospace',
|
|
67
|
-
margin: '1.5rem 0',
|
|
68
|
-
padding: '0.75rem 1rem',
|
|
69
|
-
'& code': {
|
|
70
|
-
background: 'none',
|
|
71
|
-
color: 'inherit',
|
|
72
|
-
fontSize: '0.8rem',
|
|
73
|
-
padding: 0
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
'& blockquote': {
|
|
77
|
-
background: '#f9f9f9',
|
|
78
|
-
borderLeft: '5px solid #ccc',
|
|
79
|
-
margin: '1.5em 10px',
|
|
80
|
-
padding: '.5em 10px'
|
|
81
|
-
},
|
|
82
|
-
'& hr': {
|
|
83
|
-
border: 'none',
|
|
84
|
-
borderTop: '1px solid var(--gray-2)',
|
|
85
|
-
margin: '2rem 0'
|
|
86
|
-
},
|
|
87
|
-
'& table': {
|
|
88
|
-
tableLayout: 'fixed',
|
|
89
|
-
width: '100%',
|
|
90
|
-
borderCollapse: 'collapse',
|
|
91
|
-
color: _renderUi.color.text(),
|
|
92
|
-
backgroundColor: _renderUi.color.background()
|
|
93
|
-
},
|
|
94
|
-
'& table:not([border="1"]) tr': {
|
|
95
|
-
borderTop: '1px solid #dfe2e5'
|
|
96
|
-
},
|
|
97
|
-
'& td, th': {
|
|
98
|
-
padding: '.6em 1em',
|
|
99
|
-
textAlign: 'center'
|
|
100
|
-
},
|
|
101
|
-
'& table:not([border="1"]) td, th': {
|
|
102
|
-
border: '1px solid #dfe2e5'
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
children: {
|
|
106
|
-
padding: '10px 16px'
|
|
107
|
-
},
|
|
108
|
-
editorHolder: {
|
|
109
|
-
position: 'relative',
|
|
110
|
-
padding: '0px',
|
|
111
|
-
overflowY: 'auto',
|
|
112
|
-
color: _renderUi.color.text(),
|
|
113
|
-
backgroundColor: _renderUi.color.background()
|
|
114
|
-
},
|
|
115
|
-
disabledScrollbar: {
|
|
116
|
-
'&::-webkit-scrollbar': {
|
|
117
|
-
display: 'none'
|
|
118
|
-
},
|
|
119
|
-
scrollbarWidth: 'none',
|
|
120
|
-
'-ms-overflow-style': 'none'
|
|
121
|
-
},
|
|
122
|
-
error: {
|
|
123
|
-
border: "2px solid ".concat(theme.palette.error.main, " !important")
|
|
124
|
-
},
|
|
125
|
-
noBorder: {
|
|
126
|
-
border: 'none'
|
|
127
|
-
},
|
|
128
|
-
noPadding: {
|
|
129
|
-
padding: 0
|
|
130
|
-
},
|
|
131
|
-
toolbarOnTop: {
|
|
132
|
-
marginTop: '45px'
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
};
|
|
136
|
-
var _default = exports["default"] = styles;
|
|
137
|
-
//# sourceMappingURL=editorContainerStyles.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"editorContainerStyles.js","names":["_renderUi","require","styles","theme","root","position","padding","border","borderRadius","cursor","wordBreak","overflow","maxHeight","marginTop","margin","marginBottom","lineHeight","textWrap","fontSize","backgroundColor","color","background","fontFamily","borderLeft","borderTop","tableLayout","width","borderCollapse","text","textAlign","children","editorHolder","overflowY","disabledScrollbar","display","scrollbarWidth","error","concat","palette","main","noBorder","noPadding","toolbarOnTop","_default","exports"],"sources":["../../src/styles/editorContainerStyles.js"],"sourcesContent":["import { color } from '@pie-lib/render-ui';\n\nconst styles = (theme) => ({\n root: {\n position: 'relative',\n padding: '0px',\n border: '1px solid #ccc',\n borderRadius: '4px',\n cursor: 'text',\n '& [data-slate-editor=\"true\"]': {\n wordBreak: 'break-word',\n overflow: 'visible',\n maxHeight: '500px',\n // needed in order to be able to put the focus before a void element when it is the first one in the editor\n padding: '5px',\n },\n\n '&:first-child': {\n marginTop: 0,\n },\n\n '& ul, & ol': {\n padding: '0 1rem',\n margin: '1.25rem 1rem 1.25rem 0.4rem',\n },\n\n '& ul li p, & ol li p': {\n marginTop: '0.25em',\n marginBottom: '0.25em',\n },\n\n '& h1, & h2, & h3, & h4, & h5, & h6': {\n lineHeight: 1.1,\n marginTop: '2.5rem',\n textWrap: 'pretty',\n },\n\n '& h1, & h2': {\n marginTop: '3.5rem',\n marginBottom: '1.5rem',\n },\n\n '& h1': {\n fontSize: '1.4rem',\n },\n\n '& h2': {\n fontSize: '1.2rem',\n },\n\n '& h3': {\n fontSize: '1.1rem',\n },\n\n '& h4, & h5, & h6': {\n fontSize: '1rem',\n },\n\n '& code': {\n backgroundColor: 'var(--purple-light)',\n borderRadius: '0.4rem',\n color: 'var(--black)',\n fontSize: '0.85rem',\n padding: '0.25em 0.3em',\n },\n\n '& pre': {\n background: 'var(--black)',\n borderRadius: '0.5rem',\n color: 'var(--white)',\n fontFamily: '\\'JetBrainsMono\\', monospace',\n margin: '1.5rem 0',\n padding: '0.75rem 1rem',\n\n '& code': {\n background: 'none',\n color: 'inherit',\n fontSize: '0.8rem',\n padding: 0,\n },\n },\n\n '& blockquote': {\n background: '#f9f9f9',\n borderLeft: '5px solid #ccc',\n margin: '1.5em 10px',\n padding: '.5em 10px',\n },\n\n '& hr': {\n border: 'none',\n borderTop: '1px solid var(--gray-2)',\n margin: '2rem 0',\n },\n\n '& table': {\n tableLayout: 'fixed',\n width: '100%',\n borderCollapse: 'collapse',\n color: color.text(),\n backgroundColor: color.background(),\n },\n '& table:not([border=\"1\"]) tr': {\n borderTop: '1px solid #dfe2e5',\n },\n '& td, th': {\n padding: '.6em 1em',\n textAlign: 'center',\n },\n '& table:not([border=\"1\"]) td, th': {\n border: '1px solid #dfe2e5',\n },\n },\n children: {\n padding: '10px 16px',\n },\n editorHolder: {\n position: 'relative',\n padding: '0px',\n overflowY: 'auto',\n color: color.text(),\n backgroundColor: color.background(),\n },\n disabledScrollbar: {\n '&::-webkit-scrollbar': {\n display: 'none',\n },\n scrollbarWidth: 'none',\n '-ms-overflow-style': 'none',\n },\n error: {\n border: `2px solid ${theme.palette.error.main} !important`,\n },\n noBorder: {\n border: 'none',\n },\n noPadding: {\n padding: 0,\n },\n toolbarOnTop: {\n marginTop: '45px',\n },\n});\n\nexport default styles;\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AAEA,IAAMC,MAAM,GAAG,SAATA,MAAMA,CAAIC,KAAK;EAAA,OAAM;IACzBC,IAAI,EAAE;MACJC,QAAQ,EAAE,UAAU;MACpBC,OAAO,EAAE,KAAK;MACdC,MAAM,EAAE,gBAAgB;MACxBC,YAAY,EAAE,KAAK;MACnBC,MAAM,EAAE,MAAM;MACd,8BAA8B,EAAE;QAC9BC,SAAS,EAAE,YAAY;QACvBC,QAAQ,EAAE,SAAS;QACnBC,SAAS,EAAE,OAAO;QAClB;QACAN,OAAO,EAAE;MACX,CAAC;MAED,eAAe,EAAE;QACfO,SAAS,EAAE;MACb,CAAC;MAED,YAAY,EAAE;QACZP,OAAO,EAAE,QAAQ;QACjBQ,MAAM,EAAE;MACV,CAAC;MAED,sBAAsB,EAAE;QACtBD,SAAS,EAAE,QAAQ;QACnBE,YAAY,EAAE;MAChB,CAAC;MAED,oCAAoC,EAAE;QACpCC,UAAU,EAAE,GAAG;QACfH,SAAS,EAAE,QAAQ;QACnBI,QAAQ,EAAE;MACZ,CAAC;MAED,YAAY,EAAE;QACZJ,SAAS,EAAE,QAAQ;QACnBE,YAAY,EAAE;MAChB,CAAC;MAED,MAAM,EAAE;QACNG,QAAQ,EAAE;MACZ,CAAC;MAED,MAAM,EAAE;QACNA,QAAQ,EAAE;MACZ,CAAC;MAED,MAAM,EAAE;QACNA,QAAQ,EAAE;MACZ,CAAC;MAED,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;MACd0B,SAAS,EAAE,MAAM;MACjBZ,KAAK,EAAEA,eAAK,CAACQ,IAAI,CAAC,CAAC;MACnBT,eAAe,EAAEC,eAAK,CAACC,UAAU,CAAC;IACpC,CAAC;IACDY,iBAAiB,EAAE;MACjB,sBAAsB,EAAE;QACtBC,OAAO,EAAE;MACX,CAAC;MACDC,cAAc,EAAE,MAAM;MACtB,oBAAoB,EAAE;IACxB,CAAC;IACDC,KAAK,EAAE;MACL7B,MAAM,eAAA8B,MAAA,CAAelC,KAAK,CAACmC,OAAO,CAACF,KAAK,CAACG,IAAI;IAC/C,CAAC;IACDC,QAAQ,EAAE;MACRjC,MAAM,EAAE;IACV,CAAC;IACDkC,SAAS,EAAE;MACTnC,OAAO,EAAE;IACX,CAAC;IACDoC,YAAY,EAAE;MACZ7B,SAAS,EAAE;IACb;EACF,CAAC;AAAA,CAAC;AAAC,IAAA8B,QAAA,GAAAC,OAAA,cAEY1C,MAAM","ignoreList":[]}
|
package/lib/theme.js
DELETED
package/lib/theme.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"theme.js","names":["primary","exports"],"sources":["../src/theme.js"],"sourcesContent":["export const primary = '#304ffe';\n"],"mappings":";;;;;;AAAO,IAAMA,OAAO,GAAAC,OAAA,CAAAD,OAAA,GAAG,SAAS","ignoreList":[]}
|
package/lib/utils/helper.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.normalizeInitialMarkup = void 0;
|
|
7
|
-
var escapeHtml = function escapeHtml(str) {
|
|
8
|
-
return String(str).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''');
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Converts consecutive div elements into a single paragraph with line breaks.
|
|
13
|
-
* Example: "<div>A</div><div>B</div>" becomes "<p>A<br>B</p>"
|
|
14
|
-
*/
|
|
15
|
-
var convertConsecutiveDivsToParagraph = function convertConsecutiveDivsToParagraph(html) {
|
|
16
|
-
// Create a temporary element to parse the HTML
|
|
17
|
-
var temp = document.createElement('div');
|
|
18
|
-
temp.innerHTML = html;
|
|
19
|
-
|
|
20
|
-
// Get all top-level children
|
|
21
|
-
var children = Array.from(temp.children);
|
|
22
|
-
|
|
23
|
-
// Only convert if there are 2 or more divs
|
|
24
|
-
if (children.length < 2) {
|
|
25
|
-
return html;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// Check if all children are divs with simple content (text or inline elements)
|
|
29
|
-
var allDivs = children.every(function (child) {
|
|
30
|
-
return child.tagName === 'DIV';
|
|
31
|
-
});
|
|
32
|
-
if (!allDivs) {
|
|
33
|
-
return html;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// Check if divs have no attributes (only convert plain divs)
|
|
37
|
-
var hasNoAttributes = children.every(function (div) {
|
|
38
|
-
return div.attributes.length === 0;
|
|
39
|
-
});
|
|
40
|
-
if (!hasNoAttributes) {
|
|
41
|
-
return html;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// Check if divs contain only simple content (no nested block elements)
|
|
45
|
-
var hasOnlySimpleContent = children.every(function (div) {
|
|
46
|
-
return Array.from(div.children).every(function (child) {
|
|
47
|
-
var tag = child.tagName;
|
|
48
|
-
// Allow inline elements and br tags
|
|
49
|
-
return ['SPAN', 'B', 'I', 'EM', 'STRONG', 'U', 'SUB', 'SUP', 'A', 'CODE', 'BR'].includes(tag);
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
if (!hasOnlySimpleContent) {
|
|
53
|
-
return html;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// Convert to paragraph with br tags
|
|
57
|
-
var contents = children.map(function (div) {
|
|
58
|
-
return div.innerHTML;
|
|
59
|
-
});
|
|
60
|
-
return "<p>".concat(contents.join('<br>'), "</p>");
|
|
61
|
-
};
|
|
62
|
-
var normalizeInitialMarkup = exports.normalizeInitialMarkup = function normalizeInitialMarkup(markup) {
|
|
63
|
-
var trimmed = String(markup !== null && markup !== void 0 ? markup : '').trim();
|
|
64
|
-
if (!trimmed) return '<div></div>';
|
|
65
|
-
var looksLikeHtml = /<[^>]+>/.test(trimmed);
|
|
66
|
-
if (!looksLikeHtml) {
|
|
67
|
-
return "<div>".concat(escapeHtml(trimmed), "</div>");
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// Apply the div-to-paragraph transformation
|
|
71
|
-
return convertConsecutiveDivsToParagraph(trimmed);
|
|
72
|
-
};
|
|
73
|
-
//# sourceMappingURL=helper.js.map
|
package/lib/utils/helper.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helper.js","names":["escapeHtml","str","String","replace","convertConsecutiveDivsToParagraph","html","temp","document","createElement","innerHTML","children","Array","from","length","allDivs","every","child","tagName","hasNoAttributes","div","attributes","hasOnlySimpleContent","tag","includes","contents","map","concat","join","normalizeInitialMarkup","exports","markup","trimmed","trim","looksLikeHtml","test"],"sources":["../../src/utils/helper.js"],"sourcesContent":["const escapeHtml = (str) =>\n String(str)\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''');\n\n/**\n * Converts consecutive div elements into a single paragraph with line breaks.\n * Example: \"<div>A</div><div>B</div>\" becomes \"<p>A<br>B</p>\"\n */\nconst convertConsecutiveDivsToParagraph = (html) => {\n // Create a temporary element to parse the HTML\n const temp = document.createElement('div');\n temp.innerHTML = html;\n\n // Get all top-level children\n const children = Array.from(temp.children);\n\n // Only convert if there are 2 or more divs\n if (children.length < 2) {\n return html;\n }\n\n // Check if all children are divs with simple content (text or inline elements)\n const allDivs = children.every((child) => child.tagName === 'DIV');\n\n if (!allDivs) {\n return html;\n }\n\n // Check if divs have no attributes (only convert plain divs)\n const hasNoAttributes = children.every((div) => div.attributes.length === 0);\n\n if (!hasNoAttributes) {\n return html;\n }\n\n // Check if divs contain only simple content (no nested block elements)\n const hasOnlySimpleContent = children.every((div) => {\n return Array.from(div.children).every((child) => {\n const tag = child.tagName;\n // Allow inline elements and br tags\n return ['SPAN', 'B', 'I', 'EM', 'STRONG', 'U', 'SUB', 'SUP', 'A', 'CODE', 'BR'].includes(tag);\n });\n });\n\n if (!hasOnlySimpleContent) {\n return html;\n }\n\n // Convert to paragraph with br tags\n const contents = children.map((div) => div.innerHTML);\n return `<p>${contents.join('<br>')}</p>`;\n};\n\nexport const normalizeInitialMarkup = (markup) => {\n const trimmed = String(markup ?? '').trim();\n if (!trimmed) return '<div></div>';\n\n const looksLikeHtml = /<[^>]+>/.test(trimmed);\n if (!looksLikeHtml) {\n return `<div>${escapeHtml(trimmed)}</div>`;\n }\n\n // Apply the div-to-paragraph transformation\n return convertConsecutiveDivsToParagraph(trimmed);\n};\n"],"mappings":";;;;;;AAAA,IAAMA,UAAU,GAAG,SAAbA,UAAUA,CAAIC,GAAG;EAAA,OACrBC,MAAM,CAACD,GAAG,CAAC,CACRE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CACtBA,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CACrBA,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CACrBA,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CACvBA,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;AAAA;;AAE3B;AACA;AACA;AACA;AACA,IAAMC,iCAAiC,GAAG,SAApCA,iCAAiCA,CAAIC,IAAI,EAAK;EAClD;EACA,IAAMC,IAAI,GAAGC,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;EAC1CF,IAAI,CAACG,SAAS,GAAGJ,IAAI;;EAErB;EACA,IAAMK,QAAQ,GAAGC,KAAK,CAACC,IAAI,CAACN,IAAI,CAACI,QAAQ,CAAC;;EAE1C;EACA,IAAIA,QAAQ,CAAC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O,GAAG7B,MAAM,CAAC4B,MAAM,aAANA,MAAM,cAANA,MAAM,GAAI,EAAE,CAAC,CAACE,IAAI,CAAC,CAAC;EAC3C,IAAI,CAACD,OAAO,EAAE,OAAO,aAAa;EAElC,IAAME,aAAa,GAAG,SAAS,CAACC,IAAI,CAACH,OAAO,CAAC;EAC7C,IAAI,CAACE,aAAa,EAAE;IAClB,eAAAP,MAAA,CAAe1B,UAAU,CAAC+B,OAAO,CAAC;EACpC;;EAEA;EACA,OAAO3B,iCAAiC,CAAC2B,OAAO,CAAC;AACnD,CAAC","ignoreList":[]}
|
package/lib/utils/size.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.valueToSize = void 0;
|
|
7
|
-
var valueToSize = exports.valueToSize = function valueToSize(v) {
|
|
8
|
-
if (!v) {
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
var calcRegex = /^calc\((.*)\)$/;
|
|
12
|
-
if (typeof v === 'string') {
|
|
13
|
-
if (v.endsWith('%')) {
|
|
14
|
-
return undefined;
|
|
15
|
-
}
|
|
16
|
-
if (v.endsWith('px') || v.endsWith('vh') || v.endsWith('vw') || v.endsWith('ch') || v.endsWith('em') || v.match(calcRegex)) {
|
|
17
|
-
return v;
|
|
18
|
-
}
|
|
19
|
-
var value = parseInt(v, 10);
|
|
20
|
-
return Number.isNaN(value) ? value : "".concat(value, "px");
|
|
21
|
-
}
|
|
22
|
-
if (typeof v === 'number') {
|
|
23
|
-
return "".concat(v, "px");
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
//# sourceMappingURL=size.js.map
|
package/lib/utils/size.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"size.js","names":["valueToSize","exports","v","calcRegex","endsWith","undefined","match","value","parseInt","Number","isNaN","concat"],"sources":["../../src/utils/size.js"],"sourcesContent":["export const valueToSize = (v) => {\n if (!v) {\n return;\n }\n\n const calcRegex = /^calc\\((.*)\\)$/;\n\n if (typeof v === 'string') {\n if (v.endsWith('%')) {\n return undefined;\n }\n\n if (\n v.endsWith('px') ||\n v.endsWith('vh') ||\n v.endsWith('vw') ||\n v.endsWith('ch') ||\n v.endsWith('em') ||\n v.match(calcRegex)\n ) {\n return v;\n }\n\n const value = parseInt(v, 10);\n\n return Number.isNaN(value) ? value : `${value}px`;\n }\n\n if (typeof v === 'number') {\n return `${v}px`;\n }\n};\n"],"mappings":";;;;;;AAAO,IAAMA,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAG,SAAdA,WAAWA,CAAIE,CAAC,EAAK;EAChC,IAAI,CAACA,CAAC,EAAE;IACN;EACF;EAEA,IAAMC,SAAS,GAAG,gBAAgB;EAElC,IAAI,OAAOD,CAAC,KAAK,QAAQ,EAAE;IACzB,IAAIA,CAAC,CAACE,QAAQ,CAAC,GAAG,CAAC,EAAE;MACnB,OAAOC,SAAS;IAClB;IAEA,IACEH,CAAC,CAACE,QAAQ,CAAC,IAAI,CAAC,IAChBF,CAAC,CAACE,QAAQ,CAAC,IAAI,CAAC,IAChBF,CAAC,CAACE,QAAQ,CAAC,IAAI,CAAC,IAChBF,CAAC,CAACE,QAAQ,CAAC,IAAI,CAAC,IAChBF,CAAC,CAACE,QAAQ,CAAC,IAAI,CAAC,IAChBF,CAAC,CAACI,KAAK,CAACH,SAAS,CAAC,EAClB;MACA,OAAOD,CAAC;IACV;IAEA,IAAMK,KAAK,GAAGC,QAAQ,CAACN,CAAC,EAAE,EAAE,CAAC;IAE7B,OAAOO,MAAM,CAACC,KAAK,CAACH,KAAK,CAAC,GAAGA,KAAK,MAAAI,MAAA,CAAMJ,KAAK,OAAI;EACnD;EAEA,IAAI,OAAOL,CAAC,KAAK,QAAQ,EAAE;IACzB,UAAAS,MAAA,CAAUT,CAAC;EACb;AACF,CAAC","ignoreList":[]}
|