abstract-image 7.2.3 → 8.0.1
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/CHANGELOG.md +1 -3
- package/lib/__stories__/react-svg-export/example-1.stories.d.ts +1 -2
- package/lib/__stories__/react-svg-export/example-1.stories.d.ts.map +1 -1
- package/lib/__stories__/svg-export/example-1.stories.d.ts +1 -2
- package/lib/__stories__/svg-export/example-1.stories.d.ts.map +1 -1
- package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-callback.js +3 -3
- package/lib/exporters/__tests__/react-svg-export-image/test-defs/react-svg-callback.js.map +1 -1
- package/package.json +8 -8
- package/src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-callback.tsx +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
|
|
4
4
|
|
|
5
|
-
## [
|
|
6
|
-
|
|
7
|
-
### Added
|
|
5
|
+
## [8.0.0] - 2024-05-19
|
|
8
6
|
|
|
9
7
|
### Changed
|
|
10
8
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { Meta } from "@storybook/react";
|
|
3
2
|
export declare function ReactSvgExportExample1(): React.ReactElement<{}>;
|
|
4
|
-
declare const _default:
|
|
3
|
+
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react").ReactRenderer, import("@storybook/types").Args>;
|
|
5
4
|
export default _default;
|
|
6
5
|
//# sourceMappingURL=example-1.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"example-1.stories.d.ts","sourceRoot":"","sources":["../../../src/__stories__/react-svg-export/example-1.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"example-1.stories.d.ts","sourceRoot":"","sources":["../../../src/__stories__/react-svg-export/example-1.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,wBAAgB,sBAAsB,IAAI,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC,CA2C/D;;AAGD,wBAGU"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { Meta } from "@storybook/react";
|
|
3
2
|
export declare function SvgExportExample1(): React.ReactElement<{}>;
|
|
4
|
-
declare const _default:
|
|
3
|
+
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react").ReactRenderer, import("@storybook/types").Args>;
|
|
5
4
|
export default _default;
|
|
6
5
|
//# sourceMappingURL=example-1.stories.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"example-1.stories.d.ts","sourceRoot":"","sources":["../../../src/__stories__/svg-export/example-1.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"example-1.stories.d.ts","sourceRoot":"","sources":["../../../src/__stories__/svg-export/example-1.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,wBAAgB,iBAAiB,IAAI,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC,CA+B1D;;AAGD,wBAGU"}
|
|
@@ -29,8 +29,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
29
29
|
exports.test = void 0;
|
|
30
30
|
const AbstractImage = __importStar(require("../../../../../src/index"));
|
|
31
31
|
const enzyme_1 = __importDefault(require("enzyme"));
|
|
32
|
-
const
|
|
33
|
-
enzyme_1.default.configure({ adapter: new
|
|
32
|
+
const enzyme_adapter_react_18_1 = __importDefault(require("@cfaester/enzyme-adapter-react-18"));
|
|
33
|
+
enzyme_1.default.configure({ adapter: new enzyme_adapter_react_18_1.default() });
|
|
34
34
|
const components = [
|
|
35
35
|
AbstractImage.createText(AbstractImage.createPoint(10, 10), "Hello World", "Arial", 12, AbstractImage.black, "bold", 0, "center", "right", "down", 2, AbstractImage.red, false),
|
|
36
36
|
];
|
|
@@ -38,7 +38,7 @@ const image = AbstractImage.createAbstractImage(AbstractImage.createPoint(0, 0),
|
|
|
38
38
|
// eslint-disable-next-line functional/no-let
|
|
39
39
|
let testVariable = "not clicked";
|
|
40
40
|
const svg = AbstractImage.createReactSvg(image, {
|
|
41
|
-
onClick: (
|
|
41
|
+
onClick: (_id, _point) => {
|
|
42
42
|
testVariable = "clicked";
|
|
43
43
|
},
|
|
44
44
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-svg-callback.js","sourceRoot":"","sources":["../../../../../src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-callback.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,wEAA0D;AAC1D,oDAA4B;AAE5B,
|
|
1
|
+
{"version":3,"file":"react-svg-callback.js","sourceRoot":"","sources":["../../../../../src/exporters/__tests__/react-svg-export-image/test-defs/react-svg-callback.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,wEAA0D;AAC1D,oDAA4B;AAE5B,gGAAwD;AAExD,gBAAM,CAAC,SAAS,CAAC,EAAE,OAAO,EAAE,IAAI,iCAAO,EAAE,EAAE,CAAC,CAAC;AAE7C,MAAM,UAAU,GAAG;IACjB,aAAa,CAAC,UAAU,CACtB,aAAa,CAAC,WAAW,CAAC,EAAE,EAAE,EAAE,CAAC,EACjC,aAAa,EACb,OAAO,EACP,EAAE,EACF,aAAa,CAAC,KAAK,EACnB,MAAM,EACN,CAAC,EACD,QAAQ,EACR,OAAO,EACP,MAAM,EACN,CAAC,EACD,aAAa,CAAC,GAAG,EACjB,KAAK,CACN;CACF,CAAC;AACF,MAAM,KAAK,GAAG,aAAa,CAAC,mBAAmB,CAC7C,aAAa,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,EAC/B,aAAa,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,EAClC,aAAa,CAAC,KAAK,EACnB,UAAU,CACX,CAAC;AAEF,6CAA6C;AAC7C,IAAI,YAAY,GAAG,aAAa,CAAC;AAEjC,MAAM,GAAG,GAAG,aAAa,CAAC,cAAc,CAAC,KAAK,EAAE;IAC9C,OAAO,EAAE,CAAC,GAAuB,EAAE,MAA2B,EAAE,EAAE;QAChE,YAAY,GAAG,SAAS,CAAC;IAC3B,CAAC;CACF,CAAgB,CAAC;AAElB,MAAM,OAAO,GAAG,gBAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AACpC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,OAAO,EAAE;IACpC,aAAa,EAAE;QACb,qBAAqB,EAAE,GAAG,EAAE;YAC1B,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;QAC7B,CAAC;KACF;IACD,OAAO,EAAE,EAAE;IACX,OAAO,EAAE,EAAE;IACX,MAAM,EAAE;QACN,EAAE,EAAE,MAAM;KACX;CACF,CAAC,CAAC;AAEU,QAAA,IAAI,GAAkB;IACjC,IAAI,EAAE,gBAAgB;IACtB,aAAa,EAAE,YAAY;IAC3B,qBAAqB,EAAE,WAAW;CACnC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "abstract-image",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.1",
|
|
4
4
|
"description": "Dynamically create images using code or JSX and render to any format",
|
|
5
5
|
"repository": "https://github.com/dividab/abstract-visuals/tree/master/packages/abstract-image",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
"README.md"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"base64-js": "^1.
|
|
19
|
-
"react": "^
|
|
20
|
-
"react-dom": "^
|
|
18
|
+
"base64-js": "^1.5.1",
|
|
19
|
+
"react": "^18.3.1",
|
|
20
|
+
"react-dom": "^18.3.1"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@types/base64-js": "^1.2
|
|
24
|
-
"@types/react": "^
|
|
25
|
-
"@types/react-dom": "^
|
|
23
|
+
"@types/base64-js": "^1.3.2",
|
|
24
|
+
"@types/react": "^18.3.2",
|
|
25
|
+
"@types/react-dom": "^18.3.0"
|
|
26
26
|
},
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "518941b55b7762251b4cd25f15a468109a9b4869"
|
|
28
28
|
}
|
|
@@ -2,7 +2,7 @@ import { ExportTestDef } from "../export-test-def";
|
|
|
2
2
|
import * as AbstractImage from "../../../../../src/index";
|
|
3
3
|
import Enzyme from "enzyme";
|
|
4
4
|
import React from "react";
|
|
5
|
-
import Adapter from "enzyme-adapter-react-
|
|
5
|
+
import Adapter from "@cfaester/enzyme-adapter-react-18";
|
|
6
6
|
|
|
7
7
|
Enzyme.configure({ adapter: new Adapter() });
|
|
8
8
|
|
|
@@ -34,10 +34,10 @@ const image = AbstractImage.createAbstractImage(
|
|
|
34
34
|
let testVariable = "not clicked";
|
|
35
35
|
|
|
36
36
|
const svg = AbstractImage.createReactSvg(image, {
|
|
37
|
-
onClick: (
|
|
37
|
+
onClick: (_id: string | undefined, _point: AbstractImage.Point) => {
|
|
38
38
|
testVariable = "clicked";
|
|
39
39
|
},
|
|
40
|
-
});
|
|
40
|
+
}) as JSX.Element;
|
|
41
41
|
|
|
42
42
|
const wrapper = Enzyme.shallow(svg);
|
|
43
43
|
wrapper.find("svg").simulate("click", {
|