veo-sdk 0.5.30 → 0.5.32
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/builder-MNYSDJFT.mjs +5 -0
- package/dist/{builder-W2DDGYSX.mjs.map → builder-MNYSDJFT.mjs.map} +1 -1
- package/dist/builder.cjs +50 -6
- package/dist/builder.cjs.map +1 -1
- package/dist/builder.mjs +4 -4
- package/dist/{chunk-H7TN3SQW.mjs → chunk-AFU5ZG6Z.mjs} +3 -3
- package/dist/{chunk-H7TN3SQW.mjs.map → chunk-AFU5ZG6Z.mjs.map} +1 -1
- package/dist/{chunk-NQV7LGUC.mjs → chunk-JPANNXIK.mjs} +4 -44
- package/dist/chunk-JPANNXIK.mjs.map +1 -0
- package/dist/{chunk-SFSYLCSV.mjs → chunk-X27GD7IT.mjs} +59 -9
- package/dist/chunk-X27GD7IT.mjs.map +1 -0
- package/dist/index.cjs +66 -46
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/veo-builder.js +7 -7
- package/dist/veo-builder.js.map +1 -1
- package/dist/veo-guides.js +3 -3
- package/dist/veo-guides.js.map +1 -1
- package/dist/veo.js +2 -2
- package/dist/veo.js.map +1 -1
- package/package.json +1 -1
- package/dist/builder-W2DDGYSX.mjs +0 -5
- package/dist/chunk-NQV7LGUC.mjs.map +0 -1
- package/dist/chunk-SFSYLCSV.mjs.map +0 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { VEO_BLOCK_MIME, attachBlockDropTarget, attachDesignManipulator, createBuilderSession, initBuilderMode, startElementPicker, stopElementPicker } from './chunk-AFU5ZG6Z.mjs';
|
|
2
|
+
import './chunk-X27GD7IT.mjs';
|
|
3
|
+
import './chunk-PTG3BTJE.mjs';
|
|
4
|
+
//# sourceMappingURL=builder-MNYSDJFT.mjs.map
|
|
5
|
+
//# sourceMappingURL=builder-MNYSDJFT.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"builder-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"builder-MNYSDJFT.mjs"}
|
package/dist/builder.cjs
CHANGED
|
@@ -123,11 +123,48 @@ var BUILDER_PANEL_PARAM = "veoBuilderPanel";
|
|
|
123
123
|
var BUILDER_PANEL_PATH_PARAM = "veoBuilderPanelPath";
|
|
124
124
|
var BUILDER_GUIDE_PARAM = "veoGuide";
|
|
125
125
|
|
|
126
|
+
// src/core/preview-loader.ts
|
|
127
|
+
var PREVIEW_TOKEN_PARAM = "veoPreview";
|
|
128
|
+
var PREVIEW_TOKEN_KEY = "veo:preview_token";
|
|
129
|
+
function session() {
|
|
130
|
+
try {
|
|
131
|
+
return window.sessionStorage;
|
|
132
|
+
} catch {
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
function getPreviewToken() {
|
|
137
|
+
if (!hasWindow()) return null;
|
|
138
|
+
let fromUrl = null;
|
|
139
|
+
try {
|
|
140
|
+
const value = new URLSearchParams(window.location.search).get(PREVIEW_TOKEN_PARAM);
|
|
141
|
+
fromUrl = value ? value : null;
|
|
142
|
+
} catch {
|
|
143
|
+
fromUrl = null;
|
|
144
|
+
}
|
|
145
|
+
const store = session();
|
|
146
|
+
if (fromUrl) {
|
|
147
|
+
try {
|
|
148
|
+
store?.setItem(PREVIEW_TOKEN_KEY, fromUrl);
|
|
149
|
+
} catch {
|
|
150
|
+
}
|
|
151
|
+
return fromUrl;
|
|
152
|
+
}
|
|
153
|
+
try {
|
|
154
|
+
return store?.getItem(PREVIEW_TOKEN_KEY) || null;
|
|
155
|
+
} catch {
|
|
156
|
+
return null;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
function isPreviewMode() {
|
|
160
|
+
return getPreviewToken() !== null;
|
|
161
|
+
}
|
|
162
|
+
|
|
126
163
|
// src/core/builder-token.ts
|
|
127
164
|
var CTX_KEY = "veo:builder_ctx";
|
|
128
165
|
var LS_PREFIX = "veo:builder_ctx:";
|
|
129
166
|
var PERSIST_TTL_MS = 30 * 60 * 1e3;
|
|
130
|
-
function
|
|
167
|
+
function session2() {
|
|
131
168
|
try {
|
|
132
169
|
return window.sessionStorage;
|
|
133
170
|
} catch {
|
|
@@ -146,7 +183,7 @@ function lsKey(guide) {
|
|
|
146
183
|
}
|
|
147
184
|
function persist(ctx) {
|
|
148
185
|
try {
|
|
149
|
-
|
|
186
|
+
session2()?.setItem(CTX_KEY, JSON.stringify(ctx));
|
|
150
187
|
} catch {
|
|
151
188
|
}
|
|
152
189
|
try {
|
|
@@ -213,15 +250,16 @@ function resolveBuilderContext() {
|
|
|
213
250
|
persist(ctx);
|
|
214
251
|
return ctx;
|
|
215
252
|
}
|
|
253
|
+
if (isPreviewMode()) return null;
|
|
216
254
|
try {
|
|
217
|
-
const raw =
|
|
255
|
+
const raw = session2()?.getItem(CTX_KEY);
|
|
218
256
|
if (raw) return JSON.parse(raw);
|
|
219
257
|
} catch {
|
|
220
258
|
}
|
|
221
259
|
const fromLocal = readFreshFromLocal();
|
|
222
260
|
if (fromLocal) {
|
|
223
261
|
try {
|
|
224
|
-
|
|
262
|
+
session2()?.setItem(CTX_KEY, JSON.stringify(fromLocal));
|
|
225
263
|
} catch {
|
|
226
264
|
}
|
|
227
265
|
}
|
|
@@ -231,12 +269,12 @@ function clearBuilderToken() {
|
|
|
231
269
|
if (!hasWindow()) return;
|
|
232
270
|
let guide = null;
|
|
233
271
|
try {
|
|
234
|
-
const raw =
|
|
272
|
+
const raw = session2()?.getItem(CTX_KEY);
|
|
235
273
|
if (raw) guide = JSON.parse(raw).guide ?? null;
|
|
236
274
|
} catch {
|
|
237
275
|
}
|
|
238
276
|
try {
|
|
239
|
-
|
|
277
|
+
session2()?.removeItem(CTX_KEY);
|
|
240
278
|
} catch {
|
|
241
279
|
}
|
|
242
280
|
try {
|
|
@@ -595,6 +633,12 @@ function applyBlockStyle(el, style, kind) {
|
|
|
595
633
|
if (kind !== "image" && typeof s.radius === "number" && Number.isFinite(s.radius)) {
|
|
596
634
|
el.style.borderRadius = `${clampNum(s.radius, 0, 64)}px`;
|
|
597
635
|
}
|
|
636
|
+
if (typeof s.height === "number" && Number.isFinite(s.height) && s.height > 0) {
|
|
637
|
+
el.style.height = `${clampNum(s.height, 1, 2e3)}px`;
|
|
638
|
+
}
|
|
639
|
+
if (kind !== "image" && typeof s.width === "number" && Number.isFinite(s.width) && s.width > 0) {
|
|
640
|
+
el.style.width = `${clampNum(s.width, 1, 2e3)}px`;
|
|
641
|
+
}
|
|
598
642
|
for (const side of ["Top", "Right", "Bottom", "Left"]) {
|
|
599
643
|
const p = s[`padding${side}`];
|
|
600
644
|
if (typeof p === "number" && Number.isFinite(p)) {
|