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

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-JC3UV74N.mjs";
11
- import "../chunk-W2UOCJDX.mjs";
10
+ } from "../chunk-KHK6RTGC.mjs";
12
11
  import {
13
12
  SOCIAL_MEDIA_DEFAULT_ICON_BY_PLATFORM,
14
13
  SOCIAL_MEDIA_ICON_OPTIONS,
15
14
  SOCIAL_MEDIA_PLATFORMS,
16
15
  SOCIAL_MEDIA_PLATFORM_LABELS
17
16
  } 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,
@@ -208,9 +208,19 @@ var parseAttributes = (value) => {
208
208
  return props;
209
209
  };
210
210
  var extractAttribute = (attrs, name) => {
211
- const pattern = new RegExp(`${name}=["']([^"']+)["']`, "i");
212
- const match = attrs.match(pattern);
213
- return match ? decodeHtmlAttribute(match[1]) : null;
211
+ attrPattern.lastIndex = 0;
212
+ let match;
213
+ while ((match = attrPattern.exec(attrs)) !== null) {
214
+ if (match[1] === name) {
215
+ return decodeHtmlAttribute(match[2] ?? match[3] ?? "");
216
+ }
217
+ }
218
+ return null;
219
+ };
220
+ var extractWrapperAttributes = (attrs) => {
221
+ const id = extractAttribute(attrs, "id") || void 0;
222
+ const className = extractAttribute(attrs, "class") || void 0;
223
+ return id || className ? { className, id } : void 0;
214
224
  };
215
225
  var parseBuilderV2DynamicComponents = (html) => {
216
226
  const instances = [];
@@ -224,7 +234,8 @@ var parseBuilderV2DynamicComponents = (html) => {
224
234
  instances.push({
225
235
  component,
226
236
  id: extractAttribute(attrs, "data-orion-id") || `component-${instances.length + 1}`,
227
- props: parseAttributes(attrs)
237
+ props: parseAttributes(attrs),
238
+ wrapperAttributes: extractWrapperAttributes(attrs)
228
239
  });
229
240
  }
230
241
  return instances;
@@ -84,9 +84,19 @@ var parseAttributes = (value) => {
84
84
  return props;
85
85
  };
86
86
  var extractAttribute = (attrs, name) => {
87
- const pattern = new RegExp(`${name}=["']([^"']+)["']`, "i");
88
- const match = attrs.match(pattern);
89
- return match ? decodeHtmlAttribute(match[1]) : null;
87
+ attrPattern.lastIndex = 0;
88
+ let match;
89
+ while ((match = attrPattern.exec(attrs)) !== null) {
90
+ if (match[1] === name) {
91
+ return decodeHtmlAttribute(match[2] ?? match[3] ?? "");
92
+ }
93
+ }
94
+ return null;
95
+ };
96
+ var extractWrapperAttributes = (attrs) => {
97
+ const id = extractAttribute(attrs, "id") || void 0;
98
+ const className = extractAttribute(attrs, "class") || void 0;
99
+ return id || className ? { className, id } : void 0;
90
100
  };
91
101
  var parseBuilderV2DynamicComponents = (html) => {
92
102
  const instances = [];
@@ -100,7 +110,8 @@ var parseBuilderV2DynamicComponents = (html) => {
100
110
  instances.push({
101
111
  component,
102
112
  id: extractAttribute(attrs, "data-orion-id") || `component-${instances.length + 1}`,
103
- props: parseAttributes(attrs)
113
+ props: parseAttributes(attrs),
114
+ wrapperAttributes: extractWrapperAttributes(attrs)
104
115
  });
105
116
  }
106
117
  return instances;
@@ -103,6 +103,10 @@ type BuilderV2DynamicComponentInstance = {
103
103
  component: string;
104
104
  id: string;
105
105
  props: Record<string, unknown>;
106
+ wrapperAttributes?: {
107
+ className?: string;
108
+ id?: string;
109
+ };
106
110
  };
107
111
  type BuilderV2RuntimeComponentProps = {
108
112
  instance: BuilderV2DynamicComponentInstance;
@@ -103,6 +103,10 @@ type BuilderV2DynamicComponentInstance = {
103
103
  component: string;
104
104
  id: string;
105
105
  props: Record<string, unknown>;
106
+ wrapperAttributes?: {
107
+ className?: string;
108
+ id?: string;
109
+ };
106
110
  };
107
111
  type BuilderV2RuntimeComponentProps = {
108
112
  instance: BuilderV2DynamicComponentInstance;
@@ -218,9 +218,19 @@ var parseAttributes = (value) => {
218
218
  return props;
219
219
  };
220
220
  var extractAttribute = (attrs, name) => {
221
- const pattern = new RegExp(`${name}=["']([^"']+)["']`, "i");
222
- const match = attrs.match(pattern);
223
- return match ? decodeHtmlAttribute(match[1]) : null;
221
+ attrPattern.lastIndex = 0;
222
+ let match;
223
+ while ((match = attrPattern.exec(attrs)) !== null) {
224
+ if (match[1] === name) {
225
+ return decodeHtmlAttribute(match[2] ?? match[3] ?? "");
226
+ }
227
+ }
228
+ return null;
229
+ };
230
+ var extractWrapperAttributes = (attrs) => {
231
+ const id = extractAttribute(attrs, "id") || void 0;
232
+ const className = extractAttribute(attrs, "class") || void 0;
233
+ return id || className ? { className, id } : void 0;
224
234
  };
225
235
  var parseBuilderV2DynamicComponents = (html) => {
226
236
  const instances = [];
@@ -234,7 +244,8 @@ var parseBuilderV2DynamicComponents = (html) => {
234
244
  instances.push({
235
245
  component,
236
246
  id: extractAttribute(attrs, "data-orion-id") || `component-${instances.length + 1}`,
237
- props: parseAttributes(attrs)
247
+ props: parseAttributes(attrs),
248
+ wrapperAttributes: extractWrapperAttributes(attrs)
238
249
  });
239
250
  }
240
251
  return instances;
@@ -255,7 +266,8 @@ var splitBuilderV2HtmlIntoChunks = (html) => {
255
266
  instance: {
256
267
  component,
257
268
  id: extractAttribute(attrs, "data-orion-id") || `component-${componentIndex + 1}`,
258
- props: parseAttributes(attrs)
269
+ props: parseAttributes(attrs),
270
+ wrapperAttributes: extractWrapperAttributes(attrs)
259
271
  },
260
272
  kind: "component"
261
273
  });
@@ -710,7 +722,20 @@ function BuilderPageRuntime({ adapter, className, page }) {
710
722
  `component-${chunk.instance.id}-${index}`
711
723
  );
712
724
  }
713
- return (0, import_react.createElement)(import_react.Fragment, { key: `component-${chunk.instance.id}-${index}` }, /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, { instance: chunk.instance, page }));
725
+ const renderedComponent = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, { instance: chunk.instance, page });
726
+ const wrapperAttributes = chunk.instance.wrapperAttributes;
727
+ if (wrapperAttributes?.id || wrapperAttributes?.className) {
728
+ return (0, import_react.createElement)(
729
+ "div",
730
+ {
731
+ className: wrapperAttributes.className,
732
+ id: wrapperAttributes.id,
733
+ key: `component-${chunk.instance.id}-${index}`
734
+ },
735
+ renderedComponent
736
+ );
737
+ }
738
+ return (0, import_react.createElement)(import_react.Fragment, { key: `component-${chunk.instance.id}-${index}` }, renderedComponent);
714
739
  })
