@duffcloudservices/cms 0.14.0 → 0.15.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.
@@ -1,3 +1,4 @@
1
+ import { config } from '../chunk-ZGVP7AKD.js';
1
2
  import { buildSitemapXml, isHandAuthoredRobotsAcceptable, findAiTrainingRobotsConflicts, RobotsAiTrainingConflictError, appendAiTrainingOptOut, buildRobotsTxt, buildLlmsTxt, routeExclusionReason, breadcrumbTrailFromRoute, findReviewItemsForPage, findBusinessLicense, buildHeadTags, spliceHeadHtml, routeToOutputFile, loadPagesManifest, hoistCharsetMeta, checkCharsetBudget, findPostalAddressGaps, formatPostalAddressGapReport, isBodyPrerenderEnabled, resolveHonestyMode, assertHeadHonestyExecuted, findHeadHonestyViolations, assertHeadHonesty, isRouteEmitted, findDuplicateNormalizedPaths, formatDuplicateNormalizedPaths, prerenderBodies, CharsetBudgetError, formatCharsetHeadroomWarning, dedupeUrls, collectEmittedUrlsFromFiles, classifyUrl, auditSameOriginAssets, checkRemoteAssets, auditCheckedTotal, EmittedUrlNotRunError, formatEmittedUrlAudit, formatEmittedUrlReport, EmittedUrlError } from '../chunk-CJATCOZJ.js';
2
3
  export { buildVitePressSeoHead, createSeoTransformPageData, defaultRelativePathToRoute } from '../chunk-CJATCOZJ.js';
3
4
  import fs8 from 'fs';
@@ -72,14 +73,6 @@ function dcsMotionTokensStyleTag() {
72
73
  injectTo: "head"
73
74
  };
74
75
  }
75
-
76
- // package.json
77
- var config = {
78
- agentApiBaseUrl: "https://portal.duffcloudservices.com",
79
- agentWidgetScriptUrl: "https://files.duffcloudservices.com/agent-widget/v1/dcs-agent-widget.js"
80
- };
81
-
82
- // src/plugins/agentWidget.ts
83
76
  var DEFAULT_AGENT_API_BASE_URL = config.agentApiBaseUrl;
84
77
  var DEFAULT_AGENT_WIDGET_SCRIPT_URL = config.agentWidgetScriptUrl;
85
78
  var AGENT_CONFIG_ORIGINS = ["same-origin", "platform"];
@@ -2310,6 +2303,22 @@ function dcsSeoPlugin(options = {}) {
2310
2303
  }
2311
2304
 
2312
2305
  // src/plugins/dcsEditorPlugin.ts
2306
+ var PORTAL_ORIGIN_ENV = "VITE_DCS_PORTAL_ORIGIN";
2307
+ function editorBridgeModuleSource(portalOrigin) {
2308
+ const literal = portalOrigin === void 0 ? "undefined" : JSON.stringify(String(portalOrigin));
2309
+ return `
2310
+ import { initEditorBridge } from '@duffcloudservices/cms/editor'
2311
+ const startBridge = () => initEditorBridge({ portalOrigin: ${literal} })
2312
+ // The bridge only activates inside an iframe (portal preview)
2313
+ if (window.parent !== window) {
2314
+ if (document.readyState === 'loading') {
2315
+ document.addEventListener('DOMContentLoaded', () => setTimeout(startBridge, 200))
2316
+ } else {
2317
+ setTimeout(startBridge, 200)
2318
+ }
2319
+ }
2320
+ `;
2321
+ }
2313
2322
  function dcsEditorPlugin(options = {}) {
2314
2323
  const { debug = false } = options;
2315
2324
  const VIRTUAL_PATH = "/__dcs-editor-bridge.js";
@@ -2317,6 +2326,7 @@ function dcsEditorPlugin(options = {}) {
2317
2326
  let isDev = false;
2318
2327
  let basePath = "/";
2319
2328
  let isPreview = false;
2329
+ let portalOrigin;
2320
2330
  return {
2321
2331
  name: "dcs-editor-bridge",
2322
2332
  // Preview only: stop Vite running an unreachable HMR WebSocket server.
@@ -2334,6 +2344,7 @@ function dcsEditorPlugin(options = {}) {
2334
2344
  isDev = config2.command === "serve";
2335
2345
  basePath = config2.base ?? "/";
2336
2346
  isPreview = process.env.DCS_PREVIEW === "true";
2347
+ portalOrigin = config2.env?.[PORTAL_ORIGIN_ENV];
2337
2348
  },
2338
2349
  resolveId(id) {
2339
2350
  if (id === VIRTUAL_PATH || id === RIBBON_VIRTUAL_PATH) {
@@ -2342,17 +2353,7 @@ function dcsEditorPlugin(options = {}) {
2342
2353
  },
2343
2354
  load(id) {
2344
2355
  if (id === VIRTUAL_PATH) {
2345
- return `
2346
- import { initEditorBridge } from '@duffcloudservices/cms/editor'
2347
- // The bridge only activates inside an iframe (portal preview)
2348
- if (window.parent !== window) {
2349
- if (document.readyState === 'loading') {
2350
- document.addEventListener('DOMContentLoaded', () => setTimeout(initEditorBridge, 200))
2351
- } else {
2352
- setTimeout(initEditorBridge, 200)
2353
- }
2354
- }
2355
- `;
2356
+ return editorBridgeModuleSource(portalOrigin);
2356
2357
  }
2357
2358
  if (id === RIBBON_VIRTUAL_PATH) {
2358
2359
  return `