@apextelemed/partner-core 0.6.2 → 0.6.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.
@@ -3875,7 +3875,7 @@ var US_STATES3 = [
3875
3875
  var US_STATE_OPTIONS3 = US_STATES3.map((s) => ({ value: s, label: s }));
3876
3876
 
3877
3877
  // src/pages/AdminDashboard.tsx
3878
- import { createEffect as createEffect10, createSignal as createSignal31, ErrorBoundary, Match as Match3, Show as Show46, Switch as Switch3, For as For34 } from "solid-js";
3878
+ import { createEffect as createEffect11, createSignal as createSignal31, ErrorBoundary, Match as Match3, Show as Show46, Switch as Switch3, For as For34 } from "solid-js";
3879
3879
 
3880
3880
  // src/pages/admin/Affiliates.tsx
3881
3881
  import { createSignal as createSignal10, For as For14, Match, Switch } from "solid-js";
@@ -13577,7 +13577,7 @@ function Webhooks() {
13577
13577
  }
13578
13578
 
13579
13579
  // src/pages/admin/EmailTemplates.tsx
13580
- import { createSignal as createSignal27, createResource as createResource19, For as For30, Show as Show42 } from "solid-js";
13580
+ import { createEffect as createEffect10, createSignal as createSignal27, createResource as createResource19, For as For30, Show as Show42 } from "solid-js";
13581
13581
 
13582
13582
  // src/pages/admin/EmailTextEditor.tsx
13583
13583
  import { createSignal as createSignal26, For as For29, Index, Show as Show41 } from "solid-js";
@@ -13817,7 +13817,7 @@ function toInput(t) {
13817
13817
  closingText: t.closingText
13818
13818
  };
13819
13819
  }
