@zag-js/avatar 2.0.0-next.0 → 2.0.0-next.2
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/dist/avatar.connect.js +0 -15
- package/dist/avatar.connect.mjs +0 -5
- package/dist/avatar.types.d.mts +6 -9
- package/dist/avatar.types.d.ts +6 -9
- package/package.json +11 -8
package/dist/avatar.connect.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
|
|
30
20
|
// src/avatar.connect.ts
|
|
@@ -34,7 +24,6 @@ __export(avatar_connect_exports, {
|
|
|
34
24
|
});
|
|
35
25
|
module.exports = __toCommonJS(avatar_connect_exports);
|
|
36
26
|
var import_avatar = require("./avatar.anatomy.js");
|
|
37
|
-
var dom = __toESM(require("./avatar.dom.js"));
|
|
38
27
|
function connect(service, normalize) {
|
|
39
28
|
const { send, prop, scope } = service;
|
|
40
29
|
const status = getStatus(service);
|
|
@@ -42,10 +31,6 @@ function connect(service, normalize) {
|
|
|
42
31
|
return {
|
|
43
32
|
status,
|
|
44
33
|
loaded,
|
|
45
|
-
setSrc(src) {
|
|
46
|
-
const img = dom.getImageEl(scope);
|
|
47
|
-
img?.setAttribute("src", src);
|
|
48
|
-
},
|
|
49
34
|
setLoaded() {
|
|
50
35
|
send({ type: "img.loaded", src: "api" });
|
|
51
36
|
},
|
package/dist/avatar.connect.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// src/avatar.connect.ts
|
|
2
2
|
import { parts } from "./avatar.anatomy.mjs";
|
|
3
|
-
import * as dom from "./avatar.dom.mjs";
|
|
4
3
|
function connect(service, normalize) {
|
|
5
4
|
const { send, prop, scope } = service;
|
|
6
5
|
const status = getStatus(service);
|
|
@@ -8,10 +7,6 @@ function connect(service, normalize) {
|
|
|
8
7
|
return {
|
|
9
8
|
status,
|
|
10
9
|
loaded,
|
|
11
|
-
setSrc(src) {
|
|
12
|
-
const img = dom.getImageEl(scope);
|
|
13
|
-
img?.setAttribute("src", src);
|
|
14
|
-
},
|
|
15
10
|
setLoaded() {
|
|
16
11
|
send({ type: "img.loaded", src: "api" });
|
|
17
12
|
},
|
package/dist/avatar.types.d.mts
CHANGED
|
@@ -5,11 +5,11 @@ type LoadStatus = "loading" | "error" | "loaded";
|
|
|
5
5
|
interface StatusChangeDetails {
|
|
6
6
|
status: LoadStatus;
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
root
|
|
10
|
-
image
|
|
11
|
-
fallback
|
|
12
|
-
}
|
|
8
|
+
interface ElementIds {
|
|
9
|
+
root?: string | undefined;
|
|
10
|
+
image?: string | undefined;
|
|
11
|
+
fallback?: string | undefined;
|
|
12
|
+
}
|
|
13
13
|
interface AvatarProps extends CommonProperties, DirectionProperty {
|
|
14
14
|
/**
|
|
15
15
|
* Functional called when the image loading status changes.
|
|
@@ -22,6 +22,7 @@ interface AvatarProps extends CommonProperties, DirectionProperty {
|
|
|
22
22
|
}
|
|
23
23
|
interface AvatarSchema {
|
|
24
24
|
props: AvatarProps;
|
|
25
|
+
defaultPropKey: never;
|
|
25
26
|
context: any;
|
|
26
27
|
initial: "loading";
|
|
27
28
|
effect: "trackImageRemoval" | "trackSrcChange";
|
|
@@ -50,10 +51,6 @@ interface AvatarApi<T extends PropTypes = PropTypes> {
|
|
|
50
51
|
* Whether the image is loaded.
|
|
51
52
|
*/
|
|
52
53
|
loaded: boolean;
|
|
53
|
-
/**
|
|
54
|
-
* Function to set new src.
|
|
55
|
-
*/
|
|
56
|
-
setSrc: (src: string) => void;
|
|
57
54
|
/**
|
|
58
55
|
* Function to set loaded state.
|
|
59
56
|
*/
|
package/dist/avatar.types.d.ts
CHANGED
|
@@ -5,11 +5,11 @@ type LoadStatus = "loading" | "error" | "loaded";
|
|
|
5
5
|
interface StatusChangeDetails {
|
|
6
6
|
status: LoadStatus;
|
|
7
7
|
}
|
|
8
|
-
|
|
9
|
-
root
|
|
10
|
-
image
|
|
11
|
-
fallback
|
|
12
|
-
}
|
|
8
|
+
interface ElementIds {
|
|
9
|
+
root?: string | undefined;
|
|
10
|
+
image?: string | undefined;
|
|
11
|
+
fallback?: string | undefined;
|
|
12
|
+
}
|
|
13
13
|
interface AvatarProps extends CommonProperties, DirectionProperty {
|
|
14
14
|
/**
|
|
15
15
|
* Functional called when the image loading status changes.
|
|
@@ -22,6 +22,7 @@ interface AvatarProps extends CommonProperties, DirectionProperty {
|
|
|
22
22
|
}
|
|
23
23
|
interface AvatarSchema {
|
|
24
24
|
props: AvatarProps;
|
|
25
|
+
defaultPropKey: never;
|
|
25
26
|
context: any;
|
|
26
27
|
initial: "loading";
|
|
27
28
|
effect: "trackImageRemoval" | "trackSrcChange";
|
|
@@ -50,10 +51,6 @@ interface AvatarApi<T extends PropTypes = PropTypes> {
|
|
|
50
51
|
* Whether the image is loaded.
|
|
51
52
|
*/
|
|
52
53
|
loaded: boolean;
|
|
53
|
-
/**
|
|
54
|
-
* Function to set new src.
|
|
55
|
-
*/
|
|
56
|
-
setSrc: (src: string) => void;
|
|
57
54
|
/**
|
|
58
55
|
* Function to set loaded state.
|
|
59
56
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zag-js/avatar",
|
|
3
|
-
"version": "2.0.0-next.
|
|
3
|
+
"version": "2.0.0-next.2",
|
|
4
4
|
"description": "Core logic for the avatar widget implemented as a state machine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"js",
|
|
@@ -15,7 +15,10 @@
|
|
|
15
15
|
"homepage": "https://github.com/chakra-ui/zag#readme",
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"main": "dist/index.js",
|
|
18
|
-
"repository":
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "https://github.com/chakra-ui/zag/tree/main/packages/avatar"
|
|
21
|
+
},
|
|
19
22
|
"sideEffects": false,
|
|
20
23
|
"files": [
|
|
21
24
|
"dist"
|
|
@@ -27,11 +30,11 @@
|
|
|
27
30
|
"url": "https://github.com/chakra-ui/zag/issues"
|
|
28
31
|
},
|
|
29
32
|
"dependencies": {
|
|
30
|
-
"@zag-js/anatomy": "2.0.0-next.
|
|
31
|
-
"@zag-js/core": "2.0.0-next.
|
|
32
|
-
"@zag-js/dom-query": "2.0.0-next.
|
|
33
|
-
"@zag-js/utils": "2.0.0-next.
|
|
34
|
-
"@zag-js/types": "2.0.0-next.
|
|
33
|
+
"@zag-js/anatomy": "2.0.0-next.2",
|
|
34
|
+
"@zag-js/core": "2.0.0-next.2",
|
|
35
|
+
"@zag-js/dom-query": "2.0.0-next.2",
|
|
36
|
+
"@zag-js/utils": "2.0.0-next.2",
|
|
37
|
+
"@zag-js/types": "2.0.0-next.2"
|
|
35
38
|
},
|
|
36
39
|
"devDependencies": {
|
|
37
40
|
"clean-package": "2.2.0"
|
|
@@ -64,7 +67,7 @@
|
|
|
64
67
|
},
|
|
65
68
|
"scripts": {
|
|
66
69
|
"build": "tsup",
|
|
67
|
-
"lint": "
|
|
70
|
+
"lint": "oxlint src",
|
|
68
71
|
"typecheck": "tsc --noEmit"
|
|
69
72
|
}
|
|
70
73
|
}
|