@orion-studios/payload-studio 0.6.0-beta.71 → 0.6.0-beta.72

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.
@@ -7,14 +7,14 @@ import {
7
7
  socialMediaConnectionsField,
8
8
  themePreferenceField,
9
9
  withTooltips
10
- } from "../chunk-KHK6RTGC.mjs";
10
+ } from "../chunk-JC3UV74N.mjs";
11
+ import "../chunk-W2UOCJDX.mjs";
11
12
  import {
12
13
  SOCIAL_MEDIA_DEFAULT_ICON_BY_PLATFORM,
13
14
  SOCIAL_MEDIA_ICON_OPTIONS,
14
15
  SOCIAL_MEDIA_PLATFORMS,
15
16
  SOCIAL_MEDIA_PLATFORM_LABELS
16
17
  } from "../chunk-ZTXJG4K5.mjs";
17
- import "../chunk-W2UOCJDX.mjs";
18
18
  import "../chunk-6BWS3CLP.mjs";
19
19
  export {
20
20
  SOCIAL_MEDIA_DEFAULT_ICON_BY_PLATFORM,
@@ -175,7 +175,7 @@ var normalizeBuilderV2ProjectData = (value, fallbackTitle = "Untitled Page") =>
175
175
  };
176
176
 
177
177
  // src/builder-v2/runtime/placeholders.ts
178
- var placeholderPattern = /<(?<tag>[a-zA-Z][a-zA-Z0-9-]*)\b(?<attrs>[^>]*)data-orion-component=["'](?<component>[^"']+)["'](?<rest>[^>]*)>(?<content>.*?)<\/\k<tag>>/gis;
178
+ var placeholderPattern = /<(?<tag>[a-zA-Z][a-zA-Z0-9-]*)\b(?<attrs>[^>]*)data-orion-component=["'](?<component>[^"']+)["'](?<rest>[^>]*)>/gis;
179
179
  var attrPattern = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)=(?:"([^"]*)"|'([^']*)')/g;
180
180
  var decodeHtmlAttribute = (value) => value.replace(/&quot;/g, '"').replace(/&#39;/g, "'").replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">");
181
181
  var parseAttributes = (value) => {
@@ -51,7 +51,7 @@ var normalizeBuilderV2ProjectData = (value, fallbackTitle = "Untitled Page") =>
51
51
  };
52
52
 
53
53
  // src/builder-v2/runtime/placeholders.ts
54
- var placeholderPattern = /<(?<tag>[a-zA-Z][a-zA-Z0-9-]*)\b(?<attrs>[^>]*)data-orion-component=["'](?<component>[^"']+)["'](?<rest>[^>]*)>(?<content>.*?)<\/\k<tag>>/gis;
54
+ var placeholderPattern = /<(?<tag>[a-zA-Z][a-zA-Z0-9-]*)\b(?<attrs>[^>]*)data-orion-component=["'](?<component>[^"']+)["'](?<rest>[^>]*)>/gis;
55
55
  var attrPattern = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)=(?:"([^"]*)"|'([^']*)')/g;
56
56
  var decodeHtmlAttribute = (value) => value.replace(/&quot;/g, '"').replace(/&#39;/g, "'").replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">");
57
57
  var parseAttributes = (value) => {
@@ -185,7 +185,7 @@ var appendBuilderV2PageFields = (fields, options) => [
185
185
  ];
186
186
 
187
187
  // src/builder-v2/runtime/placeholders.ts
188
- var placeholderPattern = /<(?<tag>[a-zA-Z][a-zA-Z0-9-]*)\b(?<attrs>[^>]*)data-orion-component=["'](?<component>[^"']+)["'](?<rest>[^>]*)>(?<content>.*?)<\/\k<tag>>/gis;
188
+ var placeholderPattern = /<(?<tag>[a-zA-Z][a-zA-Z0-9-]*)\b(?<attrs>[^>]*)data-orion-component=["'](?<component>[^"']+)["'](?<rest>[^>]*)>/gis;
189
189
  var attrPattern = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)=(?:"([^"]*)"|'([^']*)')/g;
