@pixldocs/canvas-renderer 0.5.165 → 0.5.168

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
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("./index-B8sm4VZ8.cjs");
3
+ const index = require("./index-DgX2Y94P.cjs");
4
4
  exports.DEPLOYMENT_VERSION_MARKER = index.DEPLOYMENT_VERSION_MARKER;
5
5
  exports.FONT_FALLBACK_DEVANAGARI = index.FONT_FALLBACK_DEVANAGARI;
6
6
  exports.FONT_FALLBACK_MATH = index.FONT_FALLBACK_MATH;
@@ -24,9 +24,11 @@ exports.ensureFontsForResolvedConfig = index.ensureFontsForResolvedConfig;
24
24
  exports.extractFontFamiliesFromSvgs = index.extractFontFamiliesFromSvgs;
25
25
  exports.getEmbeddedJsPDFFontName = index.getEmbeddedJsPDFFontName;
26
26
  exports.getProxiedImageUrl = index.getProxiedImageUrl;
27
+ exports.getPublishedTemplate = index.getPublishedTemplate;
27
28
  exports.isBundledAssetUrl = index.isBundledAssetUrl;
28
29
  exports.isFontAvailable = index.isFontAvailable;
29
30
  exports.isPrivateUrl = index.isPrivateUrl;
31
+ exports.listPublishedTemplates = index.listPublishedTemplates;
30
32
  exports.loadGoogleFontCSS = index.loadGoogleFontCSS;
31
33
  exports.normalizeFontFamily = index.normalizeFontFamily;
32
34
  exports.resolveFontWeight = index.resolveFontWeight;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/index.d.ts CHANGED
