strapi-plugin-navigation 3.0.0 → 3.0.1-beta.0

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.
@@ -5641,7 +5641,7 @@ function createCollection(name2) {
5641
5641
  }
5642
5642
  const cache = /* @__PURE__ */ new Map();
5643
5643
  function useCollator(locale, options) {
5644
- const cacheKey = locale + (options ? Object.entries(options).sort((a, b) => a[0] < b[0] ? -1 : 1).join() : "");
5644
+ const cacheKey = locale + Object.entries(options).sort((a, b) => a[0] < b[0] ? -1 : 1).join();
5645
5645
  if (cache.has(cacheKey)) {
5646
5646
  return cache.get(cacheKey);
5647
5647
  }
@@ -22871,6 +22871,15 @@ class ViewUpdate {
22871
22871
  return (this.flags & 4) > 0;
22872
22872
  }
22873
22873
  /**
22874
+ Returns true when
22875
+ [`viewportChanged`](https://codemirror.net/6/docs/ref/#view.ViewUpdate.viewportChanged) is true
22876
+ and the viewport change is not just the result of mapping it in
22877
+ response to document changes.
22878
+ */
22879
+ get viewportMoved() {
22880
+ return (this.flags & 8) > 0;
22881
+ }
22882
+ /**
22874
22883
  Indicates whether the height of a block element in the editor
22875
22884
  changed in this update.
22876
22885
  */
@@ -22882,7 +22891,7 @@ class ViewUpdate {
22882
22891
  editor, or elements within the editor, changed.
22883
22892
  */
22884
22893
  get geometryChanged() {
22885
- return this.docChanged || (this.flags & (8 | 2)) > 0;
22894
+ return this.docChanged || (this.flags & (16 | 2)) > 0;
22886
22895
  }
22887
22896
  /**
22888
22897
  True when this update indicates a focus change.
@@ -25803,7 +25812,7 @@ class ViewState {
25803
25812
  this.updateViewportLines();
25804
25813
  if (this.lineGaps.length || this.viewport.to - this.viewport.from > 2e3 << 1)
25805
25814
  this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps, update.changes)));
25806
- update.flags |= this.computeVisibleRanges();
25815
+ update.flags |= this.computeVisibleRanges(update.changes);
25807
25816
  if (scrollTarget)
25808
25817
  this.scrollTarget = scrollTarget;
25809
25818
  if (!this.mustEnforceCursorAssoc && update.selectionSet && update.view.lineWrapping && update.state.selection.main.empty && update.state.selection.main.assoc && !update.state.facet(nativeSelectionHidden))
@@ -25825,7 +25834,7 @@ class ViewState {
25825
25834
  if (scaleX > 5e-3 && Math.abs(this.scaleX - scaleX) > 5e-3 || scaleY > 5e-3 && Math.abs(this.scaleY - scaleY) > 5e-3) {
25826
25835
  this.scaleX = scaleX;
25827
25836
  this.scaleY = scaleY;
25828
- result |= 8;
25837
+ result |= 16;
25829
25838
  refresh = measureContent = true;
25830
25839
  }
25831
25840
  }
@@ -25834,13 +25843,13 @@ class ViewState {
25834
25843
  if (this.paddingTop != paddingTop || this.paddingBottom != paddingBottom) {
25835
25844
  this.paddingTop = paddingTop;
25836
25845
  this.paddingBottom = paddingBottom;
25837
- result |= 8 | 2;
25846
+ result |= 16 | 2;
25838
25847
  }
25839
25848
  if (this.editorWidth != view.scrollDOM.clientWidth) {
25840
25849
  if (oracle.lineWrapping)
25841
25850
  measureContent = true;
25842
25851
  this.editorWidth = view.scrollDOM.clientWidth;
25843
- result |= 8;
25852
+ result |= 16;
25844
25853
  }
25845
25854
  let scrollTop = view.scrollDOM.scrollTop * this.scaleY;
25846
25855
  if (this.scrollTop != scrollTop) {
@@ -25863,7 +25872,7 @@ class ViewState {
25863
25872
  if (this.contentDOMWidth != contentWidth || this.editorHeight != view.scrollDOM.clientHeight) {
25864
25873
  this.contentDOMWidth = domRect.width;
25865
25874
  this.editorHeight = view.scrollDOM.clientHeight;
25866
- result |= 8;
25875
+ result |= 16;
25867
25876
  }
25868
25877
  if (measureContent) {
25869
25878
  let lineHeights = view.docView.measureVisibleLineHeights(this.viewport);
@@ -25874,7 +25883,7 @@ class ViewState {
25874
25883
  refresh = lineHeight > 0 && oracle.refresh(whiteSpace, lineHeight, charWidth, textHeight, contentWidth / charWidth, lineHeights);
25875
25884
  if (refresh) {
25876
25885
  view.docView.minWidth = 0;
25877
- result |= 8;
25886
+ result |= 16;
25878
25887
  }
25879
25888
  }
25880
25889
  if (dTop > 0 && dBottom > 0)
@@ -26076,7 +26085,7 @@ class ViewState {
26076
26085
  this.lineGapDeco = Decoration.set(gaps.map((gap) => gap.draw(this, this.heightOracle.lineWrapping)));
26077
26086
  }
26078
26087
  }
26079
- computeVisibleRanges() {
26088
+ computeVisibleRanges(changes) {
26080
26089
  let deco = this.stateDeco;
26081
26090
  if (this.lineGaps.length)
26082
26091
  deco = deco.concat(this.lineGapDeco);
@@ -26088,9 +26097,21 @@ class ViewState {
26088
26097
  point() {
26089
26098
  }
26090
26099
  }, 20);
26091
- let changed = ranges.length != this.visibleRanges.length || this.visibleRanges.some((r, i) => r.from != ranges[i].from || r.to != ranges[i].to);
26100
+ let changed = 0;
26101
+ if (ranges.length != this.visibleRanges.length) {
26102
+ changed = 8 | 4;
26103
+ } else {
26104
+ for (let i = 0; i < ranges.length && !(changed & 8); i++) {
26105
+ let old = this.visibleRanges[i], nw = ranges[i];
26106
+ if (old.from != nw.from || old.to != nw.to) {
26107
+ changed |= 4;
26108
+ if (!(changes && changes.mapPos(old.from, -1) == nw.from && changes.mapPos(old.to, 1) == nw.to))
26109
+ changed |= 8;
26110
+ }
26111
+ }
26112
+ }
26092
26113
  this.visibleRanges = ranges;
26093
- return changed ? 4 : 0;
26114
+ return changed;
26094
26115
  }
26095
26116
  lineBlockAt(pos) {
26096
26117
  return pos >= this.viewport.from && pos <= this.viewport.to && this.viewportLines.find((b) => b.from <= pos && b.to >= pos) || scaleBlock(this.heightMap.lineAt(pos, QueryType$1.ByPos, this.heightOracle, 0, 0), this.scaler);
@@ -28389,14 +28410,7 @@ function rectanglesForRange(view, className, range) {
28389
28410
  return pieces(top2).concat(between).concat(pieces(bottom));
28390
28411
  }
28391
28412
  function piece(left, top2, right, bottom) {
28392
- return new RectangleMarker(
28393
- className,
28394
- left - base2.left,
28395
- top2 - base2.top - 0.01,
28396
- right - left,
28397
- bottom - top2 + 0.01
28398
- /* C.Epsilon */
28399
- );
28413
+ return new RectangleMarker(className, left - base2.left, top2 - base2.top, right - left, bottom - top2);
28400
28414
  }