190
190
  var decodeHtmlAttribute = (value) => value.replace(/&quot;/g, '"').replace(/&#39;/g, "'").replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">");
191
191
  var parseAttributes = (value) => {
@@ -232,6 +232,26 @@ var extractWrapperAttributes = (attrs) => {
232
232
  const className = extractAttribute(attrs, "class") || void 0;
233
233
  return id || className ? { className, id } : void 0;
234
234
  };
235
+ var findPlaceholderEnd = (html, tag, startIndex) => {
236
+ const tagPattern = new RegExp(`<\\/?${tag}\\b[^>]*>`, "gi");
237
+ tagPattern.lastIndex = startIndex;
238
+ let depth = 1;
239
+ let match;
240
+ while ((match = tagPattern.exec(html)) !== null) {
241
+ const token = match[0];
242
+ const isClosing = token.startsWith("</");
243
+ const isSelfClosing = /\/\s*>$/.test(token);
244
+ if (isClosing) {
245
+ depth -= 1;
246
+ } else if (!isSelfClosing) {
247
+ depth += 1;
248
+ }
249
+ if (depth === 0) {
250
+ return tagPattern.lastIndex;
251
+ }
252
+ }
253
+ return startIndex;
254
+ };
235
255
  var parseBuilderV2DynamicComponents = (html) => {
236
256
  const instances = [];
237
257
  let match;
@@ -262,6 +282,8 @@ var splitBuilderV2HtmlIntoChunks = (html) => {
262
282
  }
263
283
  const attrs = `${match.groups?.attrs ?? ""} ${match.groups?.rest ?? ""}`;
264
284
  const component = match.groups?.component ?? "";
285
+ const tag = match.groups?.tag ?? "";
286
+ const placeholderEnd = tag ? findPlaceholderEnd(html, tag, placeholderPattern.lastIndex) : placeholderPattern.lastIndex;
265
287
  chunks.push({
266
288
  instance: {
267
289
  component,
@@ -272,7 +294,8 @@ var splitBuilderV2HtmlIntoChunks = (html) => {
272
294
  kind: "component"
273
295
  });
274
296
  componentIndex += 1;
275
- lastIndex = match.index + match[0].length;
297
+ lastIndex = placeholderEnd;
298
+ placeholderPattern.lastIndex = placeholderEnd;
276
299
  }
277
300
  const after = html.slice(lastIndex);
278
301
  if (after.length > 0) {
@@ -136,7 +136,7 @@ var appendBuilderV2PageFields = (fields, options) => [
136
136
  ];
137
137
 
138
138
  // src/builder-v2/runtime/placeholders.ts
139
- var placeholderPattern = /<(?<tag>[a-zA-Z][a-zA-Z0-9-]*)\b(?<attrs>[^>]*)data-orion-component=["'](?<component>[^"']+)["'](?<rest>[^>]*)>(?<content>.*?)<\/\k<tag>>/gis;
139
+ var placeholderPattern = /<(?<tag>[a-zA-Z][a-zA-Z0-9-]*)\b(?<attrs>[^>]*)data-orion-component=["'](?<component>[^"']+)["'](?<rest>[^>]*)>/gis;
140
140
  var attrPattern = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)=(?:"([^"]*)"|'([^']*)')/g;
141
141
  var decodeHtmlAttribute = (value) => value.replace(/&quot;/g, '"').replace(/&#39;/g, "'").replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">");
142
142
  var parseAttributes = (value) => {
@@ -183,6 +183,26 @@ var extractWrapperAttributes = (attrs) => {
183
183
  const className = extractAttribute(attrs, "class") || void 0;
184
184
  return id || className ? { className, id } : void 0;
185
185
  };
186
+ var findPlaceholderEnd = (html, tag, startIndex) => {
187
+ const tagPattern = new RegExp(`<\\/?${tag}\\b[^>]*>`, "gi");
188
+ tagPattern.lastIndex = startIndex;
189
+ let depth = 1;
190
+ let match;
191
+ while ((match = tagPattern.exec(html)) !== null) {
192
+ const token = match[0];
193
+ const isClosing = token.startsWith("</");
194
+ const isSelfClosing = /\/\s*>$/.test(token);
195
+ if (isClosing) {
196
+ depth -= 1;
197
+ } else if (!isSelfClosing) {
198
+ depth += 1;
199
+ }
200
+ if (depth === 0) {
201
+ return tagPattern.lastIndex;
202
+ }
203
+ }
204
+ return startIndex;
205
+ };
186
206
  var parseBuilderV2DynamicComponents = (html) => {
187
207
  const instances = [];
188
208
  let match;
@@ -213,6 +233,8 @@ var splitBuilderV2HtmlIntoChunks = (html) => {
213
233
  }
214
234
  const attrs = `${match.groups?.attrs ?? ""} ${match.groups?.rest ?? ""}`;
215
235
  const component = match.groups?.component ?? "";
236
+ const tag = match.groups?.tag ?? "";
237
+ const placeholderEnd = tag ? findPlaceholderEnd(html, tag, placeholderPattern.lastIndex) : placeholderPattern.lastIndex;
216
238
  chunks.push({
217
239
  instance: {
218
240
  component,
@@ -223,7 +245,8 @@ var splitBuilderV2HtmlIntoChunks = (html) => {
223
245
  kind: "component"
224
246
  });
225
247
  componentIndex += 1;
226
- lastIndex = match.index + match[0].length;
248
+ lastIndex = placeholderEnd;
249
+ placeholderPattern.lastIndex = placeholderEnd;
227
250
  }
228
251
  const after = html.slice(lastIndex);
229
252
  if (after.length > 0) {
package/dist/index.mjs CHANGED
@@ -1,25 +1,25 @@
1
1
  import {
2
2
  admin_exports
3
- } from "./chunk-KHK6RTGC.mjs";
3
+ } from "./chunk-JC3UV74N.mjs";
4
4
  import {
5
- nextjs_exports
6
- } from "./chunk-ZADL33R6.mjs";
7
- import "./chunk-ZTXJG4K5.mjs";
5
+ admin_app_exports
6
+ } from "./chunk-RKTIFEUY.mjs";
7
+ import "./chunk-W2UOCJDX.mjs";
8
8
  import {
9
9
  blocks_exports
10
10
  } from "./chunk-JQAHXYAM.mjs";
11
+ import {
12
+ nextjs_exports
13
+ } from "./chunk-ZADL33R6.mjs";
14
+ import "./chunk-ZTXJG4K5.mjs";
11
15
  import {
12
16
  studio_pages_exports
13
- } from "./chunk-276KAPGM.mjs";
14
- import "./chunk-7ZMXZRBP.mjs";
17
+ } from "./chunk-NGLIA2OE.mjs";
15
18
  import "./chunk-OQSEJXC4.mjs";
19
+ import "./chunk-7ZMXZRBP.mjs";
16
20
  import {
17
21
  studio_exports
18
22
  } from "./chunk-ADIIWIYL.mjs";
19
- import {
20
- admin_app_exports
21
- } from "./chunk-RKTIFEUY.mjs";
22
- import "./chunk-W2UOCJDX.mjs";
23
23
  import "./chunk-6BWS3CLP.mjs";
24
24
  export {
25
25
  admin_exports as admin,
@@ -7,14 +7,14 @@ import {
7
7
  pageStudioModuleManifest,
8
8
  resolveBuilderThemeTokens,
9
9
  toEditorInitialDoc
10
- } from "../chunk-276KAPGM.mjs";
10
+ } from "../chunk-NGLIA2OE.mjs";
11
+ import "../chunk-OQSEJXC4.mjs";
11
12
  import {
12
13
  createDefaultStudioDocument,
13
14
  defaultBuilderThemeTokens,
14
15
  layoutToStudioDocument,
15
16
  studioDocumentToLayout
16
17
  } from "../chunk-7ZMXZRBP.mjs";
17
- import "../chunk-OQSEJXC4.mjs";
18
18
  import "../chunk-ADIIWIYL.mjs";
19
19
  import "../chunk-6BWS3CLP.mjs";
20
20
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orion-studios/payload-studio",
3
- "version": "0.6.0-beta.71",
3
+ "version": "0.6.0-beta.72",
4
4
  "description": "Base CMS, builder, and custom admin toolkit for Orion Studios websites",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",
@@ -1,12 +1,12 @@
1
+ import {
2
+ adminNavIcons
3
+ } from "./chunk-W2UOCJDX.mjs";
1
4
  import {
2
5
  SOCIAL_MEDIA_DEFAULT_ICON_BY_PLATFORM,
3
6
  SOCIAL_MEDIA_ICON_OPTIONS,
4
7
  SOCIAL_MEDIA_PLATFORMS,
5
8
  SOCIAL_MEDIA_PLATFORM_LABELS
6
9
  } from "./chunk-ZTXJG4K5.mjs";
7
- import {
8
- adminNavIcons
9
- } from "./chunk-W2UOCJDX.mjs";
10
10
  import {
11
11
  __export,
12
12
  __require
@@ -1,3 +1,6 @@
1
+ import {
2
+ sectionStyleDefaults
3
+ } from "./chunk-OQSEJXC4.mjs";
1
4
  import {
2
5
  createDefaultStudioDocument,
3
6
  defaultBuilderThemeTokens,
@@ -5,9 +8,6 @@ import {
5
8
  migrateBlockToSettingsV2,
6
9
  studioDocumentToLayout
7
10
  } from "./chunk-7ZMXZRBP.mjs";
8
- import {
9
- sectionStyleDefaults
10
- } from "./chunk-OQSEJXC4.mjs";
11
11
  import {
12
12
  assertStudioDocumentV1,
13
13
  compileStudioDocument,