@zwayam/apply-experience-library 0.0.2 → 0.0.3
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/README.md +9 -191
- package/package.json +12 -30
- package/packages/{web → apply-experience-sdk}/README.md +18 -20
- package/packages/{web → apply-experience-sdk/packages/web}/dist/index.js +11 -11
- /package/packages/{web → apply-experience-sdk/packages/web}/dist/index.d.ts +0 -0
- /package/packages/{web → apply-experience-sdk/packages/web}/dist/publicTypes.d.ts +0 -0
- /package/packages/{web → apply-experience-sdk/packages/web}/dist/styles.css +0 -0
package/README.md
CHANGED
|
@@ -1,204 +1,22 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Zwayam UI Libraries
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Shared UI libraries for Zwayam applications.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Apply Experience Library
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
`@zwayam/apply-experience-library` provides reusable Add Profile and Edit Profile widgets that can be mounted from Angular, React, Vue, or plain JavaScript host apps.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
npm install github:YOUR_GITHUB_USERNAME/YOUR_REPO_NAME#main
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
Or install a tagged version:
|
|
9
|
+
Install directly from this GitLab repository:
|
|
14
10
|
|
|
15
11
|
```bash
|
|
16
|
-
npm install
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
Import styles once:
|
|
20
|
-
|
|
21
|
-
```js
|
|
22
|
-
import "@zwayam/apply-experience-library/styles.css";
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## Required Inputs
|
|
26
|
-
|
|
27
|
-
The host app must provide:
|
|
28
|
-
|
|
29
|
-
- `container`: DOM element where the popup will mount.
|
|
30
|
-
- `context`: current job, logged-in user, session, and optional environment data.
|
|
31
|
-
- `api`: host-owned functions for loading config, parsing resume, submitting profile, and optional location suggestions.
|
|
32
|
-
|
|
33
|
-
```js
|
|
34
|
-
const context = {
|
|
35
|
-
job: {
|
|
36
|
-
id: "263294",
|
|
37
|
-
companyId: 16136,
|
|
38
|
-
jobTitle: "Java Developer",
|
|
39
|
-
jobCode: "13949",
|
|
40
|
-
location: "Kolkata",
|
|
41
|
-
departmentName: "All Departments",
|
|
42
|
-
},
|
|
43
|
-
user: {
|
|
44
|
-
id: 286813,
|
|
45
|
-
email: "user@example.com",
|
|
46
|
-
name: "Recruiter Name",
|
|
47
|
-
},
|
|
48
|
-
session: {
|
|
49
|
-
sessionId: "SESSION_ID",
|
|
50
|
-
},
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
const api = {
|
|
54
|
-
loadInitialData: async () => ({
|
|
55
|
-
applyFields: [],
|
|
56
|
-
supportedFiles: {
|
|
57
|
-
addProfile: {
|
|
58
|
-
fileFormat: ["pdf", "doc", "docx"],
|
|
59
|
-
fileSize: 3,
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
profileSources: [],
|
|
63
|
-
phoneConfiguration: {
|
|
64
|
-
countryIsoCode: "IN",
|
|
65
|
-
whatsAppEnabled: true,
|
|
66
|
-
maxCount: 3,
|
|
67
|
-
},
|
|
68
|
-
}),
|
|
69
|
-
|
|
70
|
-
parseResume: async (file) => {
|
|
71
|
-
const formData = new FormData();
|
|
72
|
-
formData.append("file", file);
|
|
73
|
-
return fetch("/parse-resume", { method: "POST", body: formData }).then((res) => res.json());
|
|
74
|
-
},
|
|
75
|
-
|
|
76
|
-
submitProfile: async (payload) => {
|
|
77
|
-
return fetch("/add-profile", { method: "POST", body: payload }).then((res) => res.json());
|
|
78
|
-
},
|
|
79
|
-
};
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
## React
|
|
83
|
-
|
|
84
|
-
```jsx
|
|
85
|
-
import { useEffect, useRef } from "react";
|
|
86
|
-
import { mountAddProfile } from "@zwayam/apply-experience-library";
|
|
87
|
-
import "@zwayam/apply-experience-library/styles.css";
|
|
88
|
-
|
|
89
|
-
export function AddProfile({ open, context, api, onClose }) {
|
|
90
|
-
const rootRef = useRef(null);
|
|
91
|
-
const mountedRef = useRef(null);
|
|
92
|
-
|
|
93
|
-
useEffect(() => {
|
|
94
|
-
if (!open || !rootRef.current) return;
|
|
95
|
-
|
|
96
|
-
mountedRef.current = mountAddProfile({
|
|
97
|
-
container: rootRef.current,
|
|
98
|
-
context,
|
|
99
|
-
api,
|
|
100
|
-
onClose,
|
|
101
|
-
onSuccess: onClose,
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
return () => mountedRef.current?.unmount();
|
|
105
|
-
}, [open, context, api, onClose]);
|
|
106
|
-
|
|
107
|
-
return <div ref={rootRef} />;
|
|
108
|
-
}
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
## Angular
|
|
112
|
-
|
|
113
|
-
Import styles in a global stylesheet:
|
|
114
|
-
|
|
115
|
-
```scss
|
|
116
|
-
@import "@zwayam/apply-experience-library/styles.css";
|
|
12
|
+
npm install git+https://zwayam-gitlab.infoedge.com/zwayam/zwayam-ui-libraries.git#main
|
|
117
13
|
```
|
|
118
14
|
|
|
119
|
-
|
|
15
|
+
Import the SDK and stylesheet:
|
|
120
16
|
|
|
121
17
|
```ts
|
|
122
|
-
import { mountAddProfile,
|
|
123
|
-
|
|
124
|
-
private mountedAddProfile?: MountedAddProfile;
|
|
125
|
-
|
|
126
|
-
openAddProfile(container: Element, context: any, api: any) {
|
|
127
|
-
this.mountedAddProfile = mountAddProfile({
|
|
128
|
-
container,
|
|
129
|
-
context,
|
|
130
|
-
api,
|
|
131
|
-
onClose: () => this.mountedAddProfile?.unmount(),
|
|
132
|
-
onSuccess: () => {
|
|
133
|
-
this.mountedAddProfile?.unmount();
|
|
134
|
-
// refresh host data if needed
|
|
135
|
-
},
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
## Vue
|
|
141
|
-
|
|
142
|
-
```vue
|
|
143
|
-
<script setup>
|
|
144
|
-
import { onBeforeUnmount, onMounted, ref } from "vue";
|
|
145
|
-
import { mountAddProfile } from "@zwayam/apply-experience-library";
|
|
18
|
+
import { mountAddProfile, mountEditProfile } from "@zwayam/apply-experience-library";
|
|
146
19
|
import "@zwayam/apply-experience-library/styles.css";
|
|
147
|
-
|
|
148
|
-
const root = ref(null);
|
|
149
|
-
let mounted;
|
|
150
|
-
|
|
151
|
-
onMounted(() => {
|
|
152
|
-
mounted = mountAddProfile({
|
|
153
|
-
container: root.value,
|
|
154
|
-
context,
|
|
155
|
-
api,
|
|
156
|
-
onClose: () => mounted?.unmount(),
|
|
157
|
-
onSuccess: () => mounted?.unmount(),
|
|
158
|
-
});
|
|
159
|
-
});
|
|
160
|
-
|
|
161
|
-
onBeforeUnmount(() => mounted?.unmount());
|
|
162
|
-
</script>
|
|
163
|
-
|
|
164
|
-
<template>
|
|
165
|
-
<div ref="root"></div>
|
|
166
|
-
</template>
|
|
167
20
|
```
|
|
168
21
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
```html
|
|
172
|
-
<button id="open-add-profile">Add Profile</button>
|
|
173
|
-
<div id="add-profile-root"></div>
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
```js
|
|
177
|
-
import { mountAddProfile } from "@zwayam/apply-experience-library";
|
|
178
|
-
import "@zwayam/apply-experience-library/styles.css";
|
|
179
|
-
|
|
180
|
-
document.querySelector("#open-add-profile").addEventListener("click", () => {
|
|
181
|
-
const mounted = mountAddProfile({
|
|
182
|
-
container: document.querySelector("#add-profile-root"),
|
|
183
|
-
context,
|
|
184
|
-
api,
|
|
185
|
-
onClose: () => mounted.unmount(),
|
|
186
|
-
onSuccess: () => mounted.unmount(),
|
|
187
|
-
});
|
|
188
|
-
});
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
## Development
|
|
192
|
-
|
|
193
|
-
```bash
|
|
194
|
-
npm install
|
|
195
|
-
npm run build
|
|
196
|
-
```
|
|
197
|
-
|
|
198
|
-
The GitHub-installed package uses the built files from `packages/web/dist`, so keep `dist` committed when using GitHub installs.
|
|
199
|
-
|
|
200
|
-
## Notes
|
|
201
|
-
|
|
202
|
-
- The host app owns authentication, session handling, and API endpoints.
|
|
203
|
-
- The SDK should be unmounted when the popup closes or the host component is destroyed.
|
|
204
|
-
- The root package is configured for GitHub installation and exports the bundled web SDK.
|
|
22
|
+
The host application owns API calls and passes the required context/API handlers to the SDK. The implementation lives in `packages/apply-experience-sdk`.
|
package/package.json
CHANGED
|
@@ -1,42 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zwayam/apply-experience-library",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "Host-facing Apply Experience SDK for Angular, React, Vue, and
|
|
3
|
+
"version": "0.0.3",
|
|
4
|
+
"description": "Host-facing Apply Experience SDK for Angular, React, Vue, and plain JavaScript apps.",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "./packages/web/dist/index.js",
|
|
7
|
-
"module": "./packages/web/dist/index.js",
|
|
8
|
-
"types": "./packages/web/dist/index.d.ts",
|
|
6
|
+
"main": "./packages/apply-experience-sdk/packages/web/dist/index.js",
|
|
7
|
+
"module": "./packages/apply-experience-sdk/packages/web/dist/index.js",
|
|
8
|
+
"types": "./packages/apply-experience-sdk/packages/web/dist/index.d.ts",
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
|
-
"types": "./packages/web/dist/index.d.ts",
|
|
12
|
-
"default": "./packages/web/dist/index.js"
|
|
11
|
+
"types": "./packages/apply-experience-sdk/packages/web/dist/index.d.ts",
|
|
12
|
+
"default": "./packages/apply-experience-sdk/packages/web/dist/index.js"
|
|
13
13
|
},
|
|
14
|
-
"./styles.css": "./packages/web/dist/styles.css",
|
|
14
|
+
"./styles.css": "./packages/apply-experience-sdk/packages/web/dist/styles.css",
|
|
15
15
|
"./package.json": "./package.json"
|
|
16
16
|
},
|
|
17
17
|
"files": [
|
|
18
|
-
"packages/web/dist",
|
|
19
|
-
"README.md"
|
|
18
|
+
"packages/apply-experience-sdk/packages/web/dist",
|
|
19
|
+
"packages/apply-experience-sdk/README.md"
|
|
20
20
|
],
|
|
21
21
|
"sideEffects": [
|
|
22
|
-
"./packages/web/dist/styles.css"
|
|
23
|
-
]
|
|
24
|
-
"devDependencies": {
|
|
25
|
-
"autoprefixer": "^10.4.21",
|
|
26
|
-
"esbuild": "^0.28.0",
|
|
27
|
-
"postcss": "^8.5.6",
|
|
28
|
-
"postcss-cli": "^11.0.1",
|
|
29
|
-
"react-icons": "^5.5.0",
|
|
30
|
-
"tailwindcss": "^3.4.17"
|
|
31
|
-
},
|
|
32
|
-
"workspaces": [
|
|
33
|
-
"packages/react",
|
|
34
|
-
"packages/web",
|
|
35
|
-
"packages/playground"
|
|
36
|
-
],
|
|
37
|
-
"scripts": {
|
|
38
|
-
"build": "npm run build -w @react-apply-experience/react && npm run build -w @zwayam/apply-experience-library",
|
|
39
|
-
"playground": "npm run dev -w @react-apply-experience/playground",
|
|
40
|
-
"playground:build": "npm run build -w @react-apply-experience/playground"
|
|
41
|
-
}
|
|
22
|
+
"./packages/apply-experience-sdk/packages/web/dist/styles.css"
|
|
23
|
+
]
|
|
42
24
|
}
|
|
@@ -2,22 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
Apply Experience is a reusable Add Profile widget for recruiter/admin web apps. It provides the popup UI for resume upload, candidate field capture, validations, phone fields, source/sub-source selection, and final profile submission flow.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
This repository root is installable directly from GitHub. The host app provides job/user context and API functions; the SDK handles the Add Profile experience.
|
|
6
6
|
|
|
7
|
-
##
|
|
8
|
-
|
|
9
|
-
Use this package for Angular, Vue, plain JavaScript, or any host that wants a fully bundled widget:
|
|
7
|
+
## Install From GitHub
|
|
10
8
|
|
|
11
9
|
```bash
|
|
12
|
-
npm install
|
|
10
|
+
npm install github:YOUR_GITHUB_USERNAME/YOUR_REPO_NAME#main
|
|
13
11
|
```
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
## Install
|
|
13
|
+
Or install a tagged version:
|
|
18
14
|
|
|
19
15
|
```bash
|
|
20
|
-
npm install
|
|
16
|
+
npm install github:YOUR_GITHUB_USERNAME/YOUR_REPO_NAME#v0.2.1
|
|
21
17
|
```
|
|
22
18
|
|
|
23
19
|
Import styles once:
|
|
@@ -55,7 +51,7 @@ const context = {
|
|
|
55
51
|
};
|
|
56
52
|
|
|
57
53
|
const api = {
|
|
58
|
-
loadInitialData: async (
|
|
54
|
+
loadInitialData: async () => ({
|
|
59
55
|
applyFields: [],
|
|
60
56
|
supportedFiles: {
|
|
61
57
|
addProfile: {
|
|
@@ -71,21 +67,15 @@ const api = {
|
|
|
71
67
|
},
|
|
72
68
|
}),
|
|
73
69
|
|
|
74
|
-
parseResume: async (file
|
|
70
|
+
parseResume: async (file) => {
|
|
75
71
|
const formData = new FormData();
|
|
76
72
|
formData.append("file", file);
|
|
77
73
|
return fetch("/parse-resume", { method: "POST", body: formData }).then((res) => res.json());
|
|
78
74
|
},
|
|
79
75
|
|
|
80
|
-
submitProfile: async (payload
|
|
76
|
+
submitProfile: async (payload) => {
|
|
81
77
|
return fetch("/add-profile", { method: "POST", body: payload }).then((res) => res.json());
|
|
82
78
|
},
|
|
83
|
-
|
|
84
|
-
getLocationSuggestions: async (query, context) => {
|
|
85
|
-
return fetch(`/locations?q=${encodeURIComponent(query)}`)
|
|
86
|
-
.then((res) => res.json())
|
|
87
|
-
.then((data) => data.suggestions || []);
|
|
88
|
-
},
|
|
89
79
|
};
|
|
90
80
|
```
|
|
91
81
|
|
|
@@ -198,9 +188,17 @@ document.querySelector("#open-add-profile").addEventListener("click", () => {
|
|
|
198
188
|
});
|
|
199
189
|
```
|
|
200
190
|
|
|
191
|
+
## Development
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
npm install
|
|
195
|
+
npm run build
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
The GitHub-installed package uses the built files from `packages/web/dist`, so keep `dist` committed when using GitHub installs.
|
|
199
|
+
|
|
201
200
|
## Notes
|
|
202
201
|
|
|
203
202
|
- The host app owns authentication, session handling, and API endpoints.
|
|
204
203
|
- The SDK should be unmounted when the popup closes or the host component is destroyed.
|
|
205
|
-
- The
|
|
206
|
-
- React-specific builds should use peer dependencies for `react` and `react-dom` to keep host bundles smaller.
|
|
204
|
+
- The root package is configured for GitHub installation and exports the bundled web SDK.
|