Skip to content

Commit

Permalink
Bump version v0.0.6
Browse files Browse the repository at this point in the history
- This upgrade the dependencies package version
- Introduce new exported PictureInsertType enumeration
  • Loading branch information
xuri committed Mar 31, 2024
1 parent 73e5c9d commit 024d7c5
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 39 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
publish:
strategy:
matrix:
go-version: [1.20.x]
go-version: [1.22.x]
os: [ubuntu-latest]
targetplatform: [x64]

Expand All @@ -26,7 +26,7 @@ jobs:
go-version: ${{ matrix.go-version }}

- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Get dependencies
working-directory: ./cmd
Expand All @@ -39,7 +39,7 @@ jobs:
GOOS=js GOARCH=wasm GO111MODULE=on go test -exec="$(go env GOROOT)/misc/wasm/go_js_wasm_exec" -v ./... -coverprofile=coverage.txt -covermode=atomic
- name: Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
directory: ./cmd
file: coverage.txt
Expand Down
8 changes: 4 additions & 4 deletions cmd/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.18

require (
github.com/stretchr/testify v1.8.4
github.com/xuri/excelize/v2 v2.8.1
github.com/xuri/excelize/v2 v2.8.2-0.20240328083735-ffad7aecb5b9
golang.org/x/image v0.15.0
)

