pagepilot-visual-editor 1.0.25 → 1.0.26
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/blocks-internal/block-list/src/index.d.ts +1 -1
- package/dist/blocks-internal/block-stepper/src/index.d.ts +1 -1
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/FormsPickerSidebarPanel.d.ts +1 -0
- package/dist/editor-sample/App/InspectorDrawer/ConfigurationPanel/input-panels/helpers/inputs/ColorInput/Picker.d.ts +4 -1
- package/dist/editor-sample/App/InspectorDrawer/LayersPanelStyles.d.ts +1 -1
- package/dist/editor-sample/App/InspectorDrawer/LayoutPanel/templateApplyHelpers.d.ts +22 -4
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/GroupBlockPreview.d.ts +7 -0
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/ItemsArrayRepeatSection.d.ts +14 -0
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/ScalarDataReferencePanel.d.ts +24 -0
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/ScalarFieldRow.d.ts +12 -0
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/VariableGroupList.d.ts +8 -0
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/VariablesPanelContext.d.ts +10 -0
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/dataReferenceUtils.d.ts +24 -6
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/index.d.ts +8 -1
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/repeatRowActions.d.ts +27 -0
- package/dist/editor-sample/App/InspectorDrawer/VariablesPanel/styles.d.ts +20 -0
- package/dist/editor-sample/App/InspectorDrawer/components/DateFieldControls.d.ts +12 -0
- package/dist/editor-sample/App/InspectorDrawer/components/DateTimeFieldControls.d.ts +14 -0
- package/dist/editor-sample/App/InspectorDrawer/components/TimeFieldControls.d.ts +12 -0
- package/dist/editor-sample/App/shared/editor.styles.d.ts +2 -2
- package/dist/editor-sample/documents/blocks/FormsPicker/FormsPropsSchema.d.ts +2 -0
- package/dist/editor-sample/documents/blocks/Table/TableImportDialog.styles.d.ts +4 -4
- package/dist/editor-sample/documents/blocks/TabsBlock/TabsBlockPropsSchema.d.ts +14 -0
- package/dist/editor-sample/documents/blocks/helpers/EditorChildrenIds/AddBlockMenu/blockMenuStyles.d.ts +2 -0
- package/dist/editor-sample/documents/blocks/helpers/EditorChildrenIds/AddBlockMenu/buttons.d.ts +3 -4
- package/dist/editor-sample/documents/blocks/helpers/InlineTextToolbar/hooks/useToolbarCommands.d.ts +17 -1
- package/dist/editor-sample/documents/blocks/helpers/InlineTextToolbar/popovers/ResponsiveFontSizePopover.d.ts +43 -0
- package/dist/editor-sample/documents/blocks/helpers/InlineTextToolbar/types.d.ts +7 -0
- package/dist/editor-sample/documents/blocks/helpers/documentUtils.d.ts +93 -2
- package/dist/editor-sample/documents/blocks/helpers/responsiveFontSizeCss.d.ts +72 -0
- package/dist/editor-sample/documents/blocks/helpers/variableBinding.d.ts +5 -0
- package/dist/editor-sample/documents/editor/core.d.ts +17 -2
- package/dist/editor-sample/documents/editor/templateVariables.d.ts +3 -3
- package/dist/email-builder-core/blocks/FormsPicker/FormsPropsSchema.d.ts +1 -0
- package/dist/email-builder-core/blocks/TabsBlock/TabsBlockPropsSchema.d.ts +14 -0
- package/dist/email-builder-core/renderers/pageScripts.d.ts +1 -0
- package/dist/email-builder-core/utils/substituteTemplateVars.d.ts +32 -0
- package/dist/host-stubs/view/shared/common/InfoTooltip.d.ts +19 -0
- package/dist/host-stubs/view/shared/timeZones.d.ts +4 -0
- package/dist/{index-RcTlEXS2.cjs → index-BNqa-SV3.cjs} +317 -288
- package/dist/{index-uAL1Hpt1.js → index-C4zNSWXe.js} +1 -1
- package/dist/{index-Cx_nuxVE.cjs → index-Cu-dtp0Q.cjs} +1 -1
- package/dist/{index-txCEAgzG.js → index-Dk7bp7l0.js} +29768 -26808
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +15 -12
- package/dist/render-core/apiDataSource.d.ts +50 -0
- package/dist/render-core/dateFormats.d.ts +67 -0
- package/dist/render-core/templateBaking.d.ts +105 -2
- package/dist/render.cjs +178 -155
- package/dist/render.d.ts +2 -2
- package/dist/render.js +6359 -5690
- package/dist/renderToStaticHtml.d.ts +58 -3
- package/dist/{xlsx-CMNIZUaT.cjs → xlsx-C6JQXDb3.cjs} +1 -1
- package/dist/{xlsx-DSQPVb8u.js → xlsx-Cd1etxFW.js} +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { TReaderDocument } from './email-builder-core';
|
|
2
2
|
import { TemplateFormField } from './render-core/templateBaking';
|
|
3
|
+
import { refreshApiDataSources, refreshDocumentApiDataSources, extractApiRows, RefreshApiDataSourcesOptions, RefreshApiDataSourcesResult } from './render-core/apiDataSource';
|
|
3
4
|
interface BaseRenderOptions {
|
|
4
5
|
/** Root block id inside the document. Defaults to `"root"`. */
|
|
5
6
|
rootBlockId?: string;
|
|
@@ -27,17 +28,38 @@ interface ApiCommonOptions extends BaseRenderOptions {
|
|
|
27
28
|
/** Optional custom fetch. Defaults to global `fetch`. */
|
|
28
29
|
fetchFn?: typeof fetch;
|
|
29
30
|
}
|
|
31
|
+
interface ApiDataSourceOptions {
|
|
32
|
+
/**
|
|
33
|
+
* When `true`, re-fetch every `formFields[]` entry whose
|
|
34
|
+
* `dataSource.type === 'api'` right before baking, and use the fresh
|
|
35
|
+
* response rows instead of the document's saved `value`. Defaults to
|
|
36
|
+
* `false` (no extra network calls; renders exactly what was saved).
|
|
37
|
+
*/
|
|
38
|
+
refreshApiDataSources?: boolean;
|
|
39
|
+
/** Extra headers sent with every API-datasource GET (e.g. auth for a private API). */
|
|
40
|
+
apiDataSourceHeaders?: Record<string, string>;
|
|
41
|
+
/** Per-API-datasource-request timeout in ms. Defaults to 10000. */
|
|
42
|
+
apiDataSourceTimeoutMs?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Called for each `api` datasource field that fails to refresh (bad URL,
|
|
45
|
+
* network error, non-OK status, no array in the response). That field
|
|
46
|
+
* keeps its last-saved `value` and the render still completes.
|
|
47
|
+
*/
|
|
48
|
+
onApiDataSourceError?: (field: TemplateFormField, error: Error) => void;
|
|
49
|
+
}
|
|
30
50
|
export interface RenderToStaticHtmlSyncOptions extends BaseRenderOptions {
|
|
31
51
|
pageId?: undefined;
|
|
52
|
+
pagePath?: undefined;
|
|
32
53
|
templateId?: undefined;
|
|
33
54
|
baseUrl?: undefined;
|
|
34
55
|
tenantId?: undefined;
|
|
35
56
|
authToken?: undefined;
|
|
36
57
|
variables?: undefined;
|
|
37
58
|
}
|
|
38
|
-
export interface RenderToStaticHtmlPageOptions extends ApiCommonOptions {
|
|
59
|
+
export interface RenderToStaticHtmlPageOptions extends ApiCommonOptions, ApiDataSourceOptions {
|
|
39
60
|
/** Page id (`_id`) to fetch and render. */
|
|
40
61
|
pageId: string;
|
|
62
|
+
pagePath?: undefined;
|
|
41
63
|
templateId?: undefined;
|
|
42
64
|
/** Required for the tenant-scoped page endpoint. */
|
|
43
65
|
tenantId: string;
|
|
@@ -48,10 +70,33 @@ export interface RenderToStaticHtmlPageOptions extends ApiCommonOptions {
|
|
|
48
70
|
wrapInDocumentShell?: boolean;
|
|
49
71
|
variables?: undefined;
|
|
50
72
|
}
|
|
73
|
+
export interface RenderToStaticHtmlPagePathOptions extends ApiCommonOptions, ApiDataSourceOptions {
|
|
74
|
+
/**
|
|
75
|
+
* Page slug/path to fetch via `/tenant/:tenantId/pagebypath/:pagePath` —
|
|
76
|
+
* the route external embedders use. Response is shaped
|
|
77
|
+
* `{ payload: { sections: [...], metaTitle, ... } }`.
|
|
78
|
+
*/
|
|
79
|
+
pagePath: string;
|
|
80
|
+
pageId?: undefined;
|
|
81
|
+
templateId?: undefined;
|
|
82
|
+
/** Required — the pagebypath endpoint is tenant-scoped. */
|
|
83
|
+
tenantId: string;
|
|
84
|
+
/**
|
|
85
|
+
* Wrap concatenated section fragments in a `<!doctype html>` shell.
|
|
86
|
+
* Defaults to `true`.
|
|
87
|
+
*/
|
|
88
|
+
wrapInDocumentShell?: boolean;
|
|
89
|
+
/** Forwarded as `?cache=` on the request. Defaults to `false`. */
|
|
90
|
+
cache?: boolean;
|
|
91
|
+
/** Forwarded as `?update=` on the request. Defaults to `true`. */
|
|
92
|
+
update?: boolean;
|
|
93
|
+
variables?: undefined;
|
|
94
|
+
}
|
|
51
95
|
export interface RenderToStaticHtmlTemplateOptions extends ApiCommonOptions {
|
|
52
96
|
/** Template id (`_id`) to fetch. */
|
|
53
97
|
templateId: string;
|
|
54
98
|
pageId?: undefined;
|
|
99
|
+
pagePath?: undefined;
|
|
55
100
|
/**
|
|
56
101
|
* Variable overrides. Two shapes accepted:
|
|
57
102
|
*
|
|
@@ -80,17 +125,25 @@ export interface RenderToStaticHtmlTemplateOptions extends ApiCommonOptions {
|
|
|
80
125
|
*/
|
|
81
126
|
isGlobal?: boolean;
|
|
82
127
|
}
|
|
83
|
-
export type RenderToStaticHtmlOptions = RenderToStaticHtmlSyncOptions | RenderToStaticHtmlPageOptions | RenderToStaticHtmlTemplateOptions;
|
|
128
|
+
export type RenderToStaticHtmlOptions = RenderToStaticHtmlSyncOptions | RenderToStaticHtmlPageOptions | RenderToStaticHtmlPagePathOptions | RenderToStaticHtmlTemplateOptions;
|
|
84
129
|
/**
|
|
85
130
|
* Render a document configuration to HTML.
|
|
86
131
|
*
|
|
87
132
|
* @example Sync (no API):
|
|
88
133
|
* const generatedHtml = renderToStaticHtml(CONFIGURATION, { rootBlockId: 'root' });
|
|
89
134
|
*
|
|
90
|
-
* @example Page from API (async):
|
|
135
|
+
* @example Page from API by id (async):
|
|
91
136
|
* const generatedHtml = await renderToStaticHtml(CONFIGURATION, {
|
|
92
137
|
* rootBlockId: 'root',
|
|
93
138
|
* pageId, baseUrl, tenantId, authToken,
|
|
139
|
+
* refreshApiDataSources: true, // re-fetch `dataSource.type === 'api'` fields first
|
|
140
|
+
* });
|
|
141
|
+
*
|
|
142
|
+
* @example Page from API by slug/path, via `pagebypath` (async):
|
|
143
|
+
* const generatedHtml = await renderToStaticHtml(CONFIGURATION, {
|
|
144
|
+
* rootBlockId: 'root',
|
|
145
|
+
* pagePath: 'finance-industry-pagea', baseUrl, tenantId, authToken,
|
|
146
|
+
* refreshApiDataSources: true,
|
|
94
147
|
* });
|
|
95
148
|
*
|
|
96
149
|
* @example Template from API with variable substitution (async):
|
|
@@ -103,5 +156,7 @@ export type RenderToStaticHtmlOptions = RenderToStaticHtmlSyncOptions | RenderTo
|
|
|
103
156
|
*/
|
|
104
157
|
export declare function renderToStaticHtml(CONFIGURATION: TReaderDocument | any, options: RenderToStaticHtmlSyncOptions): string;
|
|
105
158
|
export declare function renderToStaticHtml(CONFIGURATION: TReaderDocument | any | null | undefined, options: RenderToStaticHtmlPageOptions): Promise<string>;
|
|
159
|
+
export declare function renderToStaticHtml(CONFIGURATION: TReaderDocument | any | null | undefined, options: RenderToStaticHtmlPagePathOptions): Promise<string>;
|
|
106
160
|
export declare function renderToStaticHtml(CONFIGURATION: TReaderDocument | any | null | undefined, options: RenderToStaticHtmlTemplateOptions): Promise<string>;
|
|
107
161
|
export default renderToStaticHtml;
|
|
162
|
+
export { refreshApiDataSources, refreshDocumentApiDataSources, extractApiRows, type RefreshApiDataSourcesOptions, type RefreshApiDataSourcesResult, };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const $0=require("./index-
|
|
1
|
+
"use strict";const $0=require("./index-BNqa-SV3.cjs"),B0=require("./_commonjs-dynamic-modules-DMkBISW1.cjs");function op(i0,Wr){for(var l=0;l<Wr.length;l++){const x=Wr[l];if(typeof x!="string"&&!Array.isArray(x)){for(const a in x)if(a!=="default"&&!(a in i0)){const e=Object.getOwnPropertyDescriptor(x,a);e&&Object.defineProperty(i0,a,e.get?e:{enumerable:!0,get:()=>x[a]})}}}return Object.freeze(Object.defineProperty(i0,Symbol.toStringTag,{value:"Module"}))}var gi={exports:{}},xi={exports:{}},Ef;function Cf(){return Ef||(Ef=1,function(i0){var Wr={version:"1.14.0"};Wr[437]=function(){for(var l=`\0\x07\b
|
|
2
2
|
\v\f\r\x1B !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ `,x=[],a={},e=0;e!=l.length;++e)l.charCodeAt(e)!==65533&&(a[l.charAt(e)]=e),x[e]=l.charAt(e);return{enc:a,dec:x}}(),Wr[620]=function(){for(var l=`\0\x07\b
|
|
3
3
|
\v\f\r\x1B !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàąçêëèïîćÄĄĘęłôöĆûùŚÖܢ٥śƒŹŻóÓńŃźż¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ `,x=[],a={},e=0;e!=l.length;++e)l.charCodeAt(e)!==65533&&(a[l.charAt(e)]=e),x[e]=l.charAt(e);return{enc:a,dec:x}}(),Wr[737]=function(){for(var l=`\0\x07\b
|
|
4
4
|
\v\f\r\x1B !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ `,x=[],a={},e=0;e!=l.length;++e)l.charCodeAt(e)!==65533&&(a[l.charAt(e)]=e),x[e]=l.charAt(e);return{enc:a,dec:x}}(),Wr[850]=function(){for(var l=`\0\x07\b
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pagepilot-visual-editor",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.26",
|
|
4
4
|
"description": "Standalone visual editor — drop <PagePilotEditor> into any React app and get Style/Layout/Inspect/Layers panels, drag-and-drop blocks, undo/redo, dirty-tracked save, multi-section pages, and light/dark themes",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|