Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update dependency @rollup/plugin-replace to v5 - abandoned #136

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
3ffdd1a
chore(deps): update dependency tslib to v2.6.3
renovate[bot] Aug 11, 2024
bf9d221
chore(deps): update dependency typescript to v4.9.5
renovate[bot] Aug 11, 2024
d1c8081
chore(deps): update jest monorepo to v27.5.1
renovate[bot] Aug 11, 2024
0ed51ff
fix(deps): update dependency snabbdom to v3.6.2
renovate[bot] Aug 12, 2024
a541857
fix(deps): update uppy monorepo
renovate[bot] Aug 12, 2024
f1ca6d9
chore(deps): update actions/checkout action to v4
renovate[bot] Aug 12, 2024
ff35caa
chore(deps): update actions/setup-node action to v4
renovate[bot] Aug 12, 2024
9e7f0b9
Merge pull request #122 from cycleccc/renovate/uppy-monorepo
cycleccc Aug 12, 2024
e72111e
Merge pull request #118 from cycleccc/renovate/typescript-4.x
cycleccc Aug 12, 2024
7fad9ff
Merge pull request #123 from cycleccc/renovate/actions-checkout-4.x
cycleccc Aug 12, 2024
1f35bd1
Merge pull request #124 from cycleccc/renovate/actions-setup-node-4.x
cycleccc Aug 12, 2024
7b17644
Merge pull request #117 from cycleccc/renovate/tslib-2.x-lockfile
cycleccc Aug 12, 2024
fae53d8
Merge pull request #119 from cycleccc/renovate/jest-monorepo
cycleccc Aug 12, 2024
d23c92e
Merge pull request #121 from cycleccc/renovate/snabbdom-3.x-lockfile
cycleccc Aug 12, 2024
a14049a
fix: change table proerty align style
hsuna Aug 12, 2024
fab41a9
fix: add table cell border default property
hsuna Aug 12, 2024
605a3ad
Merge pull request #132 from hsuna/hotfix/table-property
cycleccc Aug 12, 2024
f80c40d
chore(deps): update dependency @rollup/plugin-replace to v5
renovate[bot] Aug 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"@rollup/plugin-commonjs": "^17.1.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^11.2.0",
"@rollup/plugin-replace": "^2.4.2",
"@rollup/plugin-replace": "^5.0.0",
"@rollup/plugin-terser": "^0.4.0",
"@testing-library/jest-dom": "^5.14.1",
"@types/jest": "^25.2.1",
Expand Down Expand Up @@ -103,7 +103,7 @@
"rollup-plugin-visualizer": "^5.5.0",
"ts-jest": "^27.0.4",
"tslib": "^2.3.0",
"typescript": "4.3.2"
"typescript": "4.9.5"
},
"dependencies": {
"@babel/runtime": "^7.14.6"
Expand Down
15 changes: 13 additions & 2 deletions packages/table-module/src/module/parse-style-html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ import { IDomEditor } from '@wangeditor-next/core'
import $, { DOMElement, getStyleValue } from '../utils/dom'
import { TableCellElement } from './custom-types'

// 获取 var(--w-e-textarea-border-color) 变量的实际样式值
const DEFAULT_BORDER_COLOR = window
?.getComputedStyle(document.documentElement)
?.getPropertyValue('--w-e-textarea-border-color')

export function parseStyleHtml(elem: DOMElement, node: Descendant, editor: IDomEditor): Descendant {
if (elem.tagName !== 'TABLE' && elem.tagName !== 'TD') return node

Expand All @@ -19,8 +24,14 @@ export function parseStyleHtml(elem: DOMElement, node: Descendant, editor: IDomE
tableNode.backgroundColor = backgroundColor
}

// eslint-disable-next-line no-unsafe-optional-chaining
let [borderWidth, borderStyle, borderColor] = getStyleValue($elem, 'border')?.split(' ')
let border = getStyleValue($elem, 'border')
if (!border && elem.tagName === 'TD') {
// https://github.com/cycleccc/wangEditor-next/blob/master/packages/table-module/src/assets/index.less#L20
// TD存在默认的css样式,尝试用getComputedStyle获取不到,只能写死
border = `1px solid ${DEFAULT_BORDER_COLOR}`
}

let [borderWidth, borderStyle, borderColor] = border?.split(' ') || []
borderWidth = getStyleValue($elem, 'border-width') || borderWidth // border 宽度
if (borderWidth) {
tableNode.borderWidth = borderWidth.replace(/[^\d]/g, '')
Expand Down
Loading