@pixldocs/canvas-renderer 0.5.53 → 0.5.55

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
@@ -11693,8 +11693,8 @@ function deriveRepeatablePagesFromTemplate(config, inlineFormSchema, formData) {
11693
11693
  return out;
11694
11694
  }
11695
11695
  async function resolveTemplateData(options) {
11696
- const { templateId, formData, supabaseUrl, supabaseAnonKey } = options;
11697
- const template = await fetchRow(supabaseUrl, supabaseAnonKey, "templates", templateId);
11696
+ const { templateId, formData, supabaseUrl, supabaseAnonKey, prefetched } = options;
11697
+ const template = (prefetched == null ? void 0 : prefetched.templateRow) ? prefetched.templateRow : await fetchRow(supabaseUrl, supabaseAnonKey, "templates", templateId);
11698
11698
  let config = template.config;
11699
11699
  const inlineFormSchema = template.form_schema;
11700
11700
  const defaultData = template.default_data;
@@ -11761,7 +11761,16 @@ async function resolveTemplateData(options) {
11761
11761
  }
11762
11762
  async function resolveFromForm(options) {
11763
11763
  var _a, _b, _c;
11764
- const { templateId, formSchemaId, sectionState, themeId, supabaseUrl, supabaseAnonKey, prefetched } = options;
11764
+ const { templateId, formSchemaId, sectionState, flatFormData: directFlatFormData, themeId, supabaseUrl, supabaseAnonKey, prefetched } = options;
11765
+ if (!formSchemaId) {
11766
+ return resolveTemplateData({
11767
+ templateId,
11768
+ formData: directFlatFormData ?? sectionState ?? {},
11769
+ supabaseUrl,
11770
+ supabaseAnonKey,
11771
+ prefetched: (prefetched == null ? void 0 : prefetched.templateRow) ? { templateRow: prefetched.templateRow } : void 0
11772
+ });
11773
+ }
11765
11774
  const [templateRow, formSchemaRow, defaultForm] = await Promise.all([
11766
11775
  (prefetched == null ? void 0 : prefetched.templateRow) ? Promise.resolve(prefetched.templateRow) : fetchRow(supabaseUrl, supabaseAnonKey, "templates", templateId),
11767
11776
  (prefetched == null ? void 0 : prefetched.formSchemaRow) !== void 0 ? Promise.resolve(prefetched.formSchemaRow) : fetchRow(supabaseUrl, supabaseAnonKey, "form_schemas", formSchemaId),
@@ -12240,7 +12249,20 @@ function PixldocsPreview(props) {
12240
12249
  onDynamicFieldClick,
12241
12250
  onReady,
12242
12251
  onError,
12243
- skipFontReadyWait = true
12252
+ // Default `false` so PageCanvas blocks textbox creation until the host
12253
+ // browser actually has the @font-face rules registered. This matters for
12254
+ // `overflowPolicy: 'auto-shrink'` text — `createText` runs the shrink
12255
+ // loop synchronously at mount time using whatever font metrics Fabric
12256
+ // can measure right then. If the real font hasn't loaded yet, Fabric
12257
+ // falls back to the system font (typically narrower), the shrink loop
12258
+ // decides "fits, no shrink needed", and when the real font finally
12259
+ // loads the text overflows the box.
12260
+ //
12261
+ // The renderer's imperative PNG/PDF paths (`renderPageViaPreviewCanvas`,
12262
+ // `captureSvgViaPreviewCanvas`) already pass `skipFontReadyWait: false`
12263
+ // for this exact reason — that's why the downloaded PDF was correct
12264
+ // while the on-screen preview wasn't.
12265
+ skipFontReadyWait = false
12244
12266
  } = props;
12245
12267
  react.useEffect(() => {
12246
12268
  setPackageApiUrl(imageProxyUrl);
@@ -12409,7 +12431,7 @@ function PixldocsPreview(props) {
12409
12431
  !canvasSettled && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { position: "absolute", inset: 0, display: "flex", alignItems: "center", justifyContent: "center", minHeight: 200 }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { style: { color: "#888", fontSize: 14 }, children: "Loading preview..." }) })
12410
12432
  ] });
12411
12433
  }
12412
- const PACKAGE_VERSION = "0.5.52";
12434
+ const PACKAGE_VERSION = "0.5.54";
12413
12435
  let __underlineFixInstalled = false;
12414
12436
  function installUnderlineFix(fab) {
12415
12437
  var _a;