28401
28415
  function pieces({ top: top2, bottom, horizontal }) {
28402
28416
  let pieces2 = [];
@@ -28770,12 +28784,12 @@ class MatchDecorator {
28770
28784
  let changeFrom = 1e9, changeTo = -1;
28771
28785
  if (update.docChanged)
28772
28786
  update.changes.iterChanges((_f, _t, from, to) => {
28773
- if (to > update.view.viewport.from && from < update.view.viewport.to) {
28787
+ if (to >= update.view.viewport.from && from <= update.view.viewport.to) {
28774
28788
  changeFrom = Math.min(from, changeFrom);
28775
28789
  changeTo = Math.max(to, changeTo);
28776
28790
  }
28777
28791
  });
28778
- if (update.viewportChanged || changeTo - changeFrom > 1e3)
28792
+ if (update.viewportMoved || changeTo - changeFrom > 1e3)
28779
28793
  return this.createDeco(update.view);
28780
28794
  if (changeTo > -1)
28781
28795
  return this.updateRange(update.view, deco.map(update.changes), changeFrom, changeTo);
@@ -31038,10 +31052,10 @@ class IndentContext {
31038
31052
  const indentNodeProp = /* @__PURE__ */ new NodeProp();
31039
31053
  function syntaxIndentation(cx, ast, pos) {
31040
31054
  let stack = ast.resolveStack(pos);
31041
- let inner = stack.node.enterUnfinishedNodesBefore(pos);
31055
+ let inner = ast.resolveInner(pos, -1).resolve(pos, 0).enterUnfinishedNodesBefore(pos);
31042
31056
  if (inner != stack.node) {
31043
31057
  let add2 = [];
31044
- for (let cur2 = inner; cur2 != stack.node; cur2 = cur2.parent)
31058
+ for (let cur2 = inner; cur2 && !(cur2.from == stack.node.from && cur2.type == stack.node.type); cur2 = cur2.parent)
31045
31059
  add2.push(cur2);
31046
31060
  for (let i = add2.length - 1; i >= 0; i--)
31047
31061
  stack = { node: add2[i], next: stack };
@@ -50625,9 +50639,9 @@ const Field = ({ children, name: name2, hint, label, error, required }) => {
50625
50639
  );
50626
50640
  };
50627
50641
  const trads = {
50628
- en: () => Promise.resolve().then(() => require("../_chunks/en-CT7eKHZS.js")),
50629
- fr: () => Promise.resolve().then(() => require("../_chunks/fr-ybbSdjZO.js")),
50630
- ca: () => Promise.resolve().then(() => require("../_chunks/ca-DtaqQvTI.js"))
50642
+ en: () => Promise.resolve().then(() => require("../_chunks/en-DFL7XJr6.js")),
50643
+ fr: () => Promise.resolve().then(() => require("../_chunks/fr-CM4is9Gz.js")),
50644
+ ca: () => Promise.resolve().then(() => require("../_chunks/ca-DnfumDWu.js"))
50631
50645
  };
50632
50646
  const getTradId = (msg) => `${PLUGIN_ID}.${msg}`;
50633
50647
  const getTrad = (msg, defaultMessage) => ({
@@ -52778,7 +52792,7 @@ const Item = ({
52778
52792
  level,
52779
52793
  isLast,
52780
52794
  style: { opacity: isDragging ? 0.2 : 1 },
52781
- ref: refs ? refs.dropRef : void 0,
52795
+ ref: refs.dropRef,
52782
52796
  children: [
52783
52797
  /* @__PURE__ */ jsxRuntime.jsxs(
52784
52798
  Card,
@@ -53708,98 +53722,94 @@ const NavigationItemForm = ({
53708
53722
  isSingleSelected
53709
53723
  });
53710
53724
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
53711
- /* @__PURE__ */ jsxRuntime.jsxs(Grid.Root, { gap: 5, children: [
53712
- /* @__PURE__ */ jsxRuntime.jsx(Grid.Item, { alignItems: "flex-start", col: 12, children: /* @__PURE__ */ jsxRuntime.jsx(
53725
+ /* @__PURE__ */ jsxRuntime.jsxs(Grid.Root, { gap: 5, paddingBottom: 1, children: [
53726
+ /* @__PURE__ */ jsxRuntime.jsx(Grid.Item, { alignItems: "flex-start", col: 8, children: /* @__PURE__ */ jsxRuntime.jsx(
53713
53727
  Field,
53714
53728
  {
53715
- name: "title",
53716
- label: formatMessage(getTrad("popup.item.form.title.label", "Title")),
53717
- error: renderError("title"),
53729
+ name: "type",
53730
+ label: formatMessage(getTrad("popup.item.form.type.label", "Internal link")),
53731
+ error: renderError("type"),
53718
53732
  hint: formatMessage(
53719
53733
  getTrad("popup.item.form.title.placeholder", "e.g. Blog")
53720
53734
  ),
53721
53735
  children: /* @__PURE__ */ jsxRuntime.jsx(
53722
- TextInput,
53736
+ SingleSelect,
53723
53737
  {
53724
- type: "string",
53725
- disabled: !canUpdate || values.autoSync && values.type === "INTERNAL",
53726
- name: "title",
53727
- onChange: (eventOrPath, value) => handleChange(eventOrPath, value, onChange),
53728
- value: values.title
53738
+ onChange: (eventOrPath) => handleChange("type", eventOrPath, onChange),
53739
+ value: values.type,
53740
+ name: "type",
53741
+ disabled: !configQuery.data?.contentTypes.length || !canUpdate,
53742
+ width: "100%",
53743
+ children: navigationItemTypeOptions.map(({ key, label, value }) => /* @__PURE__ */ jsxRuntime.jsx(SingleSelectOption, { value, children: label }, key))
53729
53744
  }
53730
53745
  )
53731
53746
  }
53732
53747
  ) }, "title"),
53733
- /* @__PURE__ */ jsxRuntime.jsx(
53734
- Grid.Item,
53748
+ /* @__PURE__ */ jsxRuntime.jsx(Grid.Item, { alignItems: "flex-start", col: 4, children: /* @__PURE__ */ jsxRuntime.jsx(
53749
+ Field,
53735
53750
  {
53736
- alignItems: "flex-start",
53737
- col: values.type === "INTERNAL" ? 4 : 7,
53738
- lg: 12,
53751
+ name: "menuAttached",
53752
+ label: formatMessage(
53753
+ getTrad("popup.item.form.menuAttached.label", "MenuAttached")
53754
+ ),
53755
+ error: renderError("menuAttached"),
53756
+ hint: formatMessage(
53757
+ getTrad(
53758
+ "popup.item.form.menuAttached.placeholder",
53759
+ "is menu item attached to menu"
53760
+ )
53761
+ ),
53739
53762
  children: /* @__PURE__ */ jsxRuntime.jsx(
53740
- Field,
53763
+ Toggle,
53741
53764
  {
53742
- name: "type",
53743
- label: formatMessage(getTrad("popup.item.form.type.label", "Internal link")),
53744
- error: renderError("type"),
53745
- hint: formatMessage(
53746
- getTrad("popup.item.form.title.placeholder", "e.g. Blog")
53765
+ name: "menuAttached",
53766
+ checked: values.menuAttached,
53767
+ onChange: (eventOrPath) => handleChange(eventOrPath, !values.menuAttached, onChange),
53768
+ value: values.menuAttached,
53769
+ onLabel: formatMessage(
53770
+ getTrad("popup.item.form.menuAttached.value.yes", "yes")
53747
53771
  ),
53748
- children: /* @__PURE__ */ jsxRuntime.jsx(
53749
- SingleSelect,
53750
- {
53751
- onChange: (eventOrPath) => handleChange("type", eventOrPath, onChange),
53752
- value: values.type,
53753
- name: "type",
53754
- disabled: !configQuery.data?.contentTypes.length || !canUpdate,
53755
- width: "100%",
53756
- children: navigationItemTypeOptions.map(({ key, label, value }) => /* @__PURE__ */ jsxRuntime.jsx(SingleSelectOption, { value, children: label }, key))
53757
- }
53758
- )
53772
+ offLabel: formatMessage(
53773
+ getTrad("popup.item.form.menuAttached.value.no", "no")
53774
+ ),
53775
+ disabled: !canUpdate || (configQuery.data?.cascadeMenuAttached ? !(current.isMenuAllowedLevel && current.parentAttachedToMenu) : false),
53776
+ width: "100%"
53759
53777
  }
53760
53778
  )
53761
- },
53762
- "type"
53763
- ),
53779
+ }
53780
+ ) }, "menuAttached")
53781
+ ] }),
53782
+ /* @__PURE__ */ jsxRuntime.jsxs(Grid.Root, { gap: 5, paddingTop: 1, paddingBottom: 1, children: [
53764
53783
  /* @__PURE__ */ jsxRuntime.jsx(
53765
53784
  Grid.Item,
53766
53785
  {
53767
53786
  alignItems: "flex-start",
53768
- col: values.type === "INTERNAL" ? 4 : 5,
53769
- lg: 12,
53787
+ col: values.type === "INTERNAL" ? 8 : 12,
53770
53788
  children: /* @__PURE__ */ jsxRuntime.jsx(
53771
53789
  Field,
53772
53790
  {
53773
- name: "menuAttached",
53774
- label: formatMessage(
53775
- getTrad("popup.item.form.menuAttached.label", "MenuAttached")
53776
- ),
53777
- error: renderError("menuAttached"),
53791
+ name: "title",
53792
+ label: formatMessage(getTrad("popup.item.form.title.label", "Title")),
53793
+ error: renderError("title"),
53778
53794
  hint: formatMessage(
53779
- getTrad(
53780
- "popup.item.form.menuAttached.placeholder",
53781
- "is menu item attached to menu"
53782
- )
53795
+ getTrad("popup.item.form.title.placeholder", "e.g. Blog")
53783
53796
  ),
53784
53797
  children: /* @__PURE__ */ jsxRuntime.jsx(
53785
- Toggle,
53798
+ TextInput,
53786
53799
  {
53787
- name: "menuAttached",
53788
- checked: values.menuAttached,
53789
- onChange: (eventOrPath) => handleChange(eventOrPath, !values.menuAttached, onChange),
53790
- value: values.menuAttached,
53791
- onLabel: "true",
53792
- offLabel: "false",
53793
- disabled: !canUpdate || (configQuery.data?.cascadeMenuAttached ? !(current.isMenuAllowedLevel && current.parentAttachedToMenu) : false),
53794
- width: "100%"
53800
+ type: "string",
53801
+ disabled: !canUpdate || values.autoSync && values.type === "INTERNAL",
53802
+ name: "title",
53803
+ onChange: (eventOrPath, value) => handleChange(eventOrPath, value, onChange),
53804
+ value: values.title
53795
53805
  }
53796
53806
  )
53797
53807
  }
53798
53808
  )
53799
53809
  },
53800
- "menuAttached"
53810
+ "title"
53801
53811
  ),
53802
- values.type === "INTERNAL" && /* @__PURE__ */ jsxRuntime.jsx(Grid.Item, { alignItems: "flex-start", col: 4, lg: 12, children: /* @__PURE__ */ jsxRuntime.jsx(
53812
+ values.type === "INTERNAL" && /* @__PURE__ */ jsxRuntime.jsx(Grid.Item, { alignItems: "flex-start", col: 4, children: /* @__PURE__ */ jsxRuntime.jsx(
53803
53813
  Field,
53804
53814
  {
53805
53815
  name: "autoSync",
@@ -53818,153 +53828,159 @@ const NavigationItemForm = ({
53818
53828
  }
53819
53829
  )
53820
53830
  }
53821
- ) }, "autoSync"),
53822
- /* @__PURE__ */ jsxRuntime.jsx(Grid.Item, { alignItems: "flex-start", col: 12, children: /* @__PURE__ */ jsxRuntime.jsx(
53831
+ ) }, "autoSync")
53832
+ ] }),
53833
+ /* @__PURE__ */ jsxRuntime.jsx(Grid.Root, { gap: 5, paddingTop: 1, paddingBottom: 1, children: /* @__PURE__ */ jsxRuntime.jsx(Grid.Item, { alignItems: "flex-start", col: 12, children: /* @__PURE__ */ jsxRuntime.jsx(
53834
+ Field,
53835
+ {
53836
+ name: pathSourceName,
53837
+ label: formatMessage(
53838
+ getTrad(`popup.item.form.${pathSourceName}.label`, "Path")
53839
+ ),
53840
+ error: renderError(pathSourceName),
53841
+ hint: [
53842
+ formatMessage(
53843
+ getTrad(`popup.item.form.${pathSourceName}.placeholder`, "e.g. Blog")
53844
+ ),
53845
+ pathDefault ? formatMessage(getTrad("popup.item.form.type.external.description"), {
53846
+ value: pathDefault
53847
+ }) : ""
53848
+ ].join(" "),
53849
+ children: /* @__PURE__ */ jsxRuntime.jsx(
53850
+ TextInput,
53851
+ {
53852
+ disabled: !canUpdate,
53853
+ name: pathSourceName,
53854
+ onChange: (eventOrPath, value) => handleChange(eventOrPath, value, onChange),
53855
+ value: values[pathSourceName],
53856
+ width: "100%"
53857
+ }
53858
+ )
53859
+ }
53860
+ ) }, "title") }),
53861
+ values.type === "INTERNAL" && /* @__PURE__ */ jsxRuntime.jsxs(Grid.Root, { gap: 5, paddingTop: 1, paddingBottom: 1, children: [
53862
+ /* @__PURE__ */ jsxRuntime.jsx(
53863
+ Grid.Item,
53864
+ {
53865
+ alignItems: "flex-start",
53866
+ col: values.relatedType && !isSingleSelected ? 6 : 12,
53867
+ children: /* @__PURE__ */ jsxRuntime.jsx(
53868
+ Field,
53869
+ {
53870
+ name: "relatedType",
53871
+ label: formatMessage(
53872
+ getTrad("popup.item.form.relatedType.label", "Related Type")
53873
+ ),
53874
+ error: renderError("relatedType"),
53875
+ hint: !isLoading && lodash$1.isEmpty(relatedTypeSelectOptions) ? formatMessage(
53876
+ getTrad(
53877
+ "popup.item.form.relatedType.empty",
53878
+ "There are no more content types"
53879
+ )
53880
+ ) : void 0,
53881
+ children: /* @__PURE__ */ jsxRuntime.jsx(
53882
+ SingleSelect,
53883
+ {
53884
+ name: "relatedType",
53885
+ onChange: (eventOrPath) => handleChange("relatedType", eventOrPath, onChange),
53886
+ value: values.relatedType,
53887
+ disabled: !configQuery.data?.contentTypes.length || !canUpdate,
53888
+ width: "100%",
53889
+ children: configQuery.data?.contentTypes.map((contentType2) => /* @__PURE__ */ jsxRuntime.jsx(SingleSelectOption, { value: contentType2.uid, children: contentType2.contentTypeName }, contentType2.uid))
53890
+ }
53891
+ )
53892
+ }
53893
+ )
53894
+ }
53895
+ ),
53896
+ values.relatedType && !isSingleSelected && /* @__PURE__ */ jsxRuntime.jsx(Grid.Item, { alignItems: "flex-start", col: 6, children: /* @__PURE__ */ jsxRuntime.jsx(
53823
53897
  Field,
53824
53898
  {
53825
- name: pathSourceName,
53826
- label: formatMessage(
53827
- getTrad(`popup.item.form.${pathSourceName}.label`, "Path")
53828
- ),
53829
- error: renderError(pathSourceName),
53830
- hint: [
53831
- formatMessage(
53832
- getTrad(`popup.item.form.${pathSourceName}.placeholder`, "e.g. Blog")
53899
+ name: "related",
53900
+ label: formatMessage(getTrad("popup.item.form.related.label", "Related")),
53901
+ error: renderError("related"),
53902
+ hint: !isLoading && thereAreNoMoreContentTypes ? formatMessage(
53903
+ getTrad(
53904
+ "popup.item.form.related.empty",
53905
+ "There are no more entities"
53833
53906
  ),
53834
- pathDefault ? formatMessage(getTrad("popup.item.form.type.external.description"), {
53835
- value: pathDefault
53836
- }) : ""
53837
- ].join(" "),
53907
+ { contentTypeName: values.relatedType }
53908
+ ) : void 0,
53838
53909
  children: /* @__PURE__ */ jsxRuntime.jsx(
53839
- TextInput,
53910
+ SingleSelect,
53840
53911
  {
53841
- disabled: !canUpdate,
53842
- name: pathSourceName,
53843
- onChange: (eventOrPath, value) => handleChange(eventOrPath, value, onChange),
53844
- value: values[pathSourceName],
53845
- width: "100%"
53912
+ name: "related",
53913
+ onChange: (eventOrPath) => handleChange("related", eventOrPath, onChange),
53914
+ value: values.related,
53915
+ options: relatedSelectOptions,
53916
+ disabled: isLoading || thereAreNoMoreContentTypes || !canUpdate,
53917
+ width: "100%",
53918
+ children: relatedSelectOptions.map(({ key, label, value }) => /* @__PURE__ */ jsxRuntime.jsx(SingleSelectOption, { value, children: label }, key))
53846
53919
  }
53847
53920
  )
53848
53921
  }
53849
- ) }, pathSourceName),
53850
- values.type === "INTERNAL" && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
53851
- /* @__PURE__ */ jsxRuntime.jsx(Grid.Item, { alignItems: "flex-start", col: 6, lg: 12, children: /* @__PURE__ */ jsxRuntime.jsx(
53852
- Field,
53853
- {
53854
- name: "relatedType",
53855
- label: formatMessage(
53856
- getTrad("popup.item.form.relatedType.label", "Related Type")
53857
- ),
53858
- error: renderError("relatedType"),
53859
- hint: !isLoading && lodash$1.isEmpty(relatedTypeSelectOptions) ? formatMessage(
53860
- getTrad(
53861
- "popup.item.form.relatedType.empty",
53862
- "There are no more content types"
53863
- )
53864
- ) : void 0,
53865
- children: /* @__PURE__ */ jsxRuntime.jsx(
53866
- SingleSelect,
53867
- {
53868
- name: "relatedType",
53869
- onChange: (eventOrPath) => handleChange("relatedType", eventOrPath, onChange),
53870
- value: values.relatedType,
53871
- disabled: !configQuery.data?.contentTypes.length || !canUpdate,
53872
- width: "100%",
53873
- children: configQuery.data?.contentTypes.map((contentType2) => /* @__PURE__ */ jsxRuntime.jsx(SingleSelectOption, { value: contentType2.uid, children: contentType2.contentTypeName }, contentType2.uid))
53874
- }
53875
- )
53922
+ ) })
53923
+ ] }),
53924
+ !lodash$1.isEmpty(configQuery.data?.additionalFields) && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
53925
+ /* @__PURE__ */ jsxRuntime.jsx(Grid.Root, { gap: 5, paddingTop: 1, paddingBottom: 1, children: /* @__PURE__ */ jsxRuntime.jsx(Grid.Item, { col: 12, lg: 12, children: /* @__PURE__ */ jsxRuntime.jsx(Divider, { width: "100%" }) }) }),
53926
+ /* @__PURE__ */ jsxRuntime.jsxs(Grid.Root, { gap: 5, paddingTop: 1, paddingBottom: 1, children: [
53927
+ configQuery.data?.additionalFields.map(
53928
+ (additionalField, index2) => {
53929
+ if (additionalField !== "audience") {
53930
+ return /* @__PURE__ */ jsxRuntime.jsx(Grid.Item, { alignItems: "flex-start", col: 6, children: /* @__PURE__ */ jsxRuntime.jsx(
53931
+ Field,
53932
+ {
53933
+ name: `additionalFields.${additionalField.name}`,
53934
+ label: additionalField.label,
53935
+ error: renderError(`additionalFields.${additionalField.name}`),
53936
+ children: /* @__PURE__ */ jsxRuntime.jsx(
53937
+ AdditionalFieldInput,
53938
+ {
53939
+ name: `additionalFields.${additionalField.name}`,
53940
+ field: additionalField,
53941
+ isLoading,
53942
+ onChange,
53943
+ onChangeEnhancer: handleChange,
53944
+ value: lodash$1.get(values?.additionalFields, additionalField.name),
53945
+ disabled: !canUpdate
53946
+ }
53947
+ )
53948
+ }
53949
+ ) }, additionalField.name);
53950
+ }
53876
53951
  }
53877
- ) }),
53878
- values.relatedType && !isSingleSelected && /* @__PURE__ */ jsxRuntime.jsx(Grid.Item, { alignItems: "flex-start", col: 6, lg: 12, children: /* @__PURE__ */ jsxRuntime.jsx(
53879
- Field,
53880
- {
53881
- name: "related",
53882
- label: formatMessage(
53883
- getTrad("popup.item.form.related.label", "Related")
53884
- ),
53885
- error: renderError("related"),
53886
- hint: !isLoading && thereAreNoMoreContentTypes ? formatMessage(
53887
- getTrad(
53888
- "popup.item.form.related.empty",
53889
- "There are no more entities"
53890
- ),
53891
- { contentTypeName: values.relatedType }
53892
- ) : void 0,
53893
- children: /* @__PURE__ */ jsxRuntime.jsx(
53894
- SingleSelect,
53895
- {
53896
- name: "related",
53897
- onChange: (eventOrPath) => handleChange("related", eventOrPath, onChange),
53898
- value: values.related,
53899
- options: relatedSelectOptions,
53900
- disabled: isLoading || thereAreNoMoreContentTypes || !canUpdate,
53901
- width: "100%",
53902
- children: relatedSelectOptions.map(({ key, label, value }) => /* @__PURE__ */ jsxRuntime.jsx(SingleSelectOption, { value, children: label }, key))
53903
- }
53904
- )
53952
+ ),
53953
+ configQuery.data?.additionalFields.map(
53954
+ (additionalField, index2) => {
53955
+ if (additionalField === "audience") {
53956
+ return /* @__PURE__ */ jsxRuntime.jsx(Grid.Item, { alignItems: "flex-start", col: 12, children: /* @__PURE__ */ jsxRuntime.jsx(
53957
+ Field,
53958
+ {
53959
+ name: "audience",
53960
+ label: formatMessage(getTrad("popup.item.form.audience.label")),
53961
+ error: renderError("audience"),
53962
+ hint: !isLoading && lodash$1.isEmpty(audienceOptions) ? formatMessage(
53963
+ getTrad("popup.item.form.title.placeholder", "e.g. Blog")
53964
+ ) : void 0,
53965
+ children: /* @__PURE__ */ jsxRuntime.jsx(
53966
+ MultiSelect,
53967
+ {
53968
+ name: "audience",
53969
+ value: values.audience,
53970
+ onChange: (eventOrPath) => handleChange("audience", eventOrPath, onChange),
53971
+ width: "100%",
53972
+ children: audienceOptions.map(({ value, label }) => /* @__PURE__ */ jsxRuntime.jsx(MultiSelectOption, { value, children: label }, value))
53973
+ }
53974
+ )
53975
+ }
53976
+ ) }, "audience");
53977
+ }
53905
53978
  }
53906
- ) })
53979
+ )
53907
53980
  ] }),
53908
- !lodash$1.isEmpty(configQuery.data?.additionalFields) && /* @__PURE__ */ jsxRuntime.jsx(Grid.Item, { col: 12, lg: 12, children: /* @__PURE__ */ jsxRuntime.jsx(Divider, { width: "100%" }) }),
53909
- configQuery.data?.additionalFields.map(
53910
- (additionalField, index2) => {
53911
- if (additionalField === "audience") {
53912
- return /* @__PURE__ */ jsxRuntime.jsx(Grid.Item, { alignItems: "flex-start", col: 6, lg: 12, children: /* @__PURE__ */ jsxRuntime.jsx(
53913
- Field,
53914
- {
53915
- name: "audience",
53916
- label: formatMessage(getTrad("popup.item.form.audience.label")),
53917
- error: renderError("audience"),
53918
- hint: !isLoading && lodash$1.isEmpty(audienceOptions) ? formatMessage(
53919
- getTrad("popup.item.form.title.placeholder", "e.g. Blog")
53920
- ) : void 0,
53921
- children: /* @__PURE__ */ jsxRuntime.jsx(
53922
- MultiSelect,
53923
- {
53924
- name: "audience",
53925
- value: values.audience,
53926
- onChange: (eventOrPath) => handleChange("audience", eventOrPath, onChange),
53927
- width: "100%",
53928
- children: audienceOptions.map(({ value, label }) => /* @__PURE__ */ jsxRuntime.jsx(MultiSelectOption, { value, children: label }, value))
53929
- }
53930
- )
53931
- }
53932
- ) }, "audience");
53933
- } else {
53934
- return /* @__PURE__ */ jsxRuntime.jsx(
53935
- Grid.Item,
53936
- {
53937
- alignItems: "flex-start",
53938
- col: 6,
53939
- lg: 12,
53940
- children: /* @__PURE__ */ jsxRuntime.jsx(
53941
- Field,
53942
- {
53943
- name: `additionalFields.${additionalField.name}`,
53944
- label: additionalField.label,
53945
- error: renderError(`additionalFields.${additionalField.name}`),
53946
- children: /* @__PURE__ */ jsxRuntime.jsx(
53947
- AdditionalFieldInput,
53948
- {
53949
- name: `additionalFields.${additionalField.name}`,
53950
- field: additionalField,
53951
- isLoading,
53952
- onChange,
53953
- onChangeEnhancer: handleChange,
53954
- value: lodash$1.get(values?.additionalFields, additionalField.name),
53955
- disabled: !canUpdate
53956
- }
53957
- )
53958
- }
53959
- )
53960
- },
53961
- additionalField.name
53962
- );
53963
- }
53964
- }
53965
- )
53981
+ /* @__PURE__ */ jsxRuntime.jsx(Grid.Root, { gap: 5, paddingTop: 1, paddingBottom: 1, children: /* @__PURE__ */ jsxRuntime.jsx(Grid.Item, { col: 12, lg: 12, children: /* @__PURE__ */ jsxRuntime.jsx(Divider, { width: "100%" }) }) })
53966
53982
  ] }),
53967
- availableLocaleOptions && availableLocaleOptions.length > 1 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
53983
+ availableLocaleOptions && availableLocaleOptions.length > 1 && /* @__PURE__ */ jsxRuntime.jsx(Grid.Root, { gap: 5, paddingTop: 1, paddingBottom: 1, children: /* @__PURE__ */ jsxRuntime.jsxs(Grid.Item, { alignItems: "flex-start", col: 12, children: [
53968
53984
  /* @__PURE__ */ jsxRuntime.jsx(Divider, { marginTop: 5, marginBottom: 5 }),
53969
53985
  /* @__PURE__ */ jsxRuntime.jsxs(Grid.Root, { gap: 5, children: [
53970
53986
  /* @__PURE__ */ jsxRuntime.jsx(Grid.Item, { alignItems: "flex-start", col: 6, lg: 12, children: /* @__PURE__ */ jsxRuntime.jsx(
@@ -53999,7 +54015,8 @@ const NavigationItemForm = ({
53999
54015
  }
54000
54016
  ) }) })
54001
54017
  ] })
54002
- ] })
54018
+ ] }, "title") }),
54019
+ /* @__PURE__ */ jsxRuntime.jsx(Grid.Root, { gap: 5, children: /* @__PURE__ */ jsxRuntime.jsx(Grid.Item, { alignItems: "flex-start", col: 12 }, "title") })
54003
54020
  ] });
54004
54021
  } }) }),
54005
54022
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -54189,7 +54206,7 @@ const Inner$1 = () => {
54189
54206
  const [currentLocale, setCurrentLocale] = React.useState();
54190
54207
  const viewPermissions = React.useMemo(
54191
54208
  () => ({
54192
- access: pluginPermissions.access || pluginPermissions.update,
54209
+ access: pluginPermissions.access,
54193
54210
  update: pluginPermissions.update
54194
54211
  }),
54195
54212
  []