@fluid-app/fluid-cli-theme-dev 0.1.350 → 0.1.351

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.
@@ -1,5 +1,5 @@
1
1
  import { j as r } from "./account-screen-runtime-CVtcJ0Fb.js";
2
- import { M as e } from "./MemberShareablesScreen-Dsf38R9p.js";
2
+ import { M as e } from "./MemberShareablesScreen-Dv6MyM8s.js";
3
3
  function a() {
4
4
  return /* @__PURE__ */ r.jsx(e, { curation: "always" });
5
5
  }
@@ -18,14 +18,14 @@ const p = {
18
18
  },
19
19
  media: async () => {
20
20
  const [t, e] = await Promise.all([
21
- import("./MediaScreen-BskrKx5t.js"),
21
+ import("./MediaScreen-CQ6nT5jv.js"),
22
22
  import("./media-7vUjJ3C6.js")
23
23
  ]);
24
24
  return { Component: t.MediaScreen, styles: e.default };
25
25
  },
26
26
  playlists: async () => {
27
27
  const [t, e] = await Promise.all([
28
- import("./PlaylistsScreen-DMGRqRgp.js"),
28
+ import("./PlaylistsScreen-DCz2pjDI.js"),
29
29
  import("./playlists-7vUjJ3C6.js")
30
30
  ]);
31
31
  return { Component: t.PlaylistsScreen, styles: e.default };
@@ -39,7 +39,7 @@ const p = {
39
39
  },
40
40
  messaging: async () => {
41
41
  const [t, e] = await Promise.all([
42
- import("./MessagingScreen-CGCkc-Z6.js"),
42
+ import("./MessagingScreen-CTJ4f67B.js"),
43
43
  import("./messaging-BETZIbiu.js")
44
44
  ]);
45
45
  return { Component: t.default, styles: e.default };
@@ -132,7 +132,7 @@ function h(t = "fluid-account-screen", e, s = !1) {
132
132
  this.status(!1);
133
133
  try {
134
134
  const [a, i] = await Promise.all([
135
- import("./mount-account-screen-DtM_OBKg.js"),
135
+ import("./mount-account-screen-DZrQyVDM.js"),
136
136
  w(r)
137
137
  ]);
138
138
  if (!this.isConnected || this.generation !== n) return;
@@ -18,8 +18,8 @@ import { u as cr, S as sr } from "./sidebar-D8LwwiTr.js";
18
18
  import { S as or } from "./store-api-context-DhtPESgY.js";
19
19
  import { s as dr, a as mr, b as vr, c as hr } from "./hey-api-client-BZY1abxM.js";
20
20
  import { M as yr } from "./use-mobile-C4O5e0kh.js";
21
- import { i as zv, n as rr } from "./navigate-account-screen-DoN7khxr.js";
22
- import { a as gr } from "./cli-preview-K_w4I-a1.js";
21
+ import { i as zv, n as rr } from "./navigate-account-screen-LNKK3Apl.js";
22
+ import { a as gr } from "./cli-preview-DjDWM_A6.js";
23
23
  import { A as Sr } from "./arrow-left-CVKbyXG0.js";
24
24
  /**
25
25
  * @license lucide-react v0.575.0 - ISC
@@ -1,4 +1,4 @@
1
- import { i as o } from "./cli-preview-K_w4I-a1.js";
1
+ import { i as o } from "./cli-preview-DjDWM_A6.js";
2
2
  function i(n) {
3
3
  if (!s(n)) return;
4
4
  const e = new URL(`/${n}`, window.location.origin), r = new URL(window.location.href);
package/dist/index.mjs CHANGED
@@ -1400,9 +1400,86 @@ const RESERVED_SECTION_TYPES = new Set([
1400
1400
  "footer"
1401
1401
  ]);
1402
1402
  const EXTENSION_URI_PATTERN = /^fluid:\/\/extensions\/[^/]+\/[^/]+\/[^/]+$/;
1403
+ const NATIVE_WIDGET_URI_PATTERN = /^fluid:\/\/native\/widgets\/([a-zA-Z0-9_-]+)(?:\/sections\/[a-zA-Z0-9_-]+)?$/;
1404
+ const NATIVE_WIDGET_KEY_SET = new Set([
1405
+ "member",
1406
+ "next",
1407
+ "points",
1408
+ "order",
1409
+ "again",
1410
+ "orders",
1411
+ "onway",
1412
+ "subs",
1413
+ "carenext",
1414
+ "journey",
1415
+ "careteam",
1416
+ "labs",
1417
+ "meds",
1418
+ "wallet",
1419
+ "status",
1420
+ "benefits",
1421
+ "links",
1422
+ "givget",
1423
+ "refs",
1424
+ "goals",
1425
+ "resume",
1426
+ "course",
1427
+ "courses",
1428
+ "certs",
1429
+ "signals",
1430
+ "funnel",
1431
+ "pulse",
1432
+ "live",
1433
+ "nextsend",
1434
+ "today",
1435
+ "acct",
1436
+ "sign",
1437
+ "owed",
1438
+ "chsales",
1439
+ "chgoal",
1440
+ "chbest",
1441
+ "chmix",
1442
+ "plink",
1443
+ "pcar",
1444
+ "nextstep",
1445
+ "brief",
1446
+ "asked",
1447
+ "working",
1448
+ "streak",
1449
+ "earnings",
1450
+ "sponsor",
1451
+ "contacts",
1452
+ "tasks",
1453
+ "messages",
1454
+ "groups",
1455
+ "repcard",
1456
+ "snapshot",
1457
+ "social",
1458
+ "team",
1459
+ "egoal",
1460
+ "ntitle",
1461
+ "circle",
1462
+ "teamfeed",
1463
+ "site",
1464
+ "link",
1465
+ "video",
1466
+ "photos",
1467
+ "product",
1468
+ "countdown",
1469
+ "qualify",
1470
+ "board",
1471
+ "pass"
1472
+ ]);
1473
+ function nativeWidgetKeyOf(type) {
1474
+ return NATIVE_WIDGET_URI_PATTERN.exec(type)?.[1];
1475
+ }
1476
+ function isNativeWidgetUri(type) {
1477
+ const key = nativeWidgetKeyOf(type);
1478
+ return key !== void 0 && NATIVE_WIDGET_KEY_SET.has(key);
1479
+ }
1403
1480
  /** Whether a `{% section %}` type resolves to something other than an on-disk `sections/<name>` definition (and so cannot be flagged as missing). */
1404
1481
  function isNonLocalSectionType(type) {
1405
- return RESERVED_SECTION_TYPES.has(type) || EXTENSION_URI_PATTERN.test(type);
1482
+ return RESERVED_SECTION_TYPES.has(type) || EXTENSION_URI_PATTERN.test(type) || isNativeWidgetUri(type);
1406
1483
  }
1407
1484
  function templateBody(liquid) {
1408
1485
  return liquid.replace(LIQUID_COMMENT_REGEX, "").replace(SCHEMA_BLOCK_REGEX, "");
@@ -1435,8 +1512,11 @@ function extractSectionReferences(liquid) {
1435
1512
  * Find `{% section %}` references that point to a section that does not exist
1436
1513
  * in `existingSectionNames` — the static equivalent of "an in-use section was
1437
1514
  * deleted". Reserved layout-region types (navbar/footer/library_navbar) and
1438
- * `fluid://` extension URIs are never flagged (see `isNonLocalSectionType`).
1439
- * Emits one `error` diagnostic per missing section type per template.
1515
+ * `fluid://` extension and known native widget URIs are never flagged (see
1516
+ * `isNonLocalSectionType`). Emits one `error` diagnostic per missing section
1517
+ * type per template. A well-formed native widget URI with an unknown key gets a
1518
+ * `warning` instead: the key may belong to a widget newer than this copy of
1519
+ * `NATIVE_WIDGET_KEYS`, so it must not fail a lint run.
1440
1520
  */
1441
1521
  function findMissingSectionReferences(templates, existingSectionNames) {
1442
1522
  const missing = [];
@@ -1447,12 +1527,13 @@ function findMissingSectionReferences(templates, existingSectionNames) {
1447
1527
  if (isNonLocalSectionType(reference.type)) continue;
1448
1528
  if (reported.has(reference.type)) continue;
1449
1529
  reported.add(reference.type);
1530
+ const unknownKey = nativeWidgetKeyOf(reference.type);
1450
1531
  missing.push({
1451
1532
  templatePath: template.path,
1452
1533
  sectionType: reference.type,
1453
1534
  diagnostic: {
1454
- severity: "error",
1455
- message: `references missing section '${reference.type}'`,
1535
+ severity: unknownKey === void 0 ? "error" : "warning",
1536
+ message: unknownKey === void 0 ? `references missing section '${reference.type}'` : `references unknown native widget key '${unknownKey}' (it may be newer than this CLI)`,
1456
1537
  target: {
1457
1538
  kind: "section",
1458
1539
  sectionType: reference.type,
@@ -1699,7 +1780,13 @@ var MemberScreenAssets = class {
1699
1780
  };
1700
1781
  //#endregion
1701
1782
  //#region src/theme/dev-server/hot-reload.ts
1702
- function buildHotReloadScript(mode) {
1783
+ /**
1784
+ * `endpoint` defaults to the relative `/hot-reload`. Pages that set a `<base>`
1785
+ * pointing elsewhere (member preview) must pass an absolute URL, or the SSE
1786
+ * request resolves against the base and fails CORS.
1787
+ */
1788
+ function buildHotReloadScript(mode, endpoint = "/hot-reload") {
1789
+ const endpointJson = JSON.stringify(endpoint).replace(/</g, "\\u003c");
1703
1790
  return `
1704
1791
  <script>
1705
1792
  (() => {
@@ -1746,15 +1833,15 @@ function buildHotReloadScript(mode) {
1746
1833
  }
1747
1834
 
1748
1835
  if (HotReload.isActive()) {
1749
- new SSEClient("/hot-reload", (data) => {
1836
+ new SSEClient(${endpointJson}, (data) => {
1750
1837
  if (data.modified) HotReload.refresh(data.modified);
1751
1838
  }).connect();
1752
1839
  }
1753
1840
  })();
1754
1841
  <\/script>`;
1755
1842
  }
1756
- function injectHotReload(html, mode) {
1757
- const script = buildHotReloadScript(mode);
1843
+ function injectHotReload(html, mode, endpoint) {
1844
+ const script = buildHotReloadScript(mode, endpoint);
1758
1845
  if (html.includes("</body>")) return html.replace("</body>", `${script}\n</body>`);
1759
1846
  return html + script;
1760
1847
  }
@@ -1850,7 +1937,7 @@ function renderMemberHtml(render, opts) {
1850
1937
  },true);
1851
1938
  <\/script>`);
1852
1939
  head.childNodes.unshift(...navigation.childNodes);
1853
- return injectHotReload(serialize(document), opts.reloadMode);
1940
+ return injectHotReload(serialize(document), opts.reloadMode, `${opts.localOrigin}/hot-reload`);
1854
1941
  }
1855
1942
  function previewLink(href, opts) {
1856
1943
  if (href.startsWith("#")) return opts.localOrigin + memberPreviewUrl(opts.path, opts.selection) + href;