@blocklet/editor 2.0.17 → 2.0.18

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/lib/main/index.js CHANGED
@@ -46,6 +46,7 @@ function EditorShell({ placeholder, children, editable, onChange, autoFocus, sho
46
46
  return (_jsx(EditorRoot, { ...props, className: cx(props.className, 'be-shell'), ref: shellRef, onClick: onShellClick, children: _jsx(Editor, { onChange: onChange, placeholder: placeholder, autoFocus: autoFocus, showToolbar: showToolbar, editorRef: editorRef, onReady: onReady, enableHeadingsIdPlugin: enableHeadingsIdPlugin, children: children }) }));
47
47
  }
48
48
  const EditorRoot = styled.div `
49
+ container: blocklet-editor / inline-size;
49
50
  margin: 0 auto;
50
51
  border-radius: 4px;
51
52
  position: relative;
@@ -20,5 +20,5 @@ export default function ColorPickerButton({ editor }) {
20
20
  const onBgColorSelect = useCallback((value) => {
21
21
  applyStyleText({ 'background-color': value });
22
22
  }, [applyStyleText]);
23
- return (_jsxs(_Fragment, { children: [_jsx(ColorPicker, { buttonClassName: "popup-item spaced", buttonAriaLabel: "Formatting text color", buttonIconClassName: "iconify", buttonIconData: "mdi:format-color-text", color: fontColor, onChange: onFontColorSelect, title: "text color" }), _jsx(ColorPicker, { buttonClassName: "popup-item spaced", buttonAriaLabel: "Formatting background color", buttonIconClassName: "iconify", buttonIconData: "mdi:format-color-fill", color: bgColor, onChange: onBgColorSelect, title: "bg color" })] }));
23
+ return (_jsxs(_Fragment, { children: [_jsx(ColorPicker, { buttonClassName: "popup-item spaced popup-item-color", buttonAriaLabel: "Formatting text color", buttonIconClassName: "iconify", buttonIconData: "mdi:format-color-text", color: fontColor, onChange: onFontColorSelect, title: "text color" }), _jsx(ColorPicker, { buttonClassName: "popup-item spaced popup-item-background", buttonAriaLabel: "Formatting background color", buttonIconClassName: "iconify", buttonIconData: "mdi:format-color-fill", color: bgColor, onChange: onBgColorSelect, title: "bg color" })] }));
24
24
  }
@@ -1,3 +1,13 @@
1
+ @container blocklet-editor (max-width: 700px) {
2
+ .floating-text-format-popup .popup-item-subscript,
3
+ .floating-text-format-popup .popup-item-superscript,
4
+ .floating-text-format-popup .popup-item-strikethrough,
5
+ .floating-text-format-popup .popup-item-color,
6
+ .floating-text-format-popup .popup-item-background {
7
+ display: none !important;
8
+ }
9
+ }
10
+
1
11
  .floating-text-format-popup {
2
12
  display: flex;
3
13
  background: #fff;
@@ -106,11 +106,11 @@ function TextFormatFloatingToolbar({ editor, anchorElem, isLink, isBold, isItali
106
106
  editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'underline');
107
107
  }, className: `popup-item spaced ${isUnderline ? 'active' : ''}`, "aria-label": "Format text to underlined", children: _jsx("i", { className: "iconify", "data-icon": "mdi:format-underline" }) }), _jsx("button", { onClick: () => {
108
108
  editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'strikethrough');
109
- }, className: `popup-item spaced ${isStrikethrough ? 'active' : ''}`, "aria-label": "Format text with a strikethrough", children: _jsx("i", { className: "iconify", "data-icon": "mdi:format-strikethrough-variant" }) }), _jsx("button", { onClick: () => {
109
+ }, className: `popup-item spaced popup-item-strikethrough ${isStrikethrough ? 'active' : ''}`, "aria-label": "Format text with a strikethrough", children: _jsx("i", { className: "iconify", "data-icon": "mdi:format-strikethrough-variant" }) }), _jsx("button", { onClick: () => {
110
110
  editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'subscript');
111
- }, className: `popup-item spaced ${isSubscript ? 'active' : ''}`, title: "Subscript", "aria-label": "Format Subscript", children: _jsx("i", { className: "iconify", "data-icon": "mdi:format-subscript" }) }), _jsx("button", { onClick: () => {
111
+ }, className: `popup-item spaced popup-item-subscript ${isSubscript ? 'active' : ''}`, title: "Subscript", "aria-label": "Format Subscript", children: _jsx("i", { className: "iconify", "data-icon": "mdi:format-subscript" }) }), _jsx("button", { onClick: () => {
112
112
  editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'superscript');
113
- }, className: `popup-item spaced ${isSuperscript ? 'active' : ''}`, title: "Superscript", "aria-label": "Format Superscript", children: _jsx("i", { className: "iconify", "data-icon": "mdi:format-superscript" }) }), _jsx("button", { onClick: () => {
113
+ }, className: `popup-item spaced popup-item-superscript ${isSuperscript ? 'active' : ''}`, title: "Superscript", "aria-label": "Format Superscript", children: _jsx("i", { className: "iconify", "data-icon": "mdi:format-superscript" }) }), _jsx("button", { onClick: () => {
114
114
  editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'code');
115
115
  }, className: `popup-item spaced ${isCode ? 'active' : ''}`, "aria-label": "Insert code block", children: _jsx("i", { className: "iconify", "data-icon": "mdi:code-tags" }) }), _jsx("button", { onClick: insertLink, className: `popup-item spaced ${isLink ? 'active' : ''}`, "aria-label": "Insert link", children: _jsx("i", { className: "iconify", "data-icon": "mdi:link" }) }), _jsx(ColorPickerButton, { editor: editor })] })) }));
116
116
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/editor",
3
- "version": "2.0.17",
3
+ "version": "2.0.18",
4
4
  "main": "lib/index.js",
5
5
  "scripts": {
6
6
  "dev": "npm run storybook",
@@ -40,7 +40,7 @@
40
40
  "@arcblock/ux": "^2.9.91",
41
41
  "@blocklet/embed": "^0.1.11",
42
42
  "@blocklet/pages-kit": "^0.2.341",
43
- "@blocklet/pdf": "2.0.17",
43
+ "@blocklet/pdf": "2.0.18",
44
44
  "@excalidraw/excalidraw": "^0.14.2",
45
45
  "@iconify/iconify": "^3.0.1",
46
46
  "@iconify/icons-tabler": "^1.2.95",
@@ -113,5 +113,5 @@
113
113
  "react": "*",
114
114
  "react-dom": "*"
115
115
  },
116
- "gitHead": "6eeb5984c09bd06431ddb4f0350996430da6fb98"
116
+ "gitHead": "ee0ea5afb368e3a44e89c52ca263b6e3f1d2a1e8"
117
117
  }