@@ -236,6 +236,13 @@ export declare function getEmbeddedJsPDFFontName(fontName: string, weight: numbe
236
236
 
237
237
  export { getProxiedImageUrl }
238
238
 
239
+ /** Fetch a single published template by ID (anon-readable). */
240
+ export declare function getPublishedTemplate(options: {
241
+ templateId: string;
242
+ supabaseUrl: string;
243
+ supabaseAnonKey: string;
244
+ }): Promise<PublishedTemplate | null>;
245
+
239
246
  export { InferredSection }
240
247
 
241
248
  export { isBundledAssetUrl }
@@ -245,6 +252,34 @@ export declare function isFontAvailable(fontName: string): boolean;
245
252
 
246
253
  export { isPrivateUrl }
247
254
 
255
+ /**
256
+ * List all published templates for a workspace.
257
+ *
258
+ * ```ts
259
+ * const templates = await listPublishedTemplates({
260
+ * workspaceId: 'your-workspace-uuid',
261
+ * supabaseUrl: 'https://xxx.supabase.co',
262
+ * supabaseAnonKey: 'eyJ...',
263
+ * });
264
+ * ```
265
+ */
266
+ export declare function listPublishedTemplates(options: ListPublishedTemplatesOptions): Promise<PublishedTemplate[]>;
267
+
268
+ export declare interface ListPublishedTemplatesOptions {
269
+ /** Workspace UUID — fetches every published template owned by this workspace. */
270
+ workspaceId: string;
271
+ /** Supabase project URL */
272
+ supabaseUrl: string;
273
+ /** Supabase anon (publishable) key */
274
+ supabaseAnonKey: string;
275
+ /** Optional category filter (e.g. 'social-media', 'invitation') */
276
+ category?: string;
277
+ /** Limit (default: 200, max enforced by PostgREST) */
278
+ limit?: number;
279
+ /** Offset for pagination (default: 0) */
280
+ offset?: number;
281
+ }
282
+
248
283
  /**
249
284
  * Load a Google Font by injecting a <link> stylesheet.
250
285
  * Resolves when the font is ready for use.
@@ -482,6 +517,27 @@ export declare class PixldocsRenderer {
482
517
  private waitForStableTextMetrics;
483
518
  }
484
519
 
520
+ /**
521
+ * Templates Catalog API — list published templates by workspace.
522
+ *
523
+ * Uses the public RLS policy on `templates` (status='published') so this
524
+ * works with the anon key, no auth required.
525
+ */
526
+ export declare interface PublishedTemplate {
527
+ id: string;
528
+ name: string;
529
+ description: string | null;
530
+ category: string;
531
+ thumbnail_url: string | null;
532
+ preview_images: unknown | null;
533
+ price: number;
534
+ download_count: number;
535
+ workspace_id: string | null;
536
+ sort_order: number;
537
+ created_at: string;
538
+ updated_at: string;
539
+ }
540
+
485
541
  export declare interface RendererConfig {
486
542
  /** Supabase project URL for fetching templates */
487
543
  supabaseUrl: string;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { D, F, o, q, s, P, t, u, v, w, x, y, z, B, C, E, G, H, I, J, K, L, b, M, N, O, Q, R, S, U, V, W, X, Y, Z, _ } from "./index-CQGSjfcH.js";
1
+ import { D, F, o, q, s, P, t, u, v, w, x, y, z, B, C, E, G, H, I, J, K, L, b, M, N, O, Q, R, S, U, V, W, X, Y, Z, _, $, a0 } from "./index-oFnROAcT.js";
2
2
  export {
3
3
  D as DEPLOYMENT_VERSION_MARKER,
4
4
  F as FONT_FALLBACK_DEVANAGARI,
@@ -23,18 +23,20 @@ export {
23
23
  K as extractFontFamiliesFromSvgs,
24
24
  L as getEmbeddedJsPDFFontName,
25
25
  b as getProxiedImageUrl,
26
- M as isBundledAssetUrl,
27
- N as isFontAvailable,
28
- O as isPrivateUrl,
29
- Q as loadGoogleFontCSS,
30
- R as normalizeFontFamily,
31
- S as resolveFontWeight,
32
- U as resolveFromForm,
33
- V as resolveTemplateData,
34
- W as rewriteSvgFontsForJsPDF,
35
- X as setAutoShrinkDebug,
36
- Y as setBundledAssetPrefixes,
37
- Z as warmResolvedTemplateForPreview,
38
- _ as warmTemplateFromForm
26
+ M as getPublishedTemplate,
27
+ N as isBundledAssetUrl,
28
+ O as isFontAvailable,
29
+ Q as isPrivateUrl,
30
+ R as listPublishedTemplates,
31
+ S as loadGoogleFontCSS,
32
+ U as normalizeFontFamily,
33
+ V as resolveFontWeight,
34
+ W as resolveFromForm,
35
+ X as resolveTemplateData,
36
+ Y as rewriteSvgFontsForJsPDF,
37
+ Z as setAutoShrinkDebug,
38
+ _ as setBundledAssetPrefixes,
39
+ $ as warmResolvedTemplateForPreview,
40
+ a0 as warmTemplateFromForm
39
41
  };
40
42
  //# sourceMappingURL=index.js.map
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jspdf = require("jspdf");
4
4
  const svg2pdf_js = require("svg2pdf.js");
5
5
  const fabric = require("fabric");
6
- const index = require("./index-B8sm4VZ8.cjs");
6
+ const index = require("./index-DgX2Y94P.cjs");
7
7
  const pdfFonts = require("./pdfFonts-BTEVnYX8.cjs");
8
8
  function _interopNamespaceDefault(e) {
9
9
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
@@ -2519,7 +2519,7 @@ async function fetchSvgAsElement(imageUrl, colorMap) {
2519
2519
  async function getRecoloredSvgDataUrl(imageUrl, colorMap) {
2520
2520
  if (!colorMap || Object.keys(colorMap).length === 0) return null;
2521
2521
  try {
2522
- const { getNormalizedSvgUrl } = await Promise.resolve().then(() => require("./index-B8sm4VZ8.cjs")).then((n) => n.canvasImageLoader);
2522
+ const { getNormalizedSvgUrl } = await Promise.resolve().then(() => require("./index-DgX2Y94P.cjs")).then((n) => n.canvasImageLoader);
2523
2523
  return await getNormalizedSvgUrl(imageUrl, colorMap);
2524
2524
  } catch {
2525
2525
  return null;
@@ -3300,7 +3300,7 @@ async function fetchImageAsBase64(imageUrl, opts = {}) {
3300
3300
  }
3301
3301
  let fetchUrl = imageUrl;
3302
3302
  if (imageUrl.startsWith("http://") || imageUrl.startsWith("https://")) {
3303
- const { isPrivateUrl } = await Promise.resolve().then(() => require("./index-B8sm4VZ8.cjs")).then((n) => n.canvasImageLoader);
3303
+ const { isPrivateUrl } = await Promise.resolve().then(() => require("./index-DgX2Y94P.cjs")).then((n) => n.canvasImageLoader);
3304
3304
  if (isPrivateUrl(imageUrl)) return null;
3305
3305
  const proxyUrl = new URL(`${index.API_URL}/image-proxy`);
3306
3306
  proxyUrl.searchParams.set("url", imageUrl);
@@ -5282,4 +5282,4 @@ exports.exportMultiPagePdf = exportMultiPagePdf;
5282
5282
  exports.logTextMeasurementDiagnostic = logTextMeasurementDiagnostic;
5283
5283
  exports.preparePagesForExport = preparePagesForExport;
5284
5284
  exports.rewriteSvgFontsForJsPDFWithSourceMeta = rewriteSvgFontsForJsPDFWithSourceMeta;
5285
- //# sourceMappingURL=vectorPdfExport-aWseupbk.cjs.map
5285
+ //# sourceMappingURL=vectorPdfExport-Bw2WQNoU.cjs.map