Skip to content

Commit 5d7eab6

Browse files
committed
feat: update release workflow and enhance CSS utility function
1 parent da342ca commit 5d7eab6

2 files changed

Lines changed: 28 additions & 4 deletions

File tree

.github/workflows/release.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
push:
77
tags: ["*"]
88

9+
permissions:
10+
id-token: write # Required for OIDC
11+
contents: read
12+
913
jobs:
1014
lint:
1115
name: Lint
@@ -110,6 +114,9 @@ jobs:
110114
with:
111115
node-version-file: '.nvmrc'
112116
cache: 'npm'
117+
118+
- name: Update npm to latest
119+
run: npm install -g npm@latest
113120

114121
- name: Download build artifacts
115122
uses: actions/download-artifact@v4
@@ -118,7 +125,7 @@ jobs:
118125
path: build/
119126

120127
- name: Publish
121-
run: NPM_TOKEN=${{ secrets.NPM_TOKEN }} npm publish ./build --access public
128+
run: npm publish ./build
122129

123130
- name: Release
124131
uses: softprops/action-gh-release@v2

src/core/helpers/utils/css.ts

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,23 @@ import {
1919
import { camelCase } from 'jodit/core/helpers/string/camel-case';
2020
import { kebabCase } from 'jodit/core/helpers/string/kebab-case';
2121

22+
export function css(
23+
element: HTMLElement,
24+
key:
25+
| 'left'
26+
| 'top'
27+
| 'bottom'
28+
| 'right'
29+
| 'width'
30+
| 'min'
31+
| 'max'
32+
| 'height'
33+
| 'margin'
34+
| 'padding'
35+
| 'fontsize'
36+
| 'font-size'
37+
): number;
38+
2239
export function css(
2340
element: HTMLElement,
2441
key: keyof CSSStyleDeclaration
@@ -91,9 +108,9 @@ export function css(
91108
return '';
92109
}
93110

94-
const key2: string = kebabCase(key as string) as string,
95-
doc: Document = element.ownerDocument || document,
96-
win = doc ? doc.defaultView || (doc as any).parentWindow : false;
111+
const key2: string = kebabCase(key as string) as string;
112+
const doc: Document = element.ownerDocument || document;
113+
const win = doc ? doc.defaultView || (doc as any).parentWindow : false;
97114

98115
const currentValue: string | undefined = (element.style as any)[
99116
key as string

0 commit comments

Comments
 (0)