Expand All @@ -15,9 +15,9 @@ require (
github.com/richardlehane/mscfb v1.0.4 // indirect
github.com/richardlehane/msoleps v1.0.3 // indirect
github.com/xuri/efp v0.0.0-20231025114914-d1ff6096ae53 // indirect
github.com/xuri/nfp v0.0.0-20230919160717-d98342af3f05 // indirect
golang.org/x/crypto v0.20.0 // indirect
golang.org/x/net v0.21.0 // indirect
github.com/xuri/nfp v0.0.0-20240318013403-ab9948c2c4a7 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/net v0.22.0 // indirect
golang.org/x/text v0.14.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
16 changes: 8 additions & 8 deletions cmd/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcU
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/xuri/efp v0.0.0-20231025114914-d1ff6096ae53 h1:Chd9DkqERQQuHpXjR/HSV1jLZA6uaoiwwH3vSuF3IW0=
github.com/xuri/efp v0.0.0-20231025114914-d1ff6096ae53/go.mod h1:ybY/Jr0T0GTCnYjKqmdwxyxn2BQf2RcQIIvex5QldPI=
github.com/xuri/excelize/v2 v2.8.1 h1:pZLMEwK8ep+CLIUWpWmvW8IWE/yxqG0I1xcN6cVMGuQ=
github.com/xuri/excelize/v2 v2.8.1/go.mod h1:oli1E4C3Pa5RXg1TBXn4ENCXDV5JUMlBluUhG7c+CEE=
github.com/xuri/nfp v0.0.0-20230919160717-d98342af3f05 h1:qhbILQo1K3mphbwKh1vNm4oGezE1eF9fQWmNiIpSfI4=
github.com/xuri/nfp v0.0.0-20230919160717-d98342af3f05/go.mod h1:WwHg+CVyzlv/TX9xqBFXEZAuxOPxn2k1GNHwG41IIUQ=
golang.org/x/crypto v0.20.0 h1:jmAMJJZXr5KiCw05dfYK9QnqaqKLYXijU23lsEdcQqg=
golang.org/x/crypto v0.20.0/go.mod h1:Xwo95rrVNIoSMx9wa1JroENMToLWn3RNVrTBpLHgZPQ=
github.com/xuri/excelize/v2 v2.8.2-0.20240328083735-ffad7aecb5b9 h1:E5SrkqbATPg8t3kj5f8k/o48FM0FZio8Beng3rGdQYI=
github.com/xuri/excelize/v2 v2.8.2-0.20240328083735-ffad7aecb5b9/go.mod h1:now5ovRPu2yX3nl7XR6yhLgNVGtFh2IM02YbKccI4L8=
github.com/xuri/nfp v0.0.0-20240318013403-ab9948c2c4a7 h1:hPVCafDV85blFTabnqKgNhDCkJX25eik94Si9cTER4A=
github.com/xuri/nfp v0.0.0-20240318013403-ab9948c2c4a7/go.mod h1:WwHg+CVyzlv/TX9xqBFXEZAuxOPxn2k1GNHwG41IIUQ=
golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA=
golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs=
golang.org/x/image v0.15.0 h1:kOELfmgrmJlw4Cdb7g/QGuB3CvDrXbqEIww/pNtNBm8=
golang.org/x/image v0.15.0/go.mod h1:HUYqC05R2ZcZ3ejNQsIHQDQiwWM4JBqmm6MKANTp4LE=
golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc=
golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
Expand Down
25 changes: 9 additions & 16 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,11 @@ func regFuncs() {
// regConstants register all exported JavaScript functions on the Window ot Global.
func regConstants() {
for name, constant := range map[string]int{
// CultureName enumeration
"CultureNameUnknown": int(excelize.CultureNameUnknown),
"CultureNameEnUS": int(excelize.CultureNameEnUS),
"CultureNameZhCN": int(excelize.CultureNameZhCN),
} {
js.Global().Get("excelize").Set(name, constant)
}
for name, constant := range map[string]int{
// FormControlType enumeration
"FormControlNote": int(excelize.FormControlNote),
"FormControlButton": int(excelize.FormControlButton),
"FormControlOptionButton": int(excelize.FormControlOptionButton),
Expand All @@ -205,10 +203,7 @@ func regConstants() {
"FormControlGroupBox": int(excelize.FormControlGroupBox),
"FormControlLabel": int(excelize.FormControlLabel),
"FormControlScrollBar": int(excelize.FormControlScrollBar),
} {
js.Global().Get("excelize").Set(name, constant)
}
for name, constant := range map[string]int{
// ChartType enumeration
"Area": int(excelize.Area),
"AreaStacked": int(excelize.AreaStacked),
"AreaPercentStacked": int(excelize.AreaPercentStacked),
Expand Down Expand Up @@ -264,17 +259,11 @@ func regConstants() {
"WireframeContour": int(excelize.WireframeContour),
"Bubble": int(excelize.Bubble),
"Bubble3D": int(excelize.Bubble3D),
} {
js.Global().Get("excelize").Set(name, constant)
}
for name, constant := range map[string]int{
// ChartLineType enumeration
"ChartLineSolid": int(excelize.ChartLineSolid),
"ChartLineNone": int(excelize.ChartLineNone),
"ChartLineAutomatic": int(excelize.ChartLineAutomatic),
} {
js.Global().Get("excelize").Set(name, constant)
}
for name, constant := range map[string]int{
// ChartDataLabelPositionType enumeration
"ChartDataLabelsPositionUnset": int(excelize.ChartDataLabelsPositionUnset),
"ChartDataLabelsPositionBestFit": int(excelize.ChartDataLabelsPositionBestFit),
"ChartDataLabelsPositionBelow": int(excelize.ChartDataLabelsPositionBelow),
Expand All @@ -285,6 +274,10 @@ func regConstants() {
"ChartDataLabelsPositionOutsideEnd": int(excelize.ChartDataLabelsPositionOutsideEnd),
"ChartDataLabelsPositionRight": int(excelize.ChartDataLabelsPositionRight),
"ChartDataLabelsPositionAbove": int(excelize.ChartDataLabelsPositionAbove),
// PictureInsertType enumeration
"PictureInsertTypePlaceOverCells": int(excelize.PictureInsertTypePlaceOverCells),
"PictureInsertTypePlaceInCell": int(excelize.PictureInsertTypePlaceInCell),
"PictureInsertTypeDISPIMG": int(excelize.PictureInsertTypeDISPIMG),
} {
js.Global().Get("excelize").Set(name, constant)
}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "excelize-wasm",
"version": "0.0.4",
"version": "0.0.6",
"description": "A pure WebAssembly / Javascript port of Go Excelize library that allow you to write to and read from XLAM / XLSM / XLSX / XLTM / XLTX files",
"author": "xuri <[email protected]>",
"homepage": "https://xuri.me/excelize",
Expand Down
29 changes: 24 additions & 5 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -659,13 +659,24 @@ declare module 'excelize-wasm' {
Paragraph?: RichTextRun[];
};

/**
* PictureInsertType defines the type of the picture has been inserted into
* the worksheet.
*/
export enum PictureInsertType {
PictureInsertTypePlaceOverCells,
PictureInsertTypePlaceInCell,
PictureInsertTypeDISPIMG,
}

/**
* Picture maps the format settings of the picture.
*/
export type Picture = {
Extension: string;
File: Uint8Array;
Format: GraphicOptions;
InsertType: PictureInsertType;
};

/**
Expand Down Expand Up @@ -1556,9 +1567,13 @@ declare module 'excelize-wasm' {
AddDataValidation(sheet: string, dv: DataValidation): { error: string | null }

/**
* AddPictureFromBytes provides the method to add picture in a sheet by
* given picture format set (such as offset, scale, aspect ratio setting
* and print settings), file base name, extension name and file bytes.
* AddPictureFromBytes provides the method to add picture in a sheet by given
* picture format set (such as offset, scale, aspect ratio setting and print
* settings), file base name, extension name and file bytes, supported image
* types: EMF, EMZ, GIF, JPEG, JPG, PNG, SVG, TIF, TIFF, WMF, and WMZ. Note
* that this function only supports adding pictures placed over the cells
* currently, and doesn't support adding pictures placed in cells or
* creating the Kingsoft WPS Office embedded image cells.
* @param sheet The worksheet name
* @param cell The cell reference
* @param name The picture name
Expand Down Expand Up @@ -2027,15 +2042,19 @@ declare module 'excelize-wasm' {

/**
* GetPictures provides a function to get picture meta info and raw content
* embed in spreadsheet by given worksheet and cell name.
* embed in spreadsheet by given worksheet and cell name. This function
* returns the image contents as []byte data types. This function is
* concurrency safe. Note that, this function doesn't support getting cell
* image inserted by IMAGE formula function currently.
* @param sheet The worksheet name
* @param cell The cell reference
*/
GetPictures(sheet: string, cell: string): { pictures: Picture[], error: string | null }

/**
* GetPictureCells returns all picture cell references in a worksheet by a
* specific worksheet name.
* specific worksheet name. Note that, this function doesn't support getting
* cell image inserted by IMAGE formula function currently.
* @param sheet The worksheet name
*/
GetPictureCells(sheet: string): { cells: string[], error: string | null }
Expand Down

0 comments on commit 024d7c5

Please sign in to comment.