715
740
  ] });
716
741
  }
@@ -169,9 +169,19 @@ var parseAttributes = (value) => {
169
169
  return props;
170
170
  };
171
171
  var extractAttribute = (attrs, name) => {
172
- const pattern = new RegExp(`${name}=["']([^"']+)["']`, "i");
173
- const match = attrs.match(pattern);
174
- return match ? decodeHtmlAttribute(match[1]) : null;
172
+ attrPattern.lastIndex = 0;
173
+ let match;
174
+ while ((match = attrPattern.exec(attrs)) !== null) {
175
+ if (match[1] === name) {
176
+ return decodeHtmlAttribute(match[2] ?? match[3] ?? "");
177
+ }
178
+ }
179
+ return null;
180
+ };
181
+ var extractWrapperAttributes = (attrs) => {
182
+ const id = extractAttribute(attrs, "id") || void 0;
183
+ const className = extractAttribute(attrs, "class") || void 0;
184
+ return id || className ? { className, id } : void 0;
175
185
  };
176
186
  var parseBuilderV2DynamicComponents = (html) => {
177
187
  const instances = [];
@@ -185,7 +195,8 @@ var parseBuilderV2DynamicComponents = (html) => {
185
195
  instances.push({
186
196
  component,
187
197
  id: extractAttribute(attrs, "data-orion-id") || `component-${instances.length + 1}`,
188
- props: parseAttributes(attrs)
198
+ props: parseAttributes(attrs),
199
+ wrapperAttributes: extractWrapperAttributes(attrs)
189
200
  });
190
201
  }
191
202
  return instances;
@@ -206,7 +217,8 @@ var splitBuilderV2HtmlIntoChunks = (html) => {
206
217
  instance: {
207
218
  component,
208
219
  id: extractAttribute(attrs, "data-orion-id") || `component-${componentIndex + 1}`,
209
- props: parseAttributes(attrs)
220
+ props: parseAttributes(attrs),
221
+ wrapperAttributes: extractWrapperAttributes(attrs)
210
222
  },
211
223
  kind: "component"
212
224
  });