13820
- function EmailTemplates() {
13820
+ function EmailTemplates(props = {}) {
13821
13821
  const [refreshKey, setRefreshKey] = createSignal27(0);
13822
13822
  const [placeholders, setPlaceholders] = createSignal27({});
13823
13823
  const [customTemplates, setCustomTemplates] = createSignal27([]);
@@ -13849,7 +13849,9 @@ function EmailTemplates() {
13849
13849
  if (other.length > 0) groups.push({ label: "Other", keys: other });
13850
13850
  return groups;
13851
13851
  };
13852
- const [selection, setSelection] = createSignal27({ kind: "fixed", key: "" });
13852
+ const [selection, setSelection] = createSignal27(
13853
+ props.initialCustomTemplateId ? { kind: "custom", id: props.initialCustomTemplateId } : { kind: "fixed", key: "" }
13854
+ );
13853
13855
  const [draft, setDraft] = createSignal27(null);
13854
13856
  const [customDraft, setCustomDraft] = createSignal27(null);
13855
13857
  const [saving, setSaving] = createSignal27(false);
@@ -13877,6 +13879,14 @@ function EmailTemplates() {
13877
13879
  if (keys.length > 0 && s.kind === "fixed" && !s.key) setSelection({ kind: "fixed", key: keys[0] });
13878
13880
  }
13879
13881
  };
13882
+ createEffect10(() => {
13883
+ const s = selection();
13884
+ const list = customTemplates();
13885
+ if (s.kind === "custom" && s.id && !customDraft()) {
13886
+ const saved = list.find((c) => c.id === s.id);
13887
+ if (saved) setCustomDraft(toInput(saved));
13888
+ }
13889
+ });
13880
13890
  const currentDraft = () => {
13881
13891
  ensureDraft();
13882
13892
  const d = draft();
@@ -14498,12 +14508,14 @@ function AddToSequence(props) {
14498
14508
  </div>;
14499
14509
  }
14500
14510
  function StepRow(props) {
14511
+ const nav = useAdminNav();
14501
14512
  const set = (k, v) => props.onChange({ ...props.step, [k]: v });
14502
14513
  const missingTemplate = () => props.step.templateId && !props.templates.some((t) => t.id === props.step.templateId);
14514
+ const canEditTemplate = () => !!nav && !!props.step.templateId && !missingTemplate();
14503
14515
  return <div
14504
14516
  style={{
14505
14517
  display: "grid",
14506
- "grid-template-columns": "2rem minmax(7rem, 9rem) minmax(12rem, 2fr) minmax(10rem, 1fr) auto",
14518
+ "grid-template-columns": "2rem minmax(7rem, 9rem) minmax(12rem, 2fr) auto minmax(10rem, 1fr) auto",
14507
14519
  gap: "0.5rem",
14508
14520
  "align-items": "center",
14509
14521
  padding: "0.625rem 1.25rem",
@@ -14523,6 +14535,18 @@ function StepRow(props) {
14523
14535
  </Show43>
14524
14536
  <For31 each={props.templates}>{(t) => <option value={t.id}>{t.name}</option>}</For31>
14525
14537
  </select>
14538
+ {
14539
+ /* Straight to the copy: the template opens in Email › Templates. */
14540
+ }
14541
+ <button
14542
+ type="button"
14543
+ class="app-admin-link-btn"
14544
+ style={{ "font-size": "0.8125rem", "white-space": "nowrap", visibility: canEditTemplate() ? "visible" : "hidden" }}
14545
+ aria-label={`Edit template for step ${props.index + 1}`}
14546
+ onClick={() => nav.openEmailTemplate(props.step.templateId)}
14547
+ >
14548
+ Edit template
14549
+ </button>
14526
14550
  <select class="app-admin-input" aria-label={`Step ${props.index + 1} link`} value={props.step.link} onChange={(e) => set("link", e.currentTarget.value)}>
14527
14551
  <For31 each={LINKS}>{(l) => <option value={l}>{LINK_LABEL[l]}</option>}</For31>
14528
14552
  </select>
@@ -15401,10 +15425,10 @@ function AdminDashboard(props) {
15401
15425
  const [internalTab, setInternalTab] = createSignal31(fallbackTab());
15402
15426
  const currentTab = () => props.activeTab ?? internalTab();
15403
15427
  const [drawerOpen, setDrawerOpen] = createSignal31(false);
15404
- createEffect10(() => {
15428
+ createEffect11(() => {
15405
15429
  setAdminToast(props.toast);
15406
15430
  });
15407
- createEffect10(() => {
15431
+ createEffect11(() => {
15408
15432
  const auth = props.auth;
15409
15433
  if (!auth) return;
15410
15434
  if (!auth.isAuthenticated()) {
@@ -15422,6 +15446,7 @@ function AdminDashboard(props) {
15422
15446
  };
15423
15447
  const [pendingCustomerUid, setPendingCustomerUid] = createSignal31(null);
15424
15448
  const [pendingThreadId, setPendingThreadId] = createSignal31(null);
15449
+ const [pendingTemplateId, setPendingTemplateId] = createSignal31(null);
15425
15450
  const handleTabClick = (tab, opts) => {
15426
15451
  if (!opts?.keepPending) {
15427
15452
  setPendingCustomerUid(null);
@@ -15445,6 +15470,10 @@ function AdminDashboard(props) {
15445
15470
  openSupportThread: (threadId) => {
15446
15471
  setPendingThreadId(threadId);
15447
15472
  handleTabClick("support", { keepPending: true });
15473
+ },
15474
+ openEmailTemplate: (templateId) => {
15475
+ setPendingTemplateId(templateId);
15476
+ handleTabClick("email-templates", { keepPending: true });
15448
15477
  }
15449
15478
  };
15450
15479
  const topOffset = () => props.topOffset ?? "0px";
@@ -15602,7 +15631,7 @@ function AdminDashboard(props) {
15602
15631
  <Webhooks />
15603
15632
  </Match3>
15604
15633
  <Match3 when={currentTab() === "email-templates"}>
15605
- <EmailTemplates />
15634
+ <EmailTemplates initialCustomTemplateId={pendingTemplateId()} />
15606
15635
  </Match3>
15607
15636
  <Match3 when={currentTab() === "funnel"}>
15608
15637
  <Funnel />
@@ -16755,7 +16784,7 @@ function MedicationGuide(props) {
16755
16784
  }
16756
16785
 
16757
16786
  // src/pages/member/MessagesPanel.tsx
16758
- import { Show as Show54, For as For39, Switch as Switch4, Match as Match4, createEffect as createEffect11, createSignal as createSignal36, on as on7 } from "solid-js";
16787
+ import { Show as Show54, For as For39, Switch as Switch4, Match as Match4, createEffect as createEffect12, createSignal as createSignal36, on as on7 } from "solid-js";
16759
16788
  import DOMPurify from "dompurify";
16760
16789
  function sanitizeMessageHtml(html) {
16761
16790
  return DOMPurify.sanitize(html, {
@@ -16869,7 +16898,7 @@ function MessagesPanel(props) {
16869
16898
  setComposing(true);
16870
16899
  }
16871
16900
  let composerRef;
16872
- createEffect11(
16901
+ createEffect12(
16873
16902
  on7(
16874
16903
  () => props.intent,
16875
16904
  (current2) => {
@@ -16901,7 +16930,7 @@ function MessagesPanel(props) {
16901
16930
  }
16902
16931
  )
16903
16932
  );
16904
- createEffect11(() => {
16933
+ createEffect12(() => {
16905
16934
  const id = pendingThreadIntentId();
16906
16935
  if (!id) return;
16907
16936
  if (thread().loadingConversations()) return;
@@ -16972,7 +17001,7 @@ function MessagesPanel(props) {
16972
17001
  }
16973
17002
  const selectedConvo = () => thread().conversations().find((c) => c.id === thread().selectedId());
16974
17003
  let endRef;
16975
- createEffect11(() => {
17004
+ createEffect12(() => {
16976
17005
  void thread().messages();
16977
17006
  requestAnimationFrame(() => endRef?.scrollIntoView?.({ behavior: "smooth", block: "end" }));
16978
17007
  });
@@ -17075,7 +17104,7 @@ function MessagesPanel(props) {
17075
17104
  else setFailed(true);
17076
17105
  return next;
17077
17106
  };
17078
- createEffect11(() => {
17107
+ createEffect12(() => {
17079
17108
  if (isImageAttachment(p.attachment) && !url()) void resolve();
17080
17109
  });
17081
17110
  const openDocument = async () => {
@@ -18005,7 +18034,7 @@ function MemberPortal(props) {
18005
18034
  }
18006
18035
 
18007
18036
  // src/pages/AffiliatePortal.tsx
18008
- import { createEffect as createEffect12, createSignal as createSignal40, Match as Match6, Show as Show62, Switch as Switch6, For as For46 } from "solid-js";
18037
+ import { createEffect as createEffect13, createSignal as createSignal40, Match as Match6, Show as Show62, Switch as Switch6, For as For46 } from "solid-js";
18009
18038
 
18010
18039
  // src/pages/affiliate/Overview.tsx
18011
18040
  import { Show as Show57, For as For42 } from "solid-js";
@@ -18591,7 +18620,7 @@ function AffiliatePortal(props) {
18591
18620
  const [internalTab, setInternalTab] = createSignal40(fallbackTab());
18592
18621
  const currentTab = () => props.activeTab ?? internalTab();
18593
18622
  const [drawerOpen, setDrawerOpen] = createSignal40(false);
18594
- createEffect12(() => {
18623
+ createEffect13(() => {
18595
18624
  const auth = props.auth;
18596
18625
  if (!auth) return;
18597
18626
  if (!auth.isAuthenticated()) {
@@ -19901,4 +19930,4 @@ export {
19901
19930
  AffiliateForgotPassword,
19902
19931
  AffiliateResetPassword
19903
19932
  };
19904
- //# sourceMappingURL=7ENL3GYZ.jsx.map
19933
+ //# sourceMappingURL=WODHGSBM.jsx.map
@@ -1,7 +1,7 @@
1
1
  import '../chunk/JSHO46VZ.js';
2
2
  export { DEFAULT_COLOR_PALETTE, categoryColor, lowestPrice, lowestSalePrice, restoreCartFromLink, startCartCapture, useCatalog, useMedicationSelect, useProductDetail, useSubscriptionIntakeFlow, validateResumedPromo } from '../chunk/NSRQXBHK.js';
3
3
  export { adoptCartId, capturePromoCode, cartId, clearPromoCode, fetchCartConfig, fetchResumedCart, postCartSnapshot, readCartToken, readPromoCode, resetCartConfigCache, resetCartId, stripCartToken } from '../chunk/BVLA7ATM.js';
4
- export { AddressFields, AdminDashboard, AffiliateForgotPassword, AffiliateLogin, AffiliatePortal, AffiliateRegister, AffiliateResetPassword, CartCheckoutPage, CheckoutPage, EmailTemplates, ForgotPasswordPage, MemberPortal, PatientDashboardPreview, RegisterPage, ResetPasswordPage, SignupPage, SubscribePage, SurveyPage, SurveyV2Page, UpdatePaymentMethod } from '../chunk/P2G32S2W.js';
4
+ export { AddressFields, AdminDashboard, AffiliateForgotPassword, AffiliateLogin, AffiliatePortal, AffiliateRegister, AffiliateResetPassword, CartCheckoutPage, CheckoutPage, EmailTemplates, ForgotPasswordPage, MemberPortal, PatientDashboardPreview, RegisterPage, ResetPasswordPage, SignupPage, SubscribePage, SurveyPage, SurveyV2Page, UpdatePaymentMethod } from '../chunk/UCF2EXRL.js';
5
5
  export { EmbedApiError2 as ApexV2ApiError, EmbedApiError, createEmbedApiClient, disqualificationReasonText, disqualifiedDrugIds, qualifiedDrugIds } from '../chunk/LZWA44KD.js';
6
6
  export { LIFECYCLE_BUCKETS, LIFECYCLE_LABEL, LIFECYCLE_TONE, LIVE_SUBSCRIPTION_STATUSES, TERMINAL_SUBSCRIPTION_STATUSES, US_STATES, US_STATE_OPTIONS, accountSource, availableStateOptions, availableStates, buildRefillView, buildTimeline, buildTrackerView, buildTrackingUrl, captureFunnelEmail, createFunnelTelemetry, deriveAttention, deriveJourney, emailGateAnswered, formatCardNumber, formatConversationTime, formatCvv, formatEventDate, formatExpiry, formatMessageTime, formatRelativeTime, formatStageDate, hasErrors, isLive, isQuestionVisible, isReconcilable, lifecycleReason, markEmailGateAnswered, normalizeState, primarySubscription, redeemResumeLink, resetResumeRedemption, stateAvailabilityNote, toTrackerRequest, useAddressPair, useAffiliateConversions, useAffiliateDownline, useAffiliateLinks, useAffiliateStats, useCartCheckoutFlow, useCheckoutFlow, useDashboardData, useMemberPortalData, useMessagesThread, useRegisterFlow, useSignupFlow, useSubscribeFlow, useSurveyFlow, useSurveyV2Flow, useUpdatePaymentMethodFlow, validateAddress } from '../chunk/WUE4VQBA.js';
7
7
  export { adoptFunnelSessionId, captureAuthHeader, fetchFunnelConfig, fetchResumedDraft, funnelSessionId, peekFunnelSessionId, postFunnelEvent, readResumeToken, resetFunnelConfigCache, saveFunnelDraft, stripResumeToken } from '../chunk/QTGJY3YQ.js';
@@ -47,7 +47,7 @@ import {
47
47
  SurveyPage,
48
48
  SurveyV2Page,
49
49
  UpdatePaymentMethod
50
- } from "../chunk/7ENL3GYZ.jsx";
50
+ } from "../chunk/WODHGSBM.jsx";
51
51
  import {
52
52
  EmbedApiError,
53
53
  EmbedApiError2,
@@ -409,7 +409,11 @@ interface AdminDashboardProps {
409
409
  */
410
410
  declare function AdminDashboard(props: AdminDashboardProps): solid_js.JSX.Element;
411
411
 
412
- declare function EmailTemplates(): solid_js.JSX.Element;
412
+ interface EmailTemplatesProps {
413
+ /** Open on this custom (marketing) template — a sequence step's "Edit template" link. */
414
+ initialCustomTemplateId?: string | null;
415
+ }
416
+ declare function EmailTemplates(props?: EmailTemplatesProps): solid_js.JSX.Element;
413
417
 
414
418
  interface PatientDashboardPreviewProps {
415
419
  /** Short-lived (15-min) impersonation token authenticating GET reads only. */
@@ -1,4 +1,4 @@
1
- export { AdminDashboard, AffiliateForgotPassword, AffiliateLogin, AffiliatePortal, AffiliateRegister, AffiliateResetPassword, CartCheckoutPage, CheckoutPage, EmailTemplates, ForgotPasswordPage, MemberPortal, PatientDashboardPreview, RegisterPage, ResetPasswordPage, SignupPage, SubscribePage, SurveyPage, SurveyV2Page, UpdatePaymentMethod } from '../chunk/P2G32S2W.js';
1
+ export { AdminDashboard, AffiliateForgotPassword, AffiliateLogin, AffiliatePortal, AffiliateRegister, AffiliateResetPassword, CartCheckoutPage, CheckoutPage, EmailTemplates, ForgotPasswordPage, MemberPortal, PatientDashboardPreview, RegisterPage, ResetPasswordPage, SignupPage, SubscribePage, SurveyPage, SurveyV2Page, UpdatePaymentMethod } from '../chunk/UCF2EXRL.js';
2
2
  import '../chunk/LZWA44KD.js';
3
3
  import '../chunk/WUE4VQBA.js';
4
4
  import '../chunk/QTGJY3YQ.js';
@@ -18,7 +18,7 @@ import {
18
18
  SurveyPage,
19
19
  SurveyV2Page,
20
20
  UpdatePaymentMethod
21
- } from "../chunk/7ENL3GYZ.jsx";
21
+ } from "../chunk/WODHGSBM.jsx";
22
22
  import "../chunk/UZCST66N.jsx";
23
23
  import "../chunk/HXMLRDIJ.jsx";
24
24
  import "../chunk/NBB2VTQK.jsx";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apextelemed/partner-core",
3
- "version": "0.6.2",
3
+ "version": "0.6.3",
4
4
  "description": "Shared frontend library for telehealth patient portals (api client, stores, headless flows).",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "repository": {