pagepilot-visual-editor 1.0.26 → 1.0.28
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/CHANGELOG.md +49 -0
- package/dist/blocks-internal/block-button/src/index.d.ts +10 -9
- package/dist/blocks-internal/block-button/src/styles.d.ts +5 -0
- package/dist/blocks-internal/block-button-group/src/index.d.ts +6 -0
- package/dist/blocks-internal/block-container/src/index.d.ts +5 -5
- package/dist/blocks-internal/block-heading/src/index.d.ts +30 -1
- package/dist/blocks-internal/block-image/src/index.d.ts +46 -11
- package/dist/blocks-internal/block-logo/src/index.d.ts +17 -11
- package/dist/blocks-internal/block-text/src/index.d.ts +25 -0
- package/dist/blocks-internal/block-video/src/index.d.ts +6 -0
- package/dist/blocks-internal/block-youtube-url/src/index.d.ts +6 -0
- package/dist/editor-sample/App/InspectorDrawer/LayersPanelStyles.d.ts +2 -2
- package/dist/editor-sample/App/shared/editor.styles.d.ts +3 -3
- package/dist/editor-sample/documents/blocks/ButtonGroup/ButtonGroupPropsSchema.d.ts +6 -0
- package/dist/editor-sample/documents/blocks/Container/ContainerPropsSchema.d.ts +1 -1
- package/dist/editor-sample/documents/blocks/Table/TableImportDialog.styles.d.ts +7 -7
- package/dist/editor-sample/documents/blocks/helpers/responsiveStyle.d.ts +3 -16
- package/dist/editor-sample/documents/editor/EditorContext.d.ts +2 -2
- package/dist/editor-sample/documents/editor/core.d.ts +123 -27
- package/dist/email-builder-core/Reader/resolveResponsiveBlock.d.ts +17 -0
- package/dist/email-builder-core/blocks/ButtonGroup/ButtonGroupPropsSchema.d.ts +6 -0
- package/dist/email-builder-core/blocks/Container/ContainerPropsSchema.d.ts +6 -4
- package/dist/email-builder-core/blocks/Container/ContainerReader.d.ts +1 -1
- package/dist/email-builder-core/blocks/EmailLayout/EmailLayoutReader.d.ts +1 -1
- package/dist/email-builder-core/blocks/MenuPicker/MenuPropsSchema.d.ts +12 -0
- package/dist/email-builder-core/blocks/MenuPicker/menuResponsiveCss.d.ts +1 -0
- package/dist/email-builder-core/blocks/Timer/TimerPropsSchema.d.ts +2 -0
- package/dist/email-builder-core/blocks/Timer/variants/CircularProgressView.d.ts +2 -1
- package/dist/email-builder-core/blocks/helpers/blockStyleHelpers.d.ts +37 -1
- package/dist/email-builder-core/renderers/animationCss.d.ts +5 -5
- package/dist/email-builder-core/renderers/pageScripts.d.ts +1 -11
- package/dist/email-builder-core/renderers/renderToStaticMarkup.d.ts +4 -2
- package/dist/email-builder-core/renderers/themeTokens.d.ts +130 -0
- package/dist/host-stubs/modules/settings/settingsSelectors.d.ts +5 -0
- package/dist/host-stubs/style/menu.styled.d.ts +5 -1
- package/dist/host-stubs/view/branding/brandDefaultFont.d.ts +3 -0
- package/dist/host-stubs/view/shared/editors/highlightCode.d.ts +1 -0
- package/dist/{index-BNqa-SV3.cjs → index-Br_dDd3Z.cjs} +359 -1226
- package/dist/{index-C4zNSWXe.js → index-Cp5AeqH5.js} +1 -1
- package/dist/{index-Dk7bp7l0.js → index-DcN8zC8_.js} +24173 -24385
- package/dist/{index-Cu-dtp0Q.cjs → index-SYmY8c1I.cjs} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/render-core/repeatRowManagement.d.ts +96 -0
- package/dist/render-core/stubs/editorContext.d.ts +3 -1
- package/dist/render.cjs +266 -1133
- package/dist/render.d.ts +2 -0
- package/dist/render.js +8969 -8627
- package/dist/renderToStaticHtml.d.ts +9 -1
- package/dist/{xlsx-Cd1etxFW.js → xlsx-Bk2GErZO.js} +1 -1
- package/dist/{xlsx-C6JQXDb3.cjs → xlsx-vznvhtjT.cjs} +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const fe=require("./index-
|
|
1
|
+
"use strict";const fe=require("./index-Br_dDd3Z.cjs"),It=require("./_commonjs-dynamic-modules-DMkBISW1.cjs");function zl(e,n){for(var t=0;t<n.length;t++){const i=n[t];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in e)){const a=Object.getOwnPropertyDescriptor(i,r);a&&Object.defineProperty(e,r,a.get?a:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var nn={},da="1.13.8",Ro=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||Function("return this")()||{},ui=Array.prototype,la=Object.prototype,No=typeof Symbol<"u"?Symbol.prototype:null,Xl=ui.push,Ft=ui.slice,mt=la.toString,Vl=la.hasOwnProperty,ku=typeof ArrayBuffer<"u",Hl=typeof DataView<"u",$l=Array.isArray,Io=Object.keys,Lo=Object.create,Mo=ku&&ArrayBuffer.isView,Gl=isNaN,Zl=isFinite,Wu=!{toString:null}.propertyIsEnumerable("toString"),qo=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],Yl=Math.pow(2,53)-1;function Me(e,n){return n=n==null?e.length-1:+n,function(){for(var t=Math.max(arguments.length-n,0),i=Array(t),r=0;r<t;r++)i[r]=arguments[r+n];switch(n){case 0:return e.call(this,i);case 1:return e.call(this,arguments[0],i);case 2:return e.call(this,arguments[0],arguments[1],i)}var a=Array(n+1);for(r=0;r<n;r++)a[r]=arguments[r];return a[n]=i,e.apply(this,a)}}function An(e){var n=typeof e;return n==="function"||n==="object"&&!!e}function Ou(e){return e===null}function fa(e){return e===void 0}function ha(e){return e===!0||e===!1||mt.call(e)==="[object Boolean]"}function Ru(e){return!!(e&&e.nodeType===1)}function Ie(e){var n="[object "+e+"]";return function(t){return mt.call(t)===n}}const si=Ie("String"),pa=Ie("Number"),Nu=Ie("Date"),Iu=Ie("RegExp"),Lu=Ie("Error"),ga=Ie("Symbol"),ma=Ie("ArrayBuffer");var Mu=Ie("Function"),Kl=Ro.document&&Ro.document.childNodes;typeof/./!="function"&&typeof Int8Array!="object"&&typeof Kl!="function"&&(Mu=function(e){return typeof e=="function"||!1});const Ne=Mu,qu=Ie("Object");var Pu=Hl&&(!/\[native code\]/.test(String(DataView))||qu(new DataView(new ArrayBuffer(8)))),ba=typeof Map<"u"&&qu(new Map),Ql=Ie("DataView");function Jl(e){return e!=null&&Ne(e.getInt8)&&ma(e.buffer)}const bt=Pu?Jl:Ql,Fn=$l||Ie("Array");function Cn(e,n){return e!=null&&Vl.call(e,n)}var aa=Ie("Arguments");(function(){aa(arguments)||(aa=function(e){return Cn(e,"callee")})})();const di=aa;function ju(e){return!ga(e)&&Zl(e)&&!isNaN(parseFloat(e))}function ya(e){return pa(e)&&Gl(e)}function Da(e){return function(){return e}}function zu(e){return function(n){var t=e(n);return typeof t=="number"&&t>=0&&t<=Yl}}function Xu(e){return function(n){return n==null?void 0:n[e]}}const Zt=Xu("byteLength"),ef=zu(Zt);var nf=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;function tf(e){return Mo?Mo(e)&&!bt(e):ef(e)&&nf.test(mt.call(e))}const va=ku?tf:Da(!1),Re=Xu("length");function rf(e){for(var n={},t=e.length,i=0;i<t;++i)n[e[i]]=!0;return{contains:function(r){return n[r]===!0},push:function(r){return n[r]=!0,e.push(r)}}}function Vu(e,n){n=rf(n);var t=qo.length,i=e.constructor,r=Ne(i)&&i.prototype||la,a="constructor";for(Cn(e,a)&&!n.contains(a)&&n.push(a);t--;)a=qo[t],a in e&&e[a]!==r[a]&&!n.contains(a)&&n.push(a)}function Ee(e){if(!An(e))return[];if(Io)return Io(e);var n=[];for(var t in e)Cn(e,t)&&n.push(t);return Wu&&Vu(e,n),n}function Hu(e){if(e==null)return!0;var n=Re(e);return typeof n=="number"&&(Fn(e)||si(e)||di(e))?n===0:Re(Ee(e))===0}function xa(e,n){var t=Ee(n),i=t.length;if(e==null)return!i;for(var r=Object(e),a=0;a<i;a++){var o=t[a];if(n[o]!==r[o]||!(o in r))return!1}return!0}function ye(e){if(e instanceof ye)return e;if(!(this instanceof ye))return new ye(e);this._wrapped=e}ye.VERSION=da;ye.prototype.value=function(){return this._wrapped};ye.prototype.valueOf=ye.prototype.toJSON=ye.prototype.value;ye.prototype.toString=function(){return String(this._wrapped)};function Po(e){return new Uint8Array(e.buffer||e,e.byteOffset||0,Zt(e))}var jo="[object DataView]";function $u(e,n){for(var t=[{a:e,b:n}],i=[],r=[];t.length;){var a=t.pop();if(a===!0){i.pop(),r.pop();continue}if(e=a.a,n=a.b,e===n){if(e!==0||1/e===1/n)continue;return!1}if(e==null||n==null)return!1;if(e!==e){if(n!==n)continue;return!1}var o=typeof e;if(o!=="function"&&o!=="object"&&typeof n!="object")return!1;e instanceof ye&&(e=e._wrapped),n instanceof ye&&(n=n._wrapped);var c=mt.call(e);if(c!==mt.call(n))return!1;if(Pu&&c=="[object Object]"&&bt(e)){if(!bt(n))return!1;c=jo}switch(c){case"[object RegExp]":case"[object String]":if(""+e==""+n)continue;return!1;case"[object Number]":t.push({a:+e,b:+n});continue;case"[object Date]":case"[object Boolean]":if(+e==+n)continue;return!1;case"[object Symbol]":if(No.valueOf.call(e)===No.valueOf.call(n))continue;return!1;case"[object ArrayBuffer]":case jo:t.push({a:Po(e),b:Po(n)});continue}var u=c==="[object Array]";if(!u&&va(e)){var s=Zt(e);if(s!==Zt(n))return!1;if(e.buffer===n.buffer&&e.byteOffset===n.byteOffset)continue;u=!0}if(!u){if(typeof e!="object"||typeof n!="object")return!1;var d=e.constructor,p=n.constructor;if(d!==p&&!(Ne(d)&&d instanceof d&&Ne(p)&&p instanceof p)&&"constructor"in e&&"constructor"in n)return!1}for(var b=i.length;b--;)if(i[b]===e){if(r[b]===n)break;return!1}if(!(b>=0))if(i.push(e),r.push(n),t.push(!0),u){if(b=e.length,b!==n.length)return!1;for(;b--;)t.push({a:e[b],b:n[b]})}else{var m=Ee(e),y;if(b=m.length,Ee(n).length!==b)return!1;for(;b--;){if(y=m[b],!Cn(n,y))return!1;t.push({a:e[y],b:n[y]})}}}return!0}function it(e){if(!An(e))return[];var n=[];for(var t in e)n.push(t);return Wu&&Vu(e,n),n}function _a(e){var n=Re(e);return function(t){if(t==null)return!1;var i=it(t);if(Re(i))return!1;for(var r=0;r<n;r++)if(!Ne(t[e[r]]))return!1;return e!==Yu||!Ne(t[Ua])}}var Ua="forEach",Gu="has",Ta=["clear","delete"],Zu=["get",Gu,"set"],af=Ta.concat(Ua,Zu),Yu=Ta.concat(Zu),of=["add"].concat(Ta,Ua,Gu);const Ku=ba?_a(af):Ie("Map"),Qu=ba?_a(Yu):Ie("WeakMap"),Ju=ba?_a(of):Ie("Set"),es=Ie("WeakSet");function Ln(e){for(var n=Ee(e),t=n.length,i=Array(t),r=0;r<t;r++)i[r]=e[n[r]];return i}function ns(e){for(var n=Ee(e),t=n.length,i=Array(t),r=0;r<t;r++)i[r]=[n[r],e[n[r]]];return i}function wa(e){for(var n={},t=Ee(e),i=0,r=t.length;i<r;i++)n[e[t[i]]]=t[i];return n}function yt(e){var n=[];for(var t in e)Ne(e[t])&&n.push(t);return n.sort()}function Ea(e,n){return function(t){var i=arguments.length;if(n&&(t=Object(t)),i<2||t==null)return t;for(var r=1;r<i;r++)for(var a=arguments[r],o=e(a),c=o.length,u=0;u<c;u++){var s=o[u];(!n||t[s]===void 0)&&(t[s]=a[s])}return t}}const Aa=Ea(it),Yn=Ea(Ee),Fa=Ea(it,!0);function cf(){return function(){}}function ts(e){if(!An(e))return{};if(Lo)return Lo(e);var n=cf();n.prototype=e;var t=new n;return n.prototype=null,t}function is(e,n){var t=ts(e);return n&&Yn(t,n),t}function rs(e){return An(e)?Fn(e)?e.slice():Aa({},e):e}function as(e,n){return n(e),e}function Ca(e){return Fn(e)?e:[e]}ye.toPath=Ca;function Ct(e){return ye.toPath(e)}function Sa(e,n){for(var t=n.length,i=0;i<t;i++){if(e==null)return;e=e[n[i]]}return t?e:void 0}function Ba(e,n,t){var i=Sa(e,Ct(n));return fa(i)?t:i}function os(e,n){n=Ct(n);for(var t=n.length,i=0;i<t;i++){var r=n[i];if(!Cn(e,r))return!1;e=e[r]}return!!t}function li(e){return e}function On(e){return e=Yn({},e),function(n){return xa(n,e)}}function fi(e){return e=Ct(e),function(n){return Sa(n,e)}}function St(e,n,t){if(n===void 0)return e;switch(t??3){case 1:return function(i){return e.call(n,i)};case 3:return function(i,r,a){return e.call(n,i,r,a)};case 4:return function(i,r,a,o){return e.call(n,i,r,a,o)}}return function(){return e.apply(n,arguments)}}function cs(e,n,t){return e==null?li:Ne(e)?St(e,n,t):An(e)&&!Fn(e)?On(e):fi(e)}function hi(e,n){return cs(e,n,1/0)}ye.iteratee=hi;function ze(e,n,t){return ye.iteratee!==hi?ye.iteratee(e,n):cs(e,n,t)}function us(e,n,t){n=ze(n,t);for(var i=Ee(e),r=i.length,a={},o=0;o<r;o++){var c=i[o];a[c]=n(e[c],c,e)}return a}function ka(){}function ss(e){return e==null?ka:function(n){return Ba(e,n)}}function ds(e,n,t){var i=Array(Math.max(0,e));n=St(n,t,1);for(var r=0;r<e;r++)i[r]=n(r);return i}function Yt(e,n){return n==null&&(n=e,e=0),e+Math.floor(Math.random()*(n-e+1))}const Kn=Date.now||function(){return new Date().getTime()};function ls(e){var n=function(a){return e[a]},t="(?:"+Ee(e).join("|")+")",i=RegExp(t),r=RegExp(t,"g");return function(a){return a=a==null?"":""+a,i.test(a)?a.replace(r,n):a}}const fs={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},hs=ls(fs),uf=wa(fs),ps=ls(uf),gs=ye.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var Yi=/(.)^/,sf={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},df=/\\|'|\r|\n|\u2028|\u2029/g;function lf(e){return"\\"+sf[e]}var ff=/^\s*(\w|\$)+\s*$/;function ms(e,n,t){!n&&t&&(n=t),n=Fa({},n,ye.templateSettings);var i=RegExp([(n.escape||Yi).source,(n.interpolate||Yi).source,(n.evaluate||Yi).source].join("|")+"|$","g"),r=0,a="__p+='";e.replace(i,function(s,d,p,b,m){return a+=e.slice(r,m).replace(df,lf),r=m+s.length,d?a+=`'+
|
|
2
2
|
((__t=(`+d+`))==null?'':_.escape(__t))+
|
|
3
3
|
'`:p?a+=`'+
|
|
4
4
|
((__t=(`+p+`))==null?'':__t)+
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-Br_dDd3Z.cjs");exports.EditorContext=e.EditorContext;exports.PagePilotEditor=e.PagePilotEditor;exports.PagepilotApiClient=e.PagepilotApiClient;exports.Reader=e.Reader;exports.ReaderBlock=e.ReaderBlock;exports.ReaderBlockSchema=e.ReaderBlockSchema;exports.ReaderDocumentSchema=e.ReaderDocumentSchema;exports.extractApiRows=e.extractApiRows;exports.pagePilotEditorDarkTheme=e.pagePilotEditorDarkTheme;exports.pagePilotEditorLightTheme=e.pagePilotEditorLightTheme;exports.refreshApiDataSources=e.refreshApiDataSources;exports.refreshDocumentApiDataSources=e.refreshDocumentApiDataSources;exports.renderToStaticHtml=e.renderToStaticHtml;exports.renderToStaticMarkup=e.renderToStaticMarkup;exports.resetDocument=e.resetDocument;exports.resetPagePilotEditorTranslations=e.resetPagePilotEditorTranslations;exports.setDocument=e.setDocument;exports.setPagePilotEditorTranslations=e.setPagePilotEditorTranslations;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as t, P as s, b as r, R as o, d as i, e as c, f as d, h as l, p as n, i as m, r as p, j as P, k as h, l as g, m as u, n as D, s as E, o as R } from "./index-
|
|
1
|
+
import { E as t, P as s, b as r, R as o, d as i, e as c, f as d, h as l, p as n, i as m, r as p, j as P, k as h, l as g, m as u, n as D, s as E, o as R } from "./index-DcN8zC8_.js";
|
|
2
2
|
export {
|
|
3
3
|
t as EditorContext,
|
|
4
4
|
s as PagePilotEditor,
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
export type TemplateArrayRow = Record<string, string>;
|
|
2
|
+
/**
|
|
3
|
+
* Deep-clone a subtree under fresh block ids. Returns the new blocks keyed
|
|
4
|
+
* by new id, the idMap (oldId → newId) and the new root id. Pure — caller
|
|
5
|
+
* splices.
|
|
6
|
+
*/
|
|
7
|
+
export declare function cloneSubtree(documentTree: Record<string, any>, rootId: string): {
|
|
8
|
+
newBlocks: Record<string, any>;
|
|
9
|
+
idMap: Record<string, string>;
|
|
10
|
+
newRootId: string;
|
|
11
|
+
};
|
|
12
|
+
export declare function insertDocument(documentTree: Record<string, any>, targetChildId: string, insertedChildId: string): {
|
|
13
|
+
parentId: string;
|
|
14
|
+
updatedParent: any;
|
|
15
|
+
} | null;
|
|
16
|
+
/**
|
|
17
|
+
* Materialize one repeat row: clone the `sourceBlockId` subtree and place
|
|
18
|
+
* the clone after `afterBlockId` (the previous row's block). Returns the
|
|
19
|
+
* updated document + the new clone's root id, or `null` when the
|
|
20
|
+
* container has no room and can't auto-grow (caller decides whether to
|
|
21
|
+
* grow the container first via `growContainerToFit` and retry).
|
|
22
|
+
*/
|
|
23
|
+
export declare function addRepeatRow(documentTree: Record<string, any>, sourceBlockId: string, afterBlockId: string): {
|
|
24
|
+
updatedDocument: Record<string, any>;
|
|
25
|
+
newRootId: string;
|
|
26
|
+
} | null;
|
|
27
|
+
/**
|
|
28
|
+
* Remove a set of block ids and filter them out of every parent's
|
|
29
|
+
* child-id arrays. Used to delete a repeat row's cloned container
|
|
30
|
+
* subtree.
|
|
31
|
+
*/
|
|
32
|
+
export declare function removeSubtree(documentTree: Record<string, any>, idsToRemove: Set<string>): Record<string, any>;
|
|
33
|
+
export type RepeatableSlot = {
|
|
34
|
+
childrenIds: string[];
|
|
35
|
+
};
|
|
36
|
+
export type RepeatableContainerInfo = {
|
|
37
|
+
containerId: string;
|
|
38
|
+
type: "Grid" | "FlexColumns" | "Carousel" | "Marquee" | "Pagination" | "TabsBlock";
|
|
39
|
+
slotCount: number;
|
|
40
|
+
slots: RepeatableSlot[];
|
|
41
|
+
firstFilledSlot: number;
|
|
42
|
+
emptySlotCount: number;
|
|
43
|
+
};
|
|
44
|
+
export declare function isRepeatableContainerType(type: string | undefined): boolean;
|
|
45
|
+
export declare function getRepeatableContainerInfo(documentTree: Record<string, any>, containerId: string): RepeatableContainerInfo | null;
|
|
46
|
+
/** Find the repeatable container whose slots hold `childId`. */
|
|
47
|
+
export declare function findRepeatableContainerOf(documentTree: Record<string, any>, childId: string): string | null;
|
|
48
|
+
/**
|
|
49
|
+
* Grow a repeatable container so it has at least `neededSlots` slots.
|
|
50
|
+
* Grid is the one two-axis case needing a `direction` choice (no default
|
|
51
|
+
* encoded in the pure logic — there's no human to ask at serve time, so
|
|
52
|
+
* callers must pass one explicitly). Every other container type ignores
|
|
53
|
+
* `direction` and grows its single axis. Capped by each block type's
|
|
54
|
+
* schema max (Carousel 20, Marquee 30, TabsBlock 10) — returns the
|
|
55
|
+
* unchanged document if the cap is already hit.
|
|
56
|
+
*/
|
|
57
|
+
export declare function growContainerToFit(documentTree: Record<string, any>, containerId: string, neededSlots: number, direction: "rows" | "columns"): Record<string, any>;
|
|
58
|
+
/**
|
|
59
|
+
* Shrink a repeatable container back down to `neededSlots`. Only trailing
|
|
60
|
+
* EMPTY slots are dropped — a filled slot always stops the shrink, so
|
|
61
|
+
* authored content already emptied by a prior `removeSubtree` call is what
|
|
62
|
+
* actually gets trimmed here, never content that's still in use.
|
|
63
|
+
*/
|
|
64
|
+
export declare function shrinkContainerToFit(documentTree: Record<string, any>, containerId: string, neededSlots: number): Record<string, any>;
|
|
65
|
+
export interface ReconcileRowCountResult {
|
|
66
|
+
/** Updated document tree (same reference as input if nothing changed). */
|
|
67
|
+
document: Record<string, any>;
|
|
68
|
+
/** The field's new sourceBlockId (only ever changes if row 0 itself had to move — in
|
|
69
|
+
* practice it never does; kept for symmetry/future-proofing). */
|
|
70
|
+
sourceBlockId: string;
|
|
71
|
+
/** The field's new rowIds (one per materialized row beyond row 0). */
|
|
72
|
+
rowIds: string[];
|
|
73
|
+
/** How many rows are actually materialized after this call (1 + rowIds.length). */
|
|
74
|
+
achievedRowCount: number;
|
|
75
|
+
/** True if `achievedRowCount < targetRowCount` — the container ran out of room
|
|
76
|
+
* and could not grow further (e.g. a full non-auto-growing Grid/Carousel/Marquee). */
|
|
77
|
+
capacityLimited: boolean;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Reconcile a container-repeat field's materialized row-block count to
|
|
81
|
+
* exactly `targetRowCount`. Grows by cloning (`addRepeatRow`, growing the
|
|
82
|
+
* container first via `growContainerToFit` if every slot is already full)
|
|
83
|
+
* or shrinks by removing trailing rows' subtrees (`removeSubtree` +
|
|
84
|
+
* `shrinkContainerToFit`). Never touches row 0 (the field's own
|
|
85
|
+
* `sourceBlockId`) — `targetRowCount` is clamped to at least 1.
|
|
86
|
+
*
|
|
87
|
+
* Pure: does not mutate `documentTree`. Fails open in the sense that if
|
|
88
|
+
* growth runs out of room partway through, it returns whatever was
|
|
89
|
+
* achieved (`capacityLimited: true`) rather than throwing — callers decide
|
|
90
|
+
* how to handle a partial reconciliation (e.g. drop the data beyond what
|
|
91
|
+
* fit, log a warning).
|
|
92
|
+
*/
|
|
93
|
+
export declare function reconcileRepeatFieldRowCount(documentTree: Record<string, any>, field: {
|
|
94
|
+
sourceBlockId?: string;
|
|
95
|
+
rowIds?: string[];
|
|
96
|
+
}, targetRowCount: number, growDirection?: "rows" | "columns"): ReconcileRowCountResult | null;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** Set by renderToStaticHtml for the duration of one synchronous render. */
|
|
2
|
+
export declare function setRenderRecordType(next: string | null): void;
|
|
3
|
+
/** Reader-side view of `currentRecordType` — whatever renderToStaticHtml set, else `null`. */
|
|
2
4
|
export declare function useCurrentRecordType(): string | null;
|
|
3
5
|
/**
|
|
4
6
|
* Reader-side view of `selectedScreenSize`. Static "desktop" — the render
|