@floegence/redevplugin-ui 3.2.0 → 3.3.1

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,233 +0,0 @@
1
- // Code generated by scripts/generate_ui_contracts.mjs; DO NOT EDIT.
2
- export const opaqueSurfaceAllowedTags = [
3
- "main",
4
- "section",
5
- "header",
6
- "footer",
7
- "nav",
8
- "aside",
9
- "article",
10
- "div",
11
- "span",
12
- "p",
13
- "h1",
14
- "h2",
15
- "h3",
16
- "h4",
17
- "h5",
18
- "h6",
19
- "button",
20
- "input",
21
- "textarea",
22
- "select",
23
- "option",
24
- "label",
25
- "fieldset",
26
- "legend",
27
- "form",
28
- "ul",
29
- "ol",
30
- "li",
31
- "dl",
32
- "dt",
33
- "dd",
34
- "table",
35
- "thead",
36
- "tbody",
37
- "tfoot",
38
- "tr",
39
- "th",
40
- "td",
41
- "caption",
42
- "details",
43
- "summary",
44
- "pre",
45
- "code",
46
- "kbd",
47
- "samp",
48
- "strong",
49
- "em",
50
- "small",
51
- "mark",
52
- "time",
53
- "progress",
54
- "meter",
55
- "img",
56
- "picture",
57
- "source",
58
- "audio",
59
- "video",
60
- "track",
61
- "canvas"
62
- ];
63
- export const opaqueSurfaceGlobalAttributes = [
64
- "id",
65
- "class",
66
- "role",
67
- "title",
68
- "hidden",
69
- "tabindex",
70
- "autofocus",
71
- "lang",
72
- "dir",
73
- "data-redevplugin-action",
74
- "data-redevplugin-escape-action",
75
- "data-redevplugin-asset-binding",
76
- "data-redevplugin-asset-attr"
77
- ];
78
- export const opaqueSurfaceTagAttributes = {
79
- "button": [
80
- "type",
81
- "name",
82
- "value",
83
- "disabled",
84
- "aria-pressed",
85
- "aria-expanded"
86
- ],
87
- "input": [
88
- "type",
89
- "name",
90
- "value",
91
- "checked",
92
- "disabled",
93
- "readonly",
94
- "required",
95
- "placeholder",
96
- "min",
97
- "max",
98
- "step",
99
- "maxlength",
100
- "autocomplete"
101
- ],
102
- "textarea": [
103
- "name",
104
- "value",
105
- "disabled",
106
- "readonly",
107
- "required",
108
- "placeholder",
109
- "rows",
110
- "cols",
111
- "maxlength"
112
- ],
113
- "select": [
114
- "name",
115
- "disabled",
116
- "required",
117
- "multiple",
118
- "size"
119
- ],
120
- "option": [
121
- "value",
122
- "selected",
123
- "disabled",
124
- "label"
125
- ],
126
- "label": [
127
- "for"
128
- ],
129
- "form": [
130
- "name",
131
- "autocomplete"
132
- ],
133
- "th": [
134
- "scope",
135
- "colspan",
136
- "rowspan"
137
- ],
138
- "td": [
139
- "colspan",
140
- "rowspan"
141
- ],
142
- "progress": [
143
- "value",
144
- "max"
145
- ],
146
- "meter": [
147
- "value",
148
- "min",
149
- "max",
150
- "low",
151
- "high",
152
- "optimum"
153
- ],
154
- "img": [
155
- "alt",
156
- "width",
157
- "height",
158
- "loading",
159
- "decoding"
160
- ],
161
- "audio": [
162
- "controls",
163
- "autoplay",
164
- "muted",
165
- "loop",
166
- "preload"
167
- ],
168
- "video": [
169
- "controls",
170
- "autoplay",
171
- "muted",
172
- "loop",
173
- "preload",
174
- "width",
175
- "height",
176
- "playsinline"
177
- ],
178
- "source": [
179
- "type",
180
- "media"
181
- ],
182
- "track": [
183
- "kind",
184
- "srclang",
185
- "label",
186
- "default"
187
- ],
188
- "time": [
189
- "datetime"
190
- ],
191
- "canvas": [
192
- "width",
193
- "height",
194
- "data-redevplugin-canvas"
195
- ]
196
- };
197
- export const opaqueSurfaceSafeInputTypes = [
198
- "text",
199
- "search",
200
- "number",
201
- "checkbox",
202
- "radio",
203
- "button",
204
- "submit",
205
- "reset"
206
- ];
207
- export const opaqueSurfaceCanvasContextTypes = [
208
- "2d",
209
- "webgl",
210
- "webgl2"
211
- ];
212
- export const opaqueSurfaceRenderLimits = {
213
- "max_message_bytes": 524288,
214
- "max_in_flight_requests": 256,
215
- "max_renders_per_second": 60,
216
- "max_render_depth": 32,
217
- "max_render_nodes": 4096,
218
- "max_patch_operations": 1024,
219
- "max_attributes_per_element": 64,
220
- "max_text_length": 65536,
221
- "max_attribute_value_length": 4096,
222
- "max_form_fields": 128,
223
- "max_keyboard_bindings": 128,
224
- "max_canvas_count": 4,
225
- "max_canvas_dimension": 4096,
226
- "max_canvas_total_pixels": 16777216,
227
- "max_canvas_pointer_events_per_second": 120,
228
- "max_image_count": 32,
229
- "max_image_dimension": 4096,
230
- "max_image_total_pixels": 33554432,
231
- "worker_heartbeat_interval_ms": 10000,
232
- "worker_heartbeat_timeout_ms": 5000
233
- };
@@ -1 +0,0 @@
1
- export declare const surfaceIntegrityScript = "/* @noble/hashes 2.4.0\nThe MIT License (MIT)\n\nCopyright (c) 2022 Paul Miller (https://paulmillr.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \u201CSoftware\u201D), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \u201CAS IS\u201D, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.*/\nvar redevpluginIntegrity=(()=>{var w=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var R=Object.prototype.hasOwnProperty;var N=(e,t)=>{for(var n in t)w(e,n,{get:t[n],enumerable:!0})},W=(e,t,n,r)=>{if(t&&typeof t==\"object\"||typeof t==\"function\")for(let o of M(t))!R.call(e,o)&&o!==n&&w(e,o,{get:()=>t[o],enumerable:!(r=k(t,o))||r.enumerable});return e};var I=e=>W(w({},\"__esModule\",{value:!0}),e);var q={};N(q,{sha256:()=>$});var K=e=>e/2**32|0,P=e=>e>>>0;function S(e,t,n,r){let o=K(n),c=P(n);e.setUint32(t,r?c:o,r),e.setUint32(t+4,r?o:c,r)}function _(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===\"Uint8Array\"&&\"BYTES_PER_ELEMENT\"in e&&e.BYTES_PER_ELEMENT===1}var m=e=>e?`\"${e}\" `:\"\";function X(e,t=\"\"){if(typeof e!=\"number\")throw new TypeError(m(t)+\"expected number, got \"+typeof e);if(!Number.isSafeInteger(e)||e<0)throw new RangeError(m(t)+\"expected integer >= 0, got \"+e);return e}function A(e,t,n=\"\"){if(_(e)&&(t===void 0||e.length===t))return e;t!==void 0&&X(t,\"length\");let r=_(e),o=t!==void 0?` of length ${t}`:\"\",c=r?`length=${e.length}`:`type=${typeof e}`,f=m(n)+\"expected Uint8Array\"+o+\", got \"+c;throw r?new RangeError(f):new TypeError(f)}var J=(e,t)=>{if(e===null||typeof e!=\"object\"||Array.isArray(e))throw new TypeError((t===\"object\"?\"\":`\"${t}\" `)+\"expected object, got type=\"+typeof e)},T=(e,t)=>{J(e,t);let n=Object.getPrototypeOf(e);if(n!==Object.prototype&&n!==null)throw new TypeError(`\"${t}\" expected plain object`);if(Object.hasOwn(e,\"__proto__\"))throw new TypeError(`\"${t}.__proto__\" is not allowed`)};function E(e,t=!0){if(e.destroyed)throw new Error(\"hash was destroyed\");if(t&&e.finished)throw new Error(\"digest() was already called\")}function C(e,t){A(e,void 0,\"output\");let n=t.outputLen;if(!(e.length>=n))throw new RangeError('\"output\" expected length >= '+n)}function H(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function p(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function h(e,t){return e<<32-t|e>>>t}function Y(e,t,n=\"opts\"){return T(e,\"defaults\"),t!==void 0&&T(t,n),Object.assign(Object.create(null),e,t)}function F(e,t={}){if(typeof e!=\"function\")throw new TypeError('\"hashCons\" expected function, got type='+typeof e);t=Y({},t,\"info\");let n=(o,c)=>e(c).update(o).digest(),r=e(void 0);return n.outputLen=r.outputLen,n.blockLen=r.blockLen,n.canXOF=r.canXOF,n.create=o=>e(o),Object.assign(n,t),Object.freeze(n)}var D=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function O(e,t,n){return e&t^~e&n}function G(e,t,n){return e&t^e&n^t&n}var y=class{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(t,n,r,o){this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=o,this.buffer=new Uint8Array(t),this.view=p(this.buffer)}update(t){E(this),A(t);let{view:n,buffer:r,blockLen:o}=this,c=t.length,f=!1;for(let s=0;s<c;){let x=Math.min(o-this.pos,c-s);if(x===o){let a=p(t);for(;o<=c-s;s+=o)this.process(a,s);f=!0;continue}r.set(s===0&&x===c?t:t.subarray(s,s+x),this.pos),this.pos+=x,s+=x,this.pos===o&&(this.process(n,0),this.pos=0,f=!0)}return this.length+=t.length,f&&this.roundClean(),this}digestInto(t){E(this),C(t,this),this.finished=!0;let{buffer:n,view:r,blockLen:o,isLE:c}=this,{pos:f}=this;n[f++]=128,n.fill(0,f),this.padOffset>o-f&&(this.process(r,0),n.fill(0)),S(r,o-8,this.length*8,c),this.process(r,0),this.roundClean();let s=t===n?r:p(t),x=this.outputLen,a=x/4,d=this.get();if(x%4||a>d.length)throw new Error(\"invalid outputLen\");for(let i=0;i<a;i++)s.setUint32(4*i,d[i],c)}digest(){let{buffer:t,outputLen:n}=this;this.digestInto(t);let r=t.slice(0,n);return this.destroy(),r}_cloneIntoMeta(t){let{buffer:n,length:r,finished:o,destroyed:c,pos:f}=this;return t.destroyed=c,t.finished=o,t.length=r,t.pos=f,f&&t.buffer.set(n),t}clone(){return this._cloneInto()}},j=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);var z=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),u=new Uint32Array(64),L=class extends y{A=0;B=0;C=0;D=0;E=0;F=0;G=0;H=0;constructor(t,n){super(64,t,8,!1),this.A=n[0]|0,this.B=n[1]|0,this.C=n[2]|0,this.D=n[3]|0,this.E=n[4]|0,this.F=n[5]|0,this.G=n[6]|0,this.H=n[7]|0}get(){let{A:t,B:n,C:r,D:o,E:c,F:f,G:s,H:x}=this;return[t,n,r,o,c,f,s,x]}set(t,n,r,o,c,f,s,x){this.A=t|0,this.B=n|0,this.C=r|0,this.D=o|0,this.E=c|0,this.F=f|0,this.G=s|0,this.H=x|0}_cloneInto(t){return(t||=new this.constructor).set(...this.get()),this._cloneIntoMeta(t)}process(t,n){for(let i=0;i<16;i++,n+=4)u[i]=t.getUint32(n,!1);for(let i=16;i<64;i++){let l=u[i-15],b=u[i-2],U=h(l,7)^h(l,18)^l>>>3,g=h(b,17)^h(b,19)^b>>>10;u[i]=g+u[i-7]+U+u[i-16]|0}let{A:r,B:o,C:c,D:f,E:s,F:x,G:a,H:d}=this;for(let i=0;i<64;i++){let l=h(s,6)^h(s,11)^h(s,25),b=d+l+O(s,x,a)+z[i]+u[i]|0,g=(h(r,2)^h(r,13)^h(r,22))+G(r,o,c)|0;d=a,a=x,x=s,s=f+b|0,f=c,c=o,o=r,r=b+g|0}r=r+this.A|0,o=o+this.B|0,c=c+this.C|0,f=f+this.D|0,s=s+this.E|0,x=x+this.F|0,a=a+this.G|0,d=d+this.H|0,this.set(r,o,c,f,s,x,a,d)}roundClean(){H(u)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),H(this.buffer)}},B=class extends L{constructor(){super(32,j)}};var $=F(()=>new B,D(1));return I(q);})();\n";
@@ -1,2 +0,0 @@
1
- // Code generated by scripts/build_surface_integrity.mjs; DO NOT EDIT.
2
- export const surfaceIntegrityScript = "/* @noble/hashes 2.4.0\nThe MIT License (MIT)\n\nCopyright (c) 2022 Paul Miller (https://paulmillr.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the “Software”), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.*/\nvar redevpluginIntegrity=(()=>{var w=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var R=Object.prototype.hasOwnProperty;var N=(e,t)=>{for(var n in t)w(e,n,{get:t[n],enumerable:!0})},W=(e,t,n,r)=>{if(t&&typeof t==\"object\"||typeof t==\"function\")for(let o of M(t))!R.call(e,o)&&o!==n&&w(e,o,{get:()=>t[o],enumerable:!(r=k(t,o))||r.enumerable});return e};var I=e=>W(w({},\"__esModule\",{value:!0}),e);var q={};N(q,{sha256:()=>$});var K=e=>e/2**32|0,P=e=>e>>>0;function S(e,t,n,r){let o=K(n),c=P(n);e.setUint32(t,r?c:o,r),e.setUint32(t+4,r?o:c,r)}function _(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name===\"Uint8Array\"&&\"BYTES_PER_ELEMENT\"in e&&e.BYTES_PER_ELEMENT===1}var m=e=>e?`\"${e}\" `:\"\";function X(e,t=\"\"){if(typeof e!=\"number\")throw new TypeError(m(t)+\"expected number, got \"+typeof e);if(!Number.isSafeInteger(e)||e<0)throw new RangeError(m(t)+\"expected integer >= 0, got \"+e);return e}function A(e,t,n=\"\"){if(_(e)&&(t===void 0||e.length===t))return e;t!==void 0&&X(t,\"length\");let r=_(e),o=t!==void 0?` of length ${t}`:\"\",c=r?`length=${e.length}`:`type=${typeof e}`,f=m(n)+\"expected Uint8Array\"+o+\", got \"+c;throw r?new RangeError(f):new TypeError(f)}var J=(e,t)=>{if(e===null||typeof e!=\"object\"||Array.isArray(e))throw new TypeError((t===\"object\"?\"\":`\"${t}\" `)+\"expected object, got type=\"+typeof e)},T=(e,t)=>{J(e,t);let n=Object.getPrototypeOf(e);if(n!==Object.prototype&&n!==null)throw new TypeError(`\"${t}\" expected plain object`);if(Object.hasOwn(e,\"__proto__\"))throw new TypeError(`\"${t}.__proto__\" is not allowed`)};function E(e,t=!0){if(e.destroyed)throw new Error(\"hash was destroyed\");if(t&&e.finished)throw new Error(\"digest() was already called\")}function C(e,t){A(e,void 0,\"output\");let n=t.outputLen;if(!(e.length>=n))throw new RangeError('\"output\" expected length >= '+n)}function H(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function p(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function h(e,t){return e<<32-t|e>>>t}function Y(e,t,n=\"opts\"){return T(e,\"defaults\"),t!==void 0&&T(t,n),Object.assign(Object.create(null),e,t)}function F(e,t={}){if(typeof e!=\"function\")throw new TypeError('\"hashCons\" expected function, got type='+typeof e);t=Y({},t,\"info\");let n=(o,c)=>e(c).update(o).digest(),r=e(void 0);return n.outputLen=r.outputLen,n.blockLen=r.blockLen,n.canXOF=r.canXOF,n.create=o=>e(o),Object.assign(n,t),Object.freeze(n)}var D=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function O(e,t,n){return e&t^~e&n}function G(e,t,n){return e&t^e&n^t&n}var y=class{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(t,n,r,o){this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=o,this.buffer=new Uint8Array(t),this.view=p(this.buffer)}update(t){E(this),A(t);let{view:n,buffer:r,blockLen:o}=this,c=t.length,f=!1;for(let s=0;s<c;){let x=Math.min(o-this.pos,c-s);if(x===o){let a=p(t);for(;o<=c-s;s+=o)this.process(a,s);f=!0;continue}r.set(s===0&&x===c?t:t.subarray(s,s+x),this.pos),this.pos+=x,s+=x,this.pos===o&&(this.process(n,0),this.pos=0,f=!0)}return this.length+=t.length,f&&this.roundClean(),this}digestInto(t){E(this),C(t,this),this.finished=!0;let{buffer:n,view:r,blockLen:o,isLE:c}=this,{pos:f}=this;n[f++]=128,n.fill(0,f),this.padOffset>o-f&&(this.process(r,0),n.fill(0)),S(r,o-8,this.length*8,c),this.process(r,0),this.roundClean();let s=t===n?r:p(t),x=this.outputLen,a=x/4,d=this.get();if(x%4||a>d.length)throw new Error(\"invalid outputLen\");for(let i=0;i<a;i++)s.setUint32(4*i,d[i],c)}digest(){let{buffer:t,outputLen:n}=this;this.digestInto(t);let r=t.slice(0,n);return this.destroy(),r}_cloneIntoMeta(t){let{buffer:n,length:r,finished:o,destroyed:c,pos:f}=this;return t.destroyed=c,t.finished=o,t.length=r,t.pos=f,f&&t.buffer.set(n),t}clone(){return this._cloneInto()}},j=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);var z=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),u=new Uint32Array(64),L=class extends y{A=0;B=0;C=0;D=0;E=0;F=0;G=0;H=0;constructor(t,n){super(64,t,8,!1),this.A=n[0]|0,this.B=n[1]|0,this.C=n[2]|0,this.D=n[3]|0,this.E=n[4]|0,this.F=n[5]|0,this.G=n[6]|0,this.H=n[7]|0}get(){let{A:t,B:n,C:r,D:o,E:c,F:f,G:s,H:x}=this;return[t,n,r,o,c,f,s,x]}set(t,n,r,o,c,f,s,x){this.A=t|0,this.B=n|0,this.C=r|0,this.D=o|0,this.E=c|0,this.F=f|0,this.G=s|0,this.H=x|0}_cloneInto(t){return(t||=new this.constructor).set(...this.get()),this._cloneIntoMeta(t)}process(t,n){for(let i=0;i<16;i++,n+=4)u[i]=t.getUint32(n,!1);for(let i=16;i<64;i++){let l=u[i-15],b=u[i-2],U=h(l,7)^h(l,18)^l>>>3,g=h(b,17)^h(b,19)^b>>>10;u[i]=g+u[i-7]+U+u[i-16]|0}let{A:r,B:o,C:c,D:f,E:s,F:x,G:a,H:d}=this;for(let i=0;i<64;i++){let l=h(s,6)^h(s,11)^h(s,25),b=d+l+O(s,x,a)+z[i]+u[i]|0,g=(h(r,2)^h(r,13)^h(r,22))+G(r,o,c)|0;d=a,a=x,x=s,s=f+b|0,f=c,c=o,o=r,r=b+g|0}r=r+this.A|0,o=o+this.B|0,c=c+this.C|0,f=f+this.D|0,s=s+this.E|0,x=x+this.F|0,a=a+this.G|0,d=d+this.H|0,this.set(r,o,c,f,s,x,a,d)}roundClean(){H(u)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),H(this.buffer)}},B=class extends L{constructor(){super(32,j)}};var $=F(()=>new B,D(1));return I(q);})();\n";
@@ -1,67 +0,0 @@
1
- import { type OpaqueSurfaceAllowedTag } from "./opaque-surface-policy.gen.js";
2
- export type PluginUIAttributeValue = string | number | boolean;
3
- export type PluginUITextVNode = {
4
- type: "text";
5
- key: string;
6
- text: string;
7
- };
8
- export type PluginUIElementVNode = {
9
- type: "element";
10
- key: string;
11
- tag: OpaqueSurfaceAllowedTag;
12
- attributes?: Record<string, PluginUIAttributeValue>;
13
- children?: PluginUIVNode[];
14
- };
15
- export type PluginUIVNode = PluginUITextVNode | PluginUIElementVNode;
16
- export type PluginUISetTextOperation = {
17
- type: "set_text";
18
- target_key: string;
19
- text: string;
20
- };
21
- export type PluginUIPatchAttributesOperation = {
22
- type: "patch_attributes";
23
- target_key: string;
24
- set: Record<string, PluginUIAttributeValue>;
25
- remove: string[];
26
- };
27
- export type PluginUIPatchControlOperation = {
28
- type: "patch_control";
29
- target_key: string;
30
- edit_revision: number;
31
- value?: string | null;
32
- checked?: boolean | null;
33
- };
34
- export type PluginUIInsertChildOperation = {
35
- type: "insert_child";
36
- parent_key: string;
37
- before_key: string | null;
38
- node: PluginUIVNode;
39
- };
40
- export type PluginUIRemoveChildOperation = {
41
- type: "remove_child";
42
- target_key: string;
43
- };
44
- export type PluginUIMoveChildOperation = {
45
- type: "move_child";
46
- target_key: string;
47
- parent_key: string;
48
- before_key: string | null;
49
- };
50
- export type PluginUIPatchOperation = PluginUISetTextOperation | PluginUIPatchAttributesOperation | PluginUIPatchControlOperation | PluginUIInsertChildOperation | PluginUIRemoveChildOperation | PluginUIMoveChildOperation;
51
- export type PluginUIMountMessage = {
52
- type: "redevplugin.ui.mount";
53
- id: string;
54
- revision: 1;
55
- tree: PluginUIElementVNode;
56
- };
57
- export type PluginUIPatchMessage = {
58
- type: "redevplugin.ui.patch";
59
- id: string;
60
- base_revision: number;
61
- revision: number;
62
- operations: PluginUIPatchOperation[];
63
- };
64
- export declare class PluginUIReconcileError extends Error {
65
- constructor(message: string);
66
- }
67
- export declare function validatePluginUITree(tree: PluginUIVNode): PluginUIElementVNode;
@@ -1,128 +0,0 @@
1
- import { opaqueSurfaceAllowedTags, opaqueSurfaceGlobalAttributes, opaqueSurfaceRenderLimits, opaqueSurfaceSafeInputTypes, opaqueSurfaceTagAttributes, } from "./opaque-surface-policy.gen.js";
2
- export class PluginUIReconcileError extends Error {
3
- constructor(message) {
4
- super(message);
5
- this.name = "PluginUIReconcileError";
6
- }
7
- }
8
- const keyPattern = new RegExp("^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$");
9
- const identifierPattern = new RegExp("^[A-Za-z0-9._:-]{1,128}$");
10
- const opaqueHandlePattern = new RegExp("^[A-Za-z0-9_-]{8,160}$");
11
- const allowedTags = new Set(opaqueSurfaceAllowedTags);
12
- const globalAttributes = new Set(opaqueSurfaceGlobalAttributes);
13
- const safeInputTypes = new Set(opaqueSurfaceSafeInputTypes);
14
- const textNodeKeys = new Set(["type", "key", "text"]);
15
- const elementNodeKeys = new Set(["type", "key", "tag", "attributes", "children"]);
16
- const tagAttributes = new Map(Object.entries(opaqueSurfaceTagAttributes).map(([tag, attributes]) => [tag, new Set(attributes)]));
17
- export function validatePluginUITree(tree) {
18
- if (!isElement(tree)) {
19
- throw new PluginUIReconcileError("Plugin UI root must be one keyed element");
20
- }
21
- const keys = new Set();
22
- const ancestors = new Set();
23
- let nodes = 0;
24
- const visit = (node, depth) => {
25
- nodes += 1;
26
- if (nodes > opaqueSurfaceRenderLimits.max_render_nodes || depth > opaqueSurfaceRenderLimits.max_render_depth) {
27
- throw new PluginUIReconcileError("Plugin UI tree exceeds structural limits");
28
- }
29
- if ((!isText(node) && !isElement(node)) || ancestors.has(node)) {
30
- throw new PluginUIReconcileError("Plugin UI tree must contain plain keyed acyclic VNodes");
31
- }
32
- if (!keyPattern.test(node.key) || keys.has(node.key)) {
33
- throw new PluginUIReconcileError(`Plugin UI key is invalid or duplicated: ${String(node.key)}`);
34
- }
35
- keys.add(node.key);
36
- if (node.type === "text") {
37
- if (node.text.length > opaqueSurfaceRenderLimits.max_text_length) {
38
- throw new PluginUIReconcileError("Plugin UI text exceeds limits");
39
- }
40
- return;
41
- }
42
- ancestors.add(node);
43
- try {
44
- if (!allowedTags.has(node.tag)) {
45
- throw new PluginUIReconcileError(`Plugin UI tag is not allowed for ${node.key}`);
46
- }
47
- if (node.attributes !== undefined) {
48
- if (!isPlainRecord(node.attributes) || Object.keys(node.attributes).length > opaqueSurfaceRenderLimits.max_attributes_per_element) {
49
- throw new PluginUIReconcileError(`Plugin UI attributes are invalid for ${node.key}`);
50
- }
51
- for (const [name, value] of Object.entries(node.attributes)) {
52
- if (!validAttribute(node.tag, name, value)) {
53
- throw new PluginUIReconcileError(`Plugin UI attribute ${name} is not allowed for ${node.key}`);
54
- }
55
- }
56
- }
57
- if (node.children !== undefined) {
58
- if (!Array.isArray(node.children))
59
- throw new PluginUIReconcileError(`Plugin UI children are invalid for ${node.key}`);
60
- for (const child of node.children)
61
- visit(child, depth + 1);
62
- }
63
- }
64
- finally {
65
- ancestors.delete(node);
66
- }
67
- };
68
- visit(tree, 1);
69
- return tree;
70
- }
71
- function isText(value) {
72
- return isPlainRecord(value) && hasExactKeys(value, textNodeKeys) &&
73
- value.type === "text" && typeof value.key === "string" && typeof value.text === "string";
74
- }
75
- function isElement(value) {
76
- if (!isPlainRecord(value))
77
- return false;
78
- return hasAllowedKeys(value, elementNodeKeys) &&
79
- value.type === "element" && typeof value.key === "string" && typeof value.tag === "string";
80
- }
81
- function hasExactKeys(value, keys) {
82
- const actual = Object.keys(value);
83
- return actual.length === keys.size && actual.every((key) => keys.has(key));
84
- }
85
- function hasAllowedKeys(value, keys) {
86
- return Object.keys(value).every((key) => keys.has(key));
87
- }
88
- function isPlainRecord(value) {
89
- if (value === null || typeof value !== "object" || Array.isArray(value))
90
- return false;
91
- const prototype = Object.getPrototypeOf(value);
92
- return prototype === Object.prototype || prototype === null;
93
- }
94
- function validAttribute(tag, name, value) {
95
- const normalized = name.toLowerCase();
96
- if (normalized.startsWith("on") || ["style", "src", "srcset", "href", "srcdoc", "action", "formaction"].includes(normalized)) {
97
- return false;
98
- }
99
- if (!globalAttributes.has(normalized) && !normalized.startsWith("aria-") && !tagAttributes.get(tag)?.has(normalized)) {
100
- return false;
101
- }
102
- if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean")
103
- return false;
104
- if (typeof value === "number" && !Number.isFinite(value))
105
- return false;
106
- const serialized = String(value);
107
- if (normalized === "data-redevplugin-action" || normalized === "data-redevplugin-escape-action") {
108
- if (!identifierPattern.test(serialized))
109
- return false;
110
- }
111
- if (normalized === "data-redevplugin-asset-binding") {
112
- if (!serialized.startsWith("asset_") || !opaqueHandlePattern.test(serialized))
113
- return false;
114
- }
115
- if (normalized === "data-redevplugin-asset-attr" && serialized !== "src" && serialized !== "poster")
116
- return false;
117
- if (normalized === "data-redevplugin-canvas" && (tag !== "canvas" || !keyPattern.test(serialized)))
118
- return false;
119
- if (normalized === "maxlength" &&
120
- (!/^(0|[1-9][0-9]*)$/.test(serialized) || !Number.isSafeInteger(Number(serialized))))
121
- return false;
122
- if (tag === "canvas" && (normalized === "width" || normalized === "height") &&
123
- (!/^[1-9][0-9]{0,4}$/.test(serialized) || Number(serialized) > opaqueSurfaceRenderLimits.max_canvas_dimension))
124
- return false;
125
- if (tag === "input" && normalized === "type" && !safeInputTypes.has(serialized.trim().toLowerCase() || "text"))
126
- return false;
127
- return serialized.length <= opaqueSurfaceRenderLimits.max_attribute_value_length;
128
- }
@@ -1,10 +0,0 @@
1
- import { type PluginUIElementVNode, type PluginUIPatchOperation } from "./ui-patch-validator.js";
2
- export { PluginUIReconcileError, validatePluginUITree } from "./ui-patch-validator.js";
3
- export type { PluginUIAttributeValue, PluginUIElementVNode, PluginUIInsertChildOperation, PluginUIMountMessage, PluginUIMoveChildOperation, PluginUIPatchAttributesOperation, PluginUIPatchControlOperation, PluginUIPatchMessage, PluginUIPatchOperation, PluginUIRemoveChildOperation, PluginUISetTextOperation, PluginUITextVNode, PluginUIVNode, } from "./ui-patch-validator.js";
4
- export type PluginUIReconcileOptions = {
5
- controlEditRevisions?: ReadonlyMap<string, number>;
6
- transferredCanvasKeys?: ReadonlySet<string>;
7
- maxOperations?: number;
8
- };
9
- export declare function reconcilePluginUITrees(current: PluginUIElementVNode, next: PluginUIElementVNode, options?: PluginUIReconcileOptions): PluginUIPatchOperation[];
10
- export declare function reconcileValidatedPluginUITrees(current: PluginUIElementVNode, next: PluginUIElementVNode, options?: PluginUIReconcileOptions): PluginUIPatchOperation[];