@ohhwells/bridge 0.1.122-next.337 → 0.1.122-next.340

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/dist/index.cjs CHANGED
@@ -296,10 +296,14 @@ function reapRemovedAiSections(state, store, removedIds, excludeIds = /* @__PURE
296
296
  var BRAND_NAME_KEY = "__ohw_brand_name";
297
297
  var BRAND_TITLE_KEY = "__ohw_site_title";
298
298
  var BRAND_FAVICON_LETTER_KEY = "__ohw_favicon_letter";
299
+ var SITE_DESCRIPTION_KEY = "__ohw_site_description";
300
+ var SITE_OG_IMAGE_KEY = "__ohw_og_image";
299
301
  var BRAND_CHROME_KEYS = /* @__PURE__ */ new Set([
300
302
  BRAND_NAME_KEY,
301
303
  BRAND_TITLE_KEY,
302
- BRAND_FAVICON_LETTER_KEY
304
+ BRAND_FAVICON_LETTER_KEY,
305
+ SITE_DESCRIPTION_KEY,
306
+ SITE_OG_IMAGE_KEY
303
307
  ]);
304
308
  function upsertMeta(selector, attr, token, value) {
305
309
  let el = document.head.querySelector(selector);
@@ -310,6 +314,9 @@ function upsertMeta(selector, attr, token, value) {
310
314
  }
311
315
  if (el.getAttribute("content") !== value) el.setAttribute("content", value);
312
316
  }
317
+ function removeMeta(selector) {
318
+ document.head.querySelector(selector)?.remove();
319
+ }
313
320
  function escapeXml(value) {
314
321
  return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
315
322
  }
@@ -325,6 +332,22 @@ function applyLetterFavicon(letter) {
325
332
  link.type = "image/svg+xml";
326
333
  if (link.href !== href) link.href = href;
327
334
  }
335
+ function applyDescription(description) {
336
+ if (!description) return;
337
+ upsertMeta('meta[name="description"]', "name", "description", description);
338
+ upsertMeta('meta[property="og:description"]', "property", "og:description", description);
339
+ upsertMeta('meta[name="twitter:description"]', "name", "twitter:description", description);
340
+ }
341
+ function applyOgImage(url) {
342
+ if (url) {
343
+ upsertMeta('meta[property="og:image"]', "property", "og:image", url);
344
+ upsertMeta('meta[name="twitter:image"]', "name", "twitter:image", url);
345
+ upsertMeta('meta[name="twitter:card"]', "name", "twitter:card", "summary_large_image");
346
+ return;
347
+ }
348
+ removeMeta('meta[property="og:image"]');
349
+ removeMeta('meta[name="twitter:image"]');
350
+ }
328
351
  function applyBrandChrome(content) {
329
352
  const name = content[BRAND_NAME_KEY];
330
353
  if (typeof name === "string" && name.length > 0) {
@@ -343,6 +366,13 @@ function applyBrandChrome(content) {
343
366
  if (typeof letter === "string" && letter.length > 0) {
344
367
  applyLetterFavicon(letter);
345
368
  }
369
+ const description = content[SITE_DESCRIPTION_KEY];
370
+ if (typeof description === "string" && description.length > 0) {
371
+ applyDescription(description);
372
+ }
373
+ if (Object.prototype.hasOwnProperty.call(content, SITE_OG_IMAGE_KEY)) {
374
+ applyOgImage(String(content[SITE_OG_IMAGE_KEY] ?? "").trim());
375
+ }
346
376
  }
347
377
 
348
378
  // src/lib/brand-kit.ts
@@ -4456,7 +4486,7 @@ function SchedulingWidget({ notifyOnConnect = false, initialScheduleId, insertAf
4456
4486
  const timer = setTimeout(() => {
4457
4487
  if (!done) {
4458
4488
  done = true;
4459
- setLoading(false);
4489
+ innerCleanup = loadWithId(null);
4460
4490
  }
4461
4491
  }, 2e3);
4462
4492
  const configHandler = (e) => {