@blocklet/editor 2.3.37 → 2.3.39

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.
@@ -439,7 +439,6 @@ i.prettier-error {
439
439
  z-index: 10001;
440
440
  display: block;
441
441
  position: fixed;
442
- box-shadow: 0 1px rgb(0 0 0 / 0.05);
443
442
  border-radius: 8px;
444
443
  min-height: 40px;
445
444
  }
@@ -500,7 +499,6 @@ i.prettier-error {
500
499
 
501
500
  .dropdown .divider {
502
501
  width: auto;
503
- background-color: #eee;
504
502
  margin: 4px 8px;
505
503
  height: 1px;
506
504
  }
@@ -10,7 +10,7 @@ import { $getSelectionStyleValueForProperty, $isParentElementRTL, $patchStyleTex
10
10
  import { $findMatchingParent, $getNearestBlockElementAncestorOrThrow, $getNearestNodeOfType, mergeRegister, } from '@lexical/utils';
11
11
  import { $createParagraphNode, $getNodeByKey, $getSelection, $isRangeSelection, $isRootOrShadowRoot, $isTextNode, CAN_REDO_COMMAND, CAN_UNDO_COMMAND, COMMAND_PRIORITY_CRITICAL, FORMAT_ELEMENT_COMMAND, FORMAT_TEXT_COMMAND, INDENT_CONTENT_COMMAND, OUTDENT_CONTENT_COMMAND, SELECTION_CHANGE_COMMAND, } from 'lexical';
12
12
  import { useCallback, useEffect, useState } from 'react';
13
- import { Box } from '@mui/material';
13
+ import { Box, useTheme } from '@mui/material';
14
14
  import { useEditorConfig } from '../../../config';
15
15
  import { IS_APPLE } from '../../../shared/environment';
16
16
  import useHasNodes from '../../hooks/useHasNodes';
@@ -136,7 +136,8 @@ function BlockFormatDropDown({ editor, blockType, disabled = false, }) {
136
136
  return (_jsxs(DropDown, { disabled: disabled, buttonClassName: "toolbar-item", buttonIconClassName: "iconify", buttonIconData: icons[blockType], buttonLabel: blockTypeToBlockName[blockType], buttonAriaLabel: "Formatting options for text style", children: [_jsxs(DropDownItem, { className: `item ${dropDownActiveClass(blockType === 'paragraph')}`, onClick: formatParagraph, children: [_jsx("i", { className: "iconify", "data-icon": icons.paragraph }), _jsx("span", { className: "text", children: "Normal" })] }), hasNodes('heading') && (_jsxs(DropDownItem, { className: `item ${dropDownActiveClass(blockType === 'h1')}`, onClick: () => formatHeading('h1'), children: [_jsx("i", { className: "iconify", "data-icon": icons.h1 }), _jsx("span", { className: "text", children: "Heading 1" })] })), hasNodes('heading') && (_jsxs(DropDownItem, { className: `item ${dropDownActiveClass(blockType === 'h2')}`, onClick: () => formatHeading('h2'), children: [_jsx("i", { className: "iconify", "data-icon": icons.h2 }), _jsx("span", { className: "text", children: "Heading 2" })] })), hasNodes('heading') && (_jsxs(DropDownItem, { className: `item ${dropDownActiveClass(blockType === 'h3')}`, onClick: () => formatHeading('h3'), children: [_jsx("i", { className: "iconify", "data-icon": icons.h3 }), _jsx("span", { className: "text", children: "Heading 3" })] })), hasNodes('list') && (_jsxs(DropDownItem, { className: `item ${dropDownActiveClass(blockType === 'bullet')}`, onClick: formatBulletList, children: [_jsx("i", { className: "iconify", "data-icon": icons.bullet }), _jsx("span", { className: "text", children: "Bullet List" })] })), hasNodes('list') && (_jsxs(DropDownItem, { className: `item ${dropDownActiveClass(blockType === 'number')}`, onClick: formatNumberedList, children: [_jsx("i", { className: "iconify", "data-icon": icons.number }), _jsx("span", { className: "text", children: "Numbered List" })] })), hasNodes('list') && (_jsxs(DropDownItem, { className: `item ${dropDownActiveClass(blockType === 'check')}`, onClick: formatCheckList, children: [_jsx("i", { className: "iconify", "data-icon": icons.check }), _jsx("span", { className: "text", children: "Check List" })] })), hasNodes('quote') && (_jsxs(DropDownItem, { className: `item ${dropDownActiveClass(blockType === 'quote')}`, onClick: formatQuote, children: [_jsx("i", { className: "iconify", "data-icon": icons.quote }), _jsx("span", { className: "text", children: "Quote" })] })), hasNodes('code') && (_jsxs(DropDownItem, { className: `item ${dropDownActiveClass(blockType === 'code')}`, onClick: formatCode, children: [_jsx("i", { className: "iconify", "data-icon": icons.code }), _jsx("span", { className: "text", children: "Code Block" })] }))] }));
137
137
  }
138
138
  function Divider() {
139
- return _jsx("div", { className: "divider" });
139
+ const theme = useTheme();
140
+ return _jsx("div", { className: "divider", style: { backgroundColor: theme.palette.divider } });
140
141
  }
141
142
  export default function ToolbarPlugin() {
142
143
  const [editor] = useLexicalComposerContext();
@@ -16,12 +16,10 @@
16
16
  .Input__label {
17
17
  display: flex;
18
18
  flex: 1;
19
- color: #666;
20
19
  }
21
20
  .Input__input {
22
21
  display: flex;
23
22
  flex: 2;
24
- border: 1px solid #999;
25
23
  padding-top: 7px;
26
24
  padding-bottom: 7px;
27
25
  padding-left: 10px;
@@ -1,7 +1,14 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import './Input.css';
3
+ import { styled, useTheme } from '@mui/material';
3
4
  export default function TextInput({ label, value, onChange, placeholder = '', 'data-test-id': dataTestId, type = 'text', }) {
4
- return (_jsxs("div", { className: "Input__wrapper", children: [_jsx("label", { className: "Input__label", children: label }), _jsx("input", { type: type, className: "Input__input", placeholder: placeholder, value: value, onChange: (e) => {
5
+ const theme = useTheme();
6
+ return (_jsxs("div", { className: "Input__wrapper", children: [_jsx("label", { className: "Input__label", style: { color: theme.palette.grey[500] }, children: label }), _jsx(Input, { type: type, className: "Input__input", placeholder: placeholder, value: value, onChange: (e) => {
5
7
  onChange(e.target.value);
6
8
  }, "data-test-id": dataTestId })] }));
7
9
  }
10
+ const Input = styled('input') `
11
+ background-color: ${(props) => props.theme.palette.background.paper};
12
+ color: ${(props) => props.theme.palette.grey[500]};
13
+ border: 1px solid ${(props) => props.theme.palette.divider};
14
+ `;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/editor",
3
- "version": "2.3.37",
3
+ "version": "2.3.39",
4
4
  "main": "lib/index.js",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -24,11 +24,11 @@
24
24
  ]
25
25
  },
26
26
  "dependencies": {
27
- "@blocklet/code-editor": "^0.4.266",
27
+ "@blocklet/code-editor": "^0.4.270",
28
28
  "@blocklet/embed": "^0.2.4",
29
29
  "@blocklet/js-sdk": "^1.16.43",
30
- "@blocklet/pages-kit": "^0.5.12",
31
- "@blocklet/pages-kit-runtime": "^0.5.12",
30
+ "@blocklet/pages-kit": "^0.5.15",
31
+ "@blocklet/pages-kit-runtime": "^0.5.15",
32
32
  "@excalidraw/excalidraw": "^0.14.2",
33
33
  "@iconify/iconify": "^3.1.1",
34
34
  "@iconify/icons-tabler": "^1.2.95",
@@ -68,7 +68,7 @@
68
68
  "ufo": "^1.5.4",
69
69
  "url-join": "^4.0.1",
70
70
  "zustand": "^4.5.5",
71
- "@blocklet/pdf": "^2.3.37"
71
+ "@blocklet/pdf": "^2.3.39"
72
72
  },
73
73
  "devDependencies": {
74
74
  "@babel/core": "^7.25.2",