@@ -661,7 +673,20 @@ function BuilderPageRuntime({ adapter, className, page }) {
661
673
  `component-${chunk.instance.id}-${index}`
662
674
  );
663
675
  }
664
- return createElement(Fragment, { key: `component-${chunk.instance.id}-${index}` }, /* @__PURE__ */ jsx(Component, { instance: chunk.instance, page }));
676
+ const renderedComponent = /* @__PURE__ */ jsx(Component, { instance: chunk.instance, page });
677
+ const wrapperAttributes = chunk.instance.wrapperAttributes;
678
+ if (wrapperAttributes?.id || wrapperAttributes?.className) {
679
+ return createElement(
680
+ "div",
681
+ {
682
+ className: wrapperAttributes.className,
683
+ id: wrapperAttributes.id,
684
+ key: `component-${chunk.instance.id}-${index}`
685
+ },
686
+ renderedComponent
687
+ );
688
+ }
689
+ return createElement(Fragment, { key: `component-${chunk.instance.id}-${index}` }, renderedComponent);
665
690
  })
666
691
  ] });
667
692
  }
package/dist/index.mjs CHANGED
@@ -1,25 +1,25 @@
1
1
  import {
2
2
  admin_exports
3
- } from "./chunk-JC3UV74N.mjs";
4
- import {
5
- admin_app_exports
6
- } from "./chunk-RKTIFEUY.mjs";
7
- import "./chunk-W2UOCJDX.mjs";
8
- import {
9
- blocks_exports
10
- } from "./chunk-JQAHXYAM.mjs";
3
+ } from "./chunk-KHK6RTGC.mjs";
11
4
  import {
12
5
  nextjs_exports
13
6
  } from "./chunk-ZADL33R6.mjs";
14
7
  import "./chunk-ZTXJG4K5.mjs";
8
+ import {
9
+ blocks_exports
10
+ } from "./chunk-JQAHXYAM.mjs";
15
11
  import {
16
12
  studio_pages_exports
17
- } from "./chunk-NGLIA2OE.mjs";
18
- import "./chunk-OQSEJXC4.mjs";
13
+ } from "./chunk-276KAPGM.mjs";
19
14
  import "./chunk-7ZMXZRBP.mjs";
15
+ import "./chunk-OQSEJXC4.mjs";
20
16
  import {
21
17
  studio_exports
22
18
  } 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-NGLIA2OE.mjs";
11
- import "../chunk-OQSEJXC4.mjs";
10
+ } from "../chunk-276KAPGM.mjs";
12
11
  import {
13
12
  createDefaultStudioDocument,
14
13
  defaultBuilderThemeTokens,
15
14
  layoutToStudioDocument,
16
15
  studioDocumentToLayout
17
16
  } 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.70",
3
+ "version": "0.6.0-beta.71",
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,6 +1,3 @@
1
- import {
2
- sectionStyleDefaults
3
- } from "./chunk-OQSEJXC4.mjs";
4
1
  import {
5
2
  createDefaultStudioDocument,
6
3
  defaultBuilderThemeTokens,
@@ -8,6 +5,9 @@ import {
8
5
  migrateBlockToSettingsV2,
9
6
  studioDocumentToLayout
10
7
  } from "./chunk-7ZMXZRBP.mjs";
8
+ import {
9
+ sectionStyleDefaults
10
+ } from "./chunk-OQSEJXC4.mjs";
11
11
  import {
12
12
  assertStudioDocumentV1,
13
13
  compileStudioDocument,
@@ -1,12 +1,12 @@
1
- import {
2
- adminNavIcons
3
- } from "./chunk-W2UOCJDX.mjs";
4
1
  import {
5
2
  SOCIAL_MEDIA_DEFAULT_ICON_BY_PLATFORM,
6
3
  SOCIAL_MEDIA_ICON_OPTIONS,
7
4
  SOCIAL_MEDIA_PLATFORMS,
8
5
  SOCIAL_MEDIA_PLATFORM_LABELS
9
6
  } from "./chunk-ZTXJG4K5.mjs";
7
+ import {
8
+ adminNavIcons
9
+ } from "./chunk-W2UOCJDX.mjs";
10
10
  import {
11
11
  __export,
12
12
  __require