@inploi/plugin-job-alerts 5.2.1 → 5.3.0

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.
@@ -11,6 +11,11 @@ export type JobAlertsConfig = {
11
11
  headerText: string;
12
12
  /** Linked under the form, before the candidate confirms, so they can read how their personal data is used. */
13
13
  privacyPolicyUrl?: string;
14
+ /**
15
+ * Who sends the alert emails, named in the notice above the submit button. Pass the company's display name, the
16
+ * same name the emails come from. Without it the notice still says what arrives and how to unsubscribe.
17
+ */
18
+ employerName?: string;
14
19
  };
15
20
  export type JobAlertsPluginParams = {
16
21
  theme: {
@@ -13,6 +13,8 @@ export declare const defaultTerms: {
13
13
  readonly create_alert: "Create Alert";
14
14
  readonly create_alert_error: "Failed to create alert. Please try again later.";
15
15
  readonly privacy_policy_link: "How we use your personal data";
16
+ readonly alert_notice_sender: "{{company}} will email you new jobs matching this search, as often as you choose. Every email has an unsubscribe link.";
17
+ readonly alert_notice: "You'll get new jobs matching this search by email, as often as you choose. Every email has an unsubscribe link.";
16
18
  };
17
19
  /** Host overrides for any job alerts term. */
18
20
  export type JobAlertsTranslationTerms = Partial<Record<keyof typeof defaultTerms, string>>;
@@ -10255,7 +10255,9 @@ const defaultTerms = {
10255
10255
  frequency: "Frequency",
10256
10256
  create_alert: "Create Alert",
10257
10257
  create_alert_error: "Failed to create alert. Please try again later.",
10258
- privacy_policy_link: "How we use your personal data"
10258
+ privacy_policy_link: "How we use your personal data",
10259
+ alert_notice_sender: "{{company}} will email you new jobs matching this search, as often as you choose. Every email has an unsubscribe link.",
10260
+ alert_notice: "You'll get new jobs matching this search by email, as often as you choose. Every email has an unsubscribe link."
10259
10261
  };
10260
10262
  const { TranslationProvider, useTranslation, createTFunction } = createTranslation(defaultTerms);
10261
10263
  var i = Symbol.for("preact-signals");
@@ -11000,6 +11002,14 @@ const InputError = ({ error: error2 }) => {
11000
11002
  /* @__PURE__ */ u$2("p", { class: "pr-1 text-sm", children: error2 })
11001
11003
  ] });
11002
11004
  };
11005
+ const signupNoticeText = (t2, employerName) => {
11006
+ const sender = employerName == null ? void 0 : employerName.trim();
11007
+ return sender ? t2("alert_notice_sender", { company: sender }) : t2("alert_notice");
11008
+ };
11009
+ const SignupNotice = ({ employerName }) => {
11010
+ const { t: t2 } = useTranslation();
11011
+ return /* @__PURE__ */ u$2("p", { class: "text-neutral-11 px-2 text-xs leading-snug", children: signupNoticeText(t2, employerName) });
11012
+ };
11003
11013
  const inputClass = "rounded-field-input bg-neutral-1 text-accent-11 autofill:shadow-[inset_0_0_0_1000px_var(--i-color-a-2)] autofill:focus:shadow-[inset_0_0_0_1000px_var(--i-color-a-1)] autofill:[-webkit-text-fill-color:var(--i-color-a-11)] px-3 py-2 ring ring-[1px] transition-all ease-expo-out duration-snappy ring-neutral-4 fr inline-flex w-full items-center justify-center px-2.5 text-base shadow-[0_0_0_1px] outline-none focus:shadow-[0_0_0_2px]";
11004
11014
  const JobAlertsButton = D(
11005
11015
  ({ class: className, ...props }, ref) => /* @__PURE__ */ u$2(
@@ -11138,6 +11148,7 @@ const JobAlerts = ({ theme, rpcClient, logger, analytics }) => {
11138
11148
  /* @__PURE__ */ u$2("div", { class: "text-neutral-10 absolute bottom-0 right-0 top-0 flex items-center p-1", "aria-hidden": true, children: /* @__PURE__ */ u$2(Icon, { name: "chevron-up-down" }) })
11139
11149
  ] })
11140
11150
  ] }),
11151
+ /* @__PURE__ */ u$2(SignupNotice, { employerName: store.config$.value.employerName }),
11141
11152
  /* @__PURE__ */ u$2(PrivacyPolicyLink, { label: t2("privacy_policy_link") }),
