@apextelemed/partner-core 0.6.2 → 0.6.4

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();
@@ -14340,7 +14350,7 @@ function daysAgo(iso) {
14340
14350
  }
14341
14351
 
14342
14352
  // src/pages/admin/Sequences.tsx
14343
- var LINKS = ["members", "resume_survey", "cart", "home", "none"];
14353
+ var FALLBACK_LINKS = ["members", "resume_survey", "home", "none"];
14344
14354
  var EMPTY_STEP = { waitHours: 24, templateId: "", link: "members" };
14345
14355
  function blankSequence() {
14346
14356
  return {
@@ -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,8 +14535,27 @@ 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
- <For31 each={LINKS}>{(l) => <option value={l}>{LINK_LABEL[l]}</option>}</For31>
14551
+ {
14552
+ /* A saved step can name a destination this site no longer offers (its
14553
+ cart was removed); keep it visible so the rep sees what to fix. */
14554
+ }
14555
+ <Show43 when={props.step.link && !props.links.includes(props.step.link)}>
14556
+ <option value={props.step.link}>{LINK_LABEL[props.step.link]} (unavailable)</option>
14557
+ </Show43>
14558
+ <For31 each={props.links}>{(l) => <option value={l}>{LINK_LABEL[l]}</option>}</For31>
14528
14559
  </select>
14529
14560
  <div style={{ display: "flex", gap: "0.25rem" }}>
14530
14561
  <button type="button" class="app-admin-btn app-admin-btn-ghost app-admin-btn-sm" disabled={!props.canTest} title={props.canTest ? "Email this step to me" : "Save first"} onClick={() => props.onTest()}>Test</button>
@@ -14707,6 +14738,7 @@ function SequenceEditor(props) {
14707
14738
  step={step()}
14708
14739
  count={draft().steps.length}
14709
14740
  templates={props.templates}
14741
+ links={props.links}
14710
14742
  canTest={!isNew()}
14711
14743
  onChange={(s) => setStep(i, s)}
14712
14744
  onRemove={() => update({ steps: draft().steps.filter((_, j) => j !== i) })}
@@ -14864,6 +14896,7 @@ function Sequences() {
14864
14896
  {(seq) => <SequenceEditor
14865
14897
  initial={seq()}
14866
14898
  templates={customTemplates()}
14899
+ links={list()?.links ?? FALLBACK_LINKS}
14867
14900
  onSaved={(saved) => {
14868
14901
  setEditing(saved);
14869
14902
  setReload(reload() + 1);
@@ -15401,10 +15434,10 @@ function AdminDashboard(props) {
15401
15434
  const [internalTab, setInternalTab] = createSignal31(fallbackTab());
15402
15435
  const currentTab = () => props.activeTab ?? internalTab();
15403
15436
  const [drawerOpen, setDrawerOpen] = createSignal31(false);
15404
- createEffect10(() => {
15437
+ createEffect11(() => {
15405
15438
  setAdminToast(props.toast);
15406
15439
  });
15407
- createEffect10(() => {
15440
+ createEffect11(() => {
15408
15441
  const auth = props.auth;
15409
15442
  if (!auth) return;
15410
15443
  if (!auth.isAuthenticated()) {
@@ -15422,6 +15455,7 @@ function AdminDashboard(props) {
15422
15455
  };
15423
15456
  const [pendingCustomerUid, setPendingCustomerUid] = createSignal31(null);
15424
15457
  const [pendingThreadId, setPendingThreadId] = createSignal31(null);
15458
+ const [pendingTemplateId, setPendingTemplateId] = createSignal31(null);
15425
15459
  const handleTabClick = (tab, opts) => {
15426
15460
  if (!opts?.keepPending) {
15427
15461
  setPendingCustomerUid(null);
@@ -15445,6 +15479,10 @@ function AdminDashboard(props) {
15445
15479
  openSupportThread: (threadId) => {
15446
15480
  setPendingThreadId(threadId);
15447
15481
  handleTabClick("support", { keepPending: true });
15482
+ },
15483
+ openEmailTemplate: (templateId) => {
15484
+ setPendingTemplateId(templateId);
15485
+ handleTabClick("email-templates", { keepPending: true });
15448
15486
  }
15449
15487
  };
15450
15488
  const topOffset = () => props.topOffset ?? "0px";
@@ -15602,7 +15640,7 @@ function AdminDashboard(props) {
15602
15640
  <Webhooks />
15603
15641
  </Match3>
15604
15642
  <Match3 when={currentTab() === "email-templates"}>
15605
- <EmailTemplates />
15643
+ <EmailTemplates initialCustomTemplateId={pendingTemplateId()} />
15606
15644
  </Match3>
15607
15645
  <Match3 when={currentTab() === "funnel"}>
15608
15646
  <Funnel />
@@ -16755,7 +16793,7 @@ function MedicationGuide(props) {
16755
16793
  }
16756
16794
 
16757
16795
  // 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";
16796
+ 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
16797
  import DOMPurify from "dompurify";
16760
16798
  function sanitizeMessageHtml(html) {
16761
16799
  return DOMPurify.sanitize(html, {
@@ -16869,7 +16907,7 @@ function MessagesPanel(props) {
16869
16907
  setComposing(true);
16870
16908
  }
16871
16909
  let composerRef;
16872
- createEffect11(
16910
+ createEffect12(
16873
16911
  on7(
16874
16912
  () => props.intent,
16875
16913
  (current2) => {
@@ -16901,7 +16939,7 @@ function MessagesPanel(props) {
16901
16939
  }
16902
16940
  )
16903
16941
  );
16904
- createEffect11(() => {
16942
+ createEffect12(() => {
16905
16943
  const id = pendingThreadIntentId();
16906
16944
  if (!id) return;
16907
16945
  if (thread().loadingConversations()) return;
@@ -16972,7 +17010,7 @@ function MessagesPanel(props) {
16972
17010
  }
16973
17011
  const selectedConvo = () => thread().conversations().find((c) => c.id === thread().selectedId());
16974
17012
  let endRef;
16975
- createEffect11(() => {
17013
+ createEffect12(() => {
16976
17014
  void thread().messages();
16977
17015
  requestAnimationFrame(() => endRef?.scrollIntoView?.({ behavior: "smooth", block: "end" }));
16978
17016
  });
@@ -17075,7 +17113,7 @@ function MessagesPanel(props) {
17075
17113
  else setFailed(true);
17076
17114
  return next;
17077
17115
  };
17078
- createEffect11(() => {
17116
+ createEffect12(() => {
17079
17117
  if (isImageAttachment(p.attachment) && !url()) void resolve();
17080
17118
  });
17081
17119
  const openDocument = async () => {
@@ -18005,7 +18043,7 @@ function MemberPortal(props) {
18005
18043
  }
18006
18044
 
18007
18045
  // 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";
18046
+ import { createEffect as createEffect13, createSignal as createSignal40, Match as Match6, Show as Show62, Switch as Switch6, For as For46 } from "solid-js";
18009
18047
 
18010
18048
  // src/pages/affiliate/Overview.tsx
18011
18049
  import { Show as Show57, For as For42 } from "solid-js";
@@ -18591,7 +18629,7 @@ function AffiliatePortal(props) {
18591
18629
  const [internalTab, setInternalTab] = createSignal40(fallbackTab());
18592
18630
  const currentTab = () => props.activeTab ?? internalTab();
18593
18631
  const [drawerOpen, setDrawerOpen] = createSignal40(false);
18594
- createEffect12(() => {
18632
+ createEffect13(() => {
18595
18633
  const auth = props.auth;
18596
18634
  if (!auth) return;
18597
18635
  if (!auth.isAuthenticated()) {
@@ -19901,4 +19939,4 @@ export {
19901
19939
  AffiliateForgotPassword,
19902
19940
  AffiliateResetPassword
19903
19941
  };
19904
- //# sourceMappingURL=7ENL3GYZ.jsx.map
19942
+ //# sourceMappingURL=ZDBW3JDO.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/MTCQREMZ.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/ZDBW3JDO.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/MTCQREMZ.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/ZDBW3JDO.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.4",
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": {