11142
11153
  /* @__PURE__ */ u$2(
11143
11154
  "button",
@@ -11806,6 +11817,10 @@ const tailwind = `#ija {
11806
11817
  font-variant-numeric: var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);
11807
11818
  }
11808
11819
 
11820
+ #ija .leading-snug {
11821
+ line-height: 1.375;
11822
+ }
11823
+
11809
11824
  #ija .text-\\[\\#E5484D\\] {
11810
11825
  --tw-text-opacity: 1;
11811
11826
  color: rgb(229 72 77 / var(--tw-text-opacity, 1));
@@ -10253,7 +10253,9 @@ const defaultTerms = {
10253
10253
  frequency: "Frequency",
10254
10254
  create_alert: "Create Alert",
10255
10255
  create_alert_error: "Failed to create alert. Please try again later.",
10256
- privacy_policy_link: "How we use your personal data"
10256
+ privacy_policy_link: "How we use your personal data",
10257
+ alert_notice_sender: "{{company}} will email you new jobs matching this search, as often as you choose. Every email has an unsubscribe link.",
10258
+ alert_notice: "You'll get new jobs matching this search by email, as often as you choose. Every email has an unsubscribe link."
10257
10259
  };
10258
10260
  const { TranslationProvider, useTranslation, createTFunction } = createTranslation(defaultTerms);
10259
10261
  var i = Symbol.for("preact-signals");
@@ -10998,6 +11000,14 @@ const InputError = ({ error: error2 }) => {
10998
11000
  /* @__PURE__ */ u$2("p", { class: "pr-1 text-sm", children: error2 })
10999
11001
  ] });
11000
11002
  };
11003
+ const signupNoticeText = (t2, employerName) => {
11004
+ const sender = employerName == null ? void 0 : employerName.trim();
11005
+ return sender ? t2("alert_notice_sender", { company: sender }) : t2("alert_notice");
11006
+ };
11007
+ const SignupNotice = ({ employerName }) => {
11008
+ const { t: t2 } = useTranslation();
11009
+ return /* @__PURE__ */ u$2("p", { class: "text-neutral-11 px-2 text-xs leading-snug", children: signupNoticeText(t2, employerName) });
11010
+ };
11001
11011
  const inputClass = "rounded-field-input bg-neutral-1 text-accent-11 autofill:shadow-[inset_0_0_0_1000px_var(--i-color-a-2)] autofill:focus:shadow-[inset_0_0_0_1000px_var(--i-color-a-1)] autofill:[-webkit-text-fill-color:var(--i-color-a-11)] px-3 py-2 ring ring-[1px] transition-all ease-expo-out duration-snappy ring-neutral-4 fr inline-flex w-full items-center justify-center px-2.5 text-base shadow-[0_0_0_1px] outline-none focus:shadow-[0_0_0_2px]";
11002
11012
  const JobAlertsButton = D(
11003
11013
  ({ class: className, ...props }, ref) => /* @__PURE__ */ u$2(
@@ -11136,6 +11146,7 @@ const JobAlerts = ({ theme, rpcClient, logger, analytics }) => {
11136
11146
  /* @__PURE__ */ u$2("div", { class: "text-neutral-10 absolute bottom-0 right-0 top-0 flex items-center p-1", "aria-hidden": true, children: /* @__PURE__ */ u$2(Icon, { name: "chevron-up-down" }) })
11137
11147
  ] })
11138
11148
  ] }),
11149
+ /* @__PURE__ */ u$2(SignupNotice, { employerName: store.config$.value.employerName }),
11139
11150
  /* @__PURE__ */ u$2(PrivacyPolicyLink, { label: t2("privacy_policy_link") }),
11140
11151
  /* @__PURE__ */ u$2(
11141
11152
  "button",
@@ -11804,6 +11815,10 @@ const tailwind = `#ija {
11804
11815
  font-variant-numeric: var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction);
11805
11816
  }
11806
11817
 
11818
+ #ija .leading-snug {
11819
+ line-height: 1.375;
11820
+ }
11821
+
11807
11822
  #ija .text-\\[\\#E5484D\\] {
11808
11823
  --tw-text-opacity: 1;
11809
11824
  color: rgb(229 72 77 / var(--tw-text-opacity, 1));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inploi/plugin-job-alerts",
3
- "version": "5.2.1",
3
+ "version": "5.3.0",
4
4
  "type": "module",
5
5
  "main": "dist/plugin-job-alerts.js",
6
6
  "types": "dist/index.d.ts",
@@ -51,7 +51,7 @@
51
51
  "zustand-context": "^1.0.0",
52
52
  "@inploi/core": "1.21.0",
53
53
  "@inploi/design-tokens": "0.2.1",
54
- "@inploi/sdk": "2.4.0",
54
+ "@inploi/sdk": "2.5.0",
55
55
  "eslint-config-custom": "0.1.0",
56
56
  "@inploi/i18n": "0.1.5"
57
57
  },
@@ -65,7 +65,8 @@
65
65
  "build:npm": "VITE_MOCKS=false vite build --mode=production",
66
66
  "build:cdn": "VITE_MOCKS=false vite build --mode=cdn",
67
67
  "preview": "vite preview",
68
- "_test": "bun test src/",
68
+ "test": "bun test src/",
69
+ "test:coverage": "bun test src/ --coverage --coverage-reporter=lcov",
69
70
  "_test:watch": "bun test src/ --watch",
70
71
  "_test:int": "playwright test",
71
72
  "_test:ui": "playwright test --ui",