strapi-plugin-navigation 3.0.3 → 3.0.5
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/README.md +6 -6
- package/dist/admin/index.js +65 -52
- package/dist/admin/index.mjs +65 -52
- package/dist/server/index.js +16 -18
- package/dist/server/index.mjs +16 -18
- package/dist/server/src/controllers/client.d.ts +5 -0
- package/dist/server/src/graphql/queries/render-navigation-child.d.ts +1 -0
- package/dist/server/src/graphql/queries/render-navigation.d.ts +1 -0
- package/dist/server/src/index.d.ts +3 -0
- package/dist/server/src/repositories/navigation-item.d.ts +1 -1
- package/dist/server/src/services/client/client.d.ts +3 -0
- package/dist/server/src/services/client/types.d.ts +1 -1
- package/dist/server/src/services/index.d.ts +3 -0
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -30,7 +30,6 @@ Strapi Navigation Plugin provides a website navigation / menu builder feature fo
|
|
|
30
30
|
- Tree (nested)
|
|
31
31
|
- RFR (ready for handling by Redux First Router)
|
|
32
32
|
|
|
33
|
-
|
|
34
33
|
### Table of Contents
|
|
35
34
|
1. [💎 Versions](#-versions)
|
|
36
35
|
2. [✨ Features](#-features)
|
|
@@ -55,6 +54,7 @@ Strapi Navigation Plugin provides a website navigation / menu builder feature fo
|
|
|
55
54
|
17. [👨💻 Community support](#-community-support)
|
|
56
55
|
|
|
57
56
|
## 💎 Versions
|
|
57
|
+
|
|
58
58
|
- **Strapi v5** - (current) [v3.x](https://github.com/VirtusLab-Open-Source/strapi-plugin-navigation)
|
|
59
59
|
- **Strapi v4** - [v2.x](https://github.com/VirtusLab-Open-Source/strapi-plugin-navigation/tree/strapi-v4)
|
|
60
60
|
- **Strapi v3** - [v1.x](https://github.com/VirtusLab-Open-Source/strapi-plugin-navigation/tree/strapi-v3)
|
|
@@ -113,7 +113,7 @@ Complete installation requirements are exact same as for Strapi itself and can b
|
|
|
113
113
|
|
|
114
114
|
**Supported Strapi versions**:
|
|
115
115
|
|
|
116
|
-
- Strapi v5.
|
|
116
|
+
- Strapi v5.7.0 (recently tested)
|
|
117
117
|
- Strapi v5.x
|
|
118
118
|
|
|
119
119
|
> This plugin is designed for **Strapi v5** and is not working with v4.x. To get version for **Strapi v4** install version [v4.x](https://github.com/VirtusLab-Open-Source/strapi-plugin-navigation/tree/strapi-v4).
|
|
@@ -122,7 +122,7 @@ Complete installation requirements are exact same as for Strapi itself and can b
|
|
|
122
122
|
|
|
123
123
|
## 🔧 Configuration
|
|
124
124
|
|
|
125
|
-
To start your journey with **Navigation plugin** you must first setup it using the dedicated Settings page or for any version, put your configuration in `config/plugins.{js
|
|
125
|
+
To start your journey with **Navigation plugin** you must first setup it using the dedicated Settings page or for any version, put your configuration in `config/plugins.{js|ts}`. Anyway we're recommending the click-through option where your configuration is going to be properly validated.
|
|
126
126
|
|
|
127
127
|
### Settings page
|
|
128
128
|
|
|
@@ -137,7 +137,7 @@ On the dedicated page, you will be able to set up all crucial properties which d
|
|
|
137
137
|
|
|
138
138
|
### File
|
|
139
139
|
|
|
140
|
-
Config for this plugin is stored as a part of the `config/plugins.{js
|
|
140
|
+
Config for this plugin is stored as a part of the `config/plugins.{js|ts}` or `config/<env>/plugins.{js|ts}` file. You can use the following snippet to make sure that the config structure is correct. If you've got already configurations for other plugins stores by this way, you can use the `navigation` along with them.
|
|
141
141
|
|
|
142
142
|
|
|
143
143
|
```ts
|
|
@@ -734,7 +734,7 @@ Live example of plugin usage can be found in the [VirtusLab Strapi Examples](htt
|
|
|
734
734
|
|
|
735
735
|
**Q:** I would like to use GraphQL schemas but I'm not getting `renderNavigation` query or even proper types as Navigation, NavigationItem etc. What should I do?
|
|
736
736
|
|
|
737
|
-
**A:** There is a one trick you might try. Strapi by default is ordering plugins by the way which takes `strapi-plugin-graphql` to initialize earlier than other plugins so types might not be injected. If you don't have it yet, please create `config/plugins.{js
|
|
737
|
+
**A:** There is a one trick you might try. Strapi by default is ordering plugins by the way which takes `strapi-plugin-graphql` to initialize earlier than other plugins so types might not be injected. If you don't have it yet, please create `config/plugins.{js|ts}` file and put there following lines (put `graphql` at the end):
|
|
738
738
|
|
|
739
739
|
```ts
|
|
740
740
|
module.exports = {
|
|
@@ -774,7 +774,7 @@ Feel free to fork and make a Pull Request to this plugin project. All the input
|
|
|
774
774
|
yarn watch:link
|
|
775
775
|
```
|
|
776
776
|
|
|
777
|
-
3. Within the Strapi project, modify `config/plugins.{js
|
|
777
|
+
3. Within the Strapi project, modify `config/plugins.{js|ts}` for `imgix`
|
|
778
778
|
|
|
779
779
|
```ts
|
|
780
780
|
//...
|
package/dist/admin/index.js
CHANGED
|
@@ -2519,7 +2519,7 @@ function isTopLayer(element) {
|
|
|
2519
2519
|
function isContainingBlock(elementOrCss) {
|
|
2520
2520
|
const webkit2 = isWebKit();
|
|
2521
2521
|
const css = isElement(elementOrCss) ? getComputedStyle$1(elementOrCss) : elementOrCss;
|
|
2522
|
-
return
|
|
2522
|
+
return ["transform", "translate", "scale", "rotate", "perspective"].some((value) => css[value] ? css[value] !== "none" : false) || (css.containerType ? css.containerType !== "normal" : false) || !webkit2 && (css.backdropFilter ? css.backdropFilter !== "none" : false) || !webkit2 && (css.filter ? css.filter !== "none" : false) || ["transform", "translate", "scale", "rotate", "perspective", "filter"].some((value) => (css.willChange || "").includes(value)) || ["paint", "layout", "strict", "content"].some((value) => (css.contain || "").includes(value));
|
|
2523
2523
|
}
|
|
2524
2524
|
function getContainingBlock(element) {
|
|
2525
2525
|
let currentNode = getParentNode(element);
|
|
@@ -3025,6 +3025,9 @@ const platform = {
|
|
|
3025
3025
|
isElement,
|
|
3026
3026
|
isRTL
|
|
3027
3027
|
};
|
|
3028
|
+
function rectsAreEqual(a, b) {
|
|
3029
|
+
return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
|
|
3030
|
+
}
|
|
3028
3031
|
function observeMove(element, onMove) {
|
|
3029
3032
|
let io = null;
|
|
3030
3033
|
let timeoutId;
|
|
@@ -3043,12 +3046,13 @@ function observeMove(element, onMove) {
|
|
|
3043
3046
|
threshold = 1;
|
|
3044
3047
|
}
|
|
3045
3048
|
cleanup();
|
|
3049
|
+
const elementRectForRootMargin = element.getBoundingClientRect();
|
|
3046
3050
|
const {
|
|
3047
3051
|
left,
|
|
3048
3052
|
top: top2,
|
|
3049
3053
|
width,
|
|
3050
3054
|
height
|
|
3051
|
-
} =
|
|
3055
|
+
} = elementRectForRootMargin;
|
|
3052
3056
|
if (!skip) {
|
|
3053
3057
|
onMove();
|
|
3054
3058
|
}
|
|
@@ -3079,6 +3083,9 @@ function observeMove(element, onMove) {
|
|
|
3079
3083
|
refresh(false, ratio);
|
|
3080
3084
|
}
|
|
3081
3085
|
}
|
|
3086
|
+
if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
|
|
3087
|
+
refresh();
|
|
3088
|
+
}
|
|
3082
3089
|
isFirstUpdate = false;
|
|
3083
3090
|
}
|
|
3084
3091
|
try {
|
|
@@ -3142,7 +3149,7 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
3142
3149
|
}
|
|
3143
3150
|
function frameLoop() {
|
|
3144
3151
|
const nextRefRect = getBoundingClientRect(reference);
|
|
3145
|
-
if (prevRefRect && (
|
|
3152
|
+
if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
|
|
3146
3153
|
update();
|
|
3147
3154
|
}
|
|
3148
3155
|
prevRefRect = nextRefRect;
|
|
@@ -5295,9 +5302,9 @@ var handleScroll$2 = function(axis, endTarget, event, sourceDelta, noOverscroll)
|
|
|
5295
5302
|
!targetInLock && target !== document.body || // self content
|
|
5296
5303
|
targetInLock && (endTarget.contains(target) || endTarget === target)
|
|
5297
5304
|
);
|
|
5298
|
-
if (isDeltaPositive && (Math.abs(availableScroll) < 1 ||
|
|
5305
|
+
if (isDeltaPositive && (Math.abs(availableScroll) < 1 || false)) {
|
|
5299
5306
|
shouldCancelScroll = true;
|
|
5300
|
-
} else if (!isDeltaPositive && (Math.abs(availableScrollTop) < 1 ||
|
|
5307
|
+
} else if (!isDeltaPositive && (Math.abs(availableScrollTop) < 1 || false)) {
|
|
5301
5308
|
shouldCancelScroll = true;
|
|
5302
5309
|
}
|
|
5303
5310
|
return shouldCancelScroll;
|
|
@@ -5379,7 +5386,7 @@ function RemoveScrollSideCar$2(props) {
|
|
|
5379
5386
|
return true;
|
|
5380
5387
|
}
|
|
5381
5388
|
var cancelingAxis = activeAxis.current || currentAxis;
|
|
5382
|
-
return handleScroll$2(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY
|
|
5389
|
+
return handleScroll$2(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY);
|
|
5383
5390
|
}, []);
|
|
5384
5391
|
var shouldPrevent = React__namespace.useCallback(function(_event) {
|
|
5385
5392
|
var event = _event;
|
|
@@ -10762,9 +10769,9 @@ var handleScroll$1 = function(axis, endTarget, event, sourceDelta, noOverscroll)
|
|
|
10762
10769
|
!targetInLock && target !== document.body || // self content
|
|
10763
10770
|
targetInLock && (endTarget.contains(target) || endTarget === target)
|
|
10764
10771
|
);
|
|
10765
|
-
if (isDeltaPositive && (availableScroll === 0 ||
|
|
10772
|
+
if (isDeltaPositive && (availableScroll === 0 || false)) {
|
|
10766
10773
|
shouldCancelScroll = true;
|
|
10767
|
-
} else if (!isDeltaPositive && (availableScrollTop === 0 ||
|
|
10774
|
+
} else if (!isDeltaPositive && (availableScrollTop === 0 || false)) {
|
|
10768
10775
|
shouldCancelScroll = true;
|
|
10769
10776
|
}
|
|
10770
10777
|
return shouldCancelScroll;
|
|
@@ -10848,7 +10855,7 @@ function RemoveScrollSideCar$1(props) {
|
|
|
10848
10855
|
return true;
|
|
10849
10856
|
}
|
|
10850
10857
|
var cancelingAxis = activeAxis.current || currentAxis;
|
|
10851
|
-
return handleScroll$1(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY
|
|
10858
|
+
return handleScroll$1(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY);
|
|
10852
10859
|
}, []);
|
|
10853
10860
|
var shouldPrevent = React__namespace.useCallback(function(_event) {
|
|
10854
10861
|
var event = _event;
|
|
@@ -12587,9 +12594,9 @@ var handleScroll = function(axis, endTarget, event, sourceDelta, noOverscroll) {
|
|
|
12587
12594
|
!targetInLock && target !== document.body || // self content
|
|
12588
12595
|
targetInLock && (endTarget.contains(target) || endTarget === target)
|
|
12589
12596
|
);
|
|
12590
|
-
if (isDeltaPositive && (Math.abs(availableScroll) < 1 ||
|
|
12597
|
+
if (isDeltaPositive && (Math.abs(availableScroll) < 1 || false)) {
|
|
12591
12598
|
shouldCancelScroll = true;
|
|
12592
|
-
} else if (!isDeltaPositive && (Math.abs(availableScrollTop) < 1 ||
|
|
12599
|
+
} else if (!isDeltaPositive && (Math.abs(availableScrollTop) < 1 || false)) {
|
|
12593
12600
|
shouldCancelScroll = true;
|
|
12594
12601
|
}
|
|
12595
12602
|
return shouldCancelScroll;
|
|
@@ -12671,7 +12678,7 @@ function RemoveScrollSideCar(props) {
|
|
|
12671
12678
|
return true;
|
|
12672
12679
|
}
|
|
12673
12680
|
var cancelingAxis = activeAxis.current || currentAxis;
|
|
12674
|
-
return handleScroll(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY
|
|
12681
|
+
return handleScroll(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY);
|
|
12675
12682
|
}, []);
|
|
12676
12683
|
var shouldPrevent = React__namespace.useCallback(function(_event) {
|
|
12677
12684
|
var event = _event;
|
|
@@ -16765,26 +16772,26 @@ const jsonHighlighting = styleTags({
|
|
|
16765
16772
|
"True False": tags.bool,
|
|
16766
16773
|
PropertyName: tags.propertyName,
|
|
16767
16774
|
Null: tags.null,
|
|
16768
|
-
",": tags.separator,
|
|
16775
|
+
", :": tags.separator,
|
|
16769
16776
|
"[ ]": tags.squareBracket,
|
|
16770
16777
|
"{ }": tags.brace
|
|
16771
16778
|
});
|
|
16772
16779
|
const parser = LRParser.deserialize({
|
|
16773
16780
|
version: 14,
|
|
16774
|
-
states: "$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#
|
|
16775
|
-
stateData: "#O~
|
|
16776
|
-
goto: "!
|
|
16777
|
-
nodeNames: "⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array",
|
|
16781
|
+
states: "$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",
|
|
16782
|
+
stateData: "#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",
|
|
16783
|
+
goto: "!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",
|
|
16784
|
+
nodeNames: "⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",
|
|
16778
16785
|
maxTerm: 25,
|
|
16779
16786
|
nodeProps: [
|
|
16780
16787
|
["isolate", -2, 6, 11, ""],
|
|
16781
|
-
["openedBy", 7, "{",
|
|
16782
|
-
["closedBy", 8, "}",
|
|
16788
|
+
["openedBy", 7, "{", 14, "["],
|
|
16789
|
+
["closedBy", 8, "}", 15, "]"]
|
|
16783
16790
|
],
|
|
16784
16791
|
propSources: [jsonHighlighting],
|
|
16785
16792
|
skippedNodes: [0],
|
|
16786
16793
|
repeatNodeCount: 2,
|
|
16787
|
-
tokenData: "(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]
|
|
16794
|
+
tokenData: "(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",
|
|
16788
16795
|
tokenizers: [0],
|
|
16789
16796
|
topRules: { "JsonText": [0, 1] },
|
|
16790
16797
|
tokenPrec: 0
|
|
@@ -20173,7 +20180,7 @@ function findMinIndex(value, array) {
|
|
|
20173
20180
|
}
|
|
20174
20181
|
function countColumn(string2, tabSize, to = string2.length) {
|
|
20175
20182
|
let n = 0;
|
|
20176
|
-
for (let i = 0; i < to; ) {
|
|
20183
|
+
for (let i = 0; i < to && i < string2.length; ) {
|
|
20177
20184
|
if (string2.charCodeAt(i) == 9) {
|
|
20178
20185
|
n += tabSize - n % tabSize;
|
|
20179
20186
|
i++;
|
|
@@ -20825,7 +20832,7 @@ class ContentView {
|
|
|
20825
20832
|
child.reuseDOM(next);
|
|
20826
20833
|
}
|
|
20827
20834
|
child.sync(view, track);
|
|
20828
|
-
child.flags &=
|
|
20835
|
+
child.flags &= -8;
|
|
20829
20836
|
}
|
|
20830
20837
|
next = prev ? prev.nextSibling : parent.firstChild;
|
|
20831
20838
|
if (track && !track.written && track.node == parent && next != child.dom)
|
|
@@ -20847,7 +20854,7 @@ class ContentView {
|
|
|
20847
20854
|
for (let child of this.children)
|
|
20848
20855
|
if (child.flags & 7) {
|
|
20849
20856
|
child.sync(view, track);
|
|
20850
|
-
child.flags &=
|
|
20857
|
+
child.flags &= -8;
|
|
20851
20858
|
}
|
|
20852
20859
|
}
|
|
20853
20860
|
}
|
|
@@ -22998,13 +23005,13 @@ class DocView extends ContentView {
|
|
|
22998
23005
|
this.dom.style.flexBasis = this.minWidth ? this.minWidth + "px" : "";
|
|
22999
23006
|
let track = browser.chrome || browser.ios ? { node: observer.selectionRange.focusNode, written: false } : void 0;
|
|
23000
23007
|
this.sync(this.view, track);
|
|
23001
|
-
this.flags &=
|
|
23008
|
+
this.flags &= -8;
|
|
23002
23009
|
if (track && (track.written || observer.selectionRange.focusNode != track.node))
|
|
23003
23010
|
this.forceSelection = true;
|
|
23004
23011
|
this.dom.style.height = "";
|
|
23005
23012
|
});
|
|
23006
23013
|
this.markedForComposition.forEach(
|
|
23007
|
-
(cView) => cView.flags &=
|
|
23014
|
+
(cView) => cView.flags &= -9
|
|
23008
23015
|
/* ViewFlag.Composition */
|
|
23009
23016
|
);
|
|
23010
23017
|
let gaps = [];
|
|
@@ -24021,16 +24028,16 @@ function applyDOMChange(view, domChange) {
|
|
|
24021
24028
|
return false;
|
|
24022
24029
|
if (!change && domChange.typeOver && !sel.empty && newSel && newSel.main.empty) {
|
|
24023
24030
|
change = { from: sel.from, to: sel.to, insert: view.state.doc.slice(sel.from, sel.to) };
|
|
24031
|
+
} else if ((browser.mac || browser.android) && change && change.from == change.to && change.from == sel.head - 1 && /^\. ?$/.test(change.insert.toString()) && view.contentDOM.getAttribute("autocorrect") == "off") {
|
|
24032
|
+
if (newSel && change.insert.length == 2)
|
|
24033
|
+
newSel = EditorSelection.single(newSel.main.anchor - 1, newSel.main.head - 1);
|
|
24034
|
+
change = { from: change.from, to: change.to, insert: Text.of([change.insert.toString().replace(".", " ")]) };
|
|
24024
24035
|
} else if (change && change.from >= sel.from && change.to <= sel.to && (change.from != sel.from || change.to != sel.to) && sel.to - sel.from - (change.to - change.from) <= 4) {
|
|
24025
24036
|
change = {
|
|
24026
24037
|
from: sel.from,
|
|
24027
24038
|
to: sel.to,
|
|
24028
24039
|
insert: view.state.doc.slice(sel.from, change.from).append(change.insert).append(view.state.doc.slice(change.to, sel.to))
|
|
24029
24040
|
};
|
|
24030
|
-
} else if ((browser.mac || browser.android) && change && change.from == change.to && change.from == sel.head - 1 && /^\. ?$/.test(change.insert.toString()) && view.contentDOM.getAttribute("autocorrect") == "off") {
|
|
24031
|
-
if (newSel && change.insert.length == 2)
|
|
24032
|
-
newSel = EditorSelection.single(newSel.main.anchor - 1, newSel.main.head - 1);
|
|
24033
|
-
change = { from: sel.from, to: sel.to, insert: Text.of([" "]) };
|
|
24034
24041
|
} else if (browser.chrome && change && change.from == change.to && change.from == sel.head && change.insert.toString() == "\n " && view.lineWrapping) {
|
|
24035
24042
|
if (newSel)
|
|
24036
24043
|
newSel = EditorSelection.single(newSel.main.anchor - 1, newSel.main.head - 1);
|
|
@@ -25090,7 +25097,7 @@ class HeightMap {
|
|
|
25090
25097
|
return (this.flags & 2) > 0;
|
|
25091
25098
|
}
|
|
25092
25099
|
set outdated(value) {
|
|
25093
|
-
this.flags = (value ? 2 : 0) | this.flags &
|
|
25100
|
+
this.flags = (value ? 2 : 0) | this.flags & -3;
|
|
25094
25101
|
}
|
|
25095
25102
|
setHeight(height) {
|
|
25096
25103
|
if (this.height != height) {
|
|
@@ -25666,6 +25673,10 @@ function visiblePixelRange(dom, paddingTop) {
|
|
|
25666
25673
|
bottom: Math.max(top2, bottom) - (rect.top + paddingTop)
|
|
25667
25674
|
};
|
|
25668
25675
|
}
|
|
25676
|
+
function inWindow(elt) {
|
|
25677
|
+
let rect = elt.getBoundingClientRect(), win = elt.ownerDocument.defaultView || window;
|
|
25678
|
+
return rect.left < win.innerWidth && rect.right > 0 && rect.top < win.innerHeight && rect.bottom > 0;
|
|
25679
|
+
}
|
|
25669
25680
|
function fullPixelRange(dom, paddingTop) {
|
|
25670
25681
|
let rect = dom.getBoundingClientRect();
|
|
25671
25682
|
return {
|
|
@@ -25866,7 +25877,7 @@ class ViewState {
|
|
|
25866
25877
|
if (inView)
|
|
25867
25878
|
measureContent = true;
|
|
25868
25879
|
}
|
|
25869
|
-
if (!this.inView && !this.scrollTarget)
|
|
25880
|
+
if (!this.inView && !this.scrollTarget && !inWindow(view.dom))
|
|
25870
25881
|
return 0;
|
|
25871
25882
|
let contentWidth = domRect.width;
|
|
25872
25883
|
if (this.contentDOMWidth != contentWidth || this.editorHeight != view.scrollDOM.clientHeight) {
|
|
@@ -26983,7 +26994,7 @@ class EditContextManager {
|
|
|
26983
26994
|
selectionEnd: this.toContextPos(view.state.selection.main.head)
|
|
26984
26995
|
});
|
|
26985
26996
|
this.handlers.textupdate = (e) => {
|
|
26986
|
-
let
|
|
26997
|
+
let main = view.state.selection.main, { anchor, head } = main;
|
|
26987
26998
|
let from = this.toEditorPos(e.updateRangeStart), to = this.toEditorPos(e.updateRangeEnd);
|
|
26988
26999
|
if (view.inputState.composing >= 0 && !this.composing)
|
|
26989
27000
|
this.composing = { contextBase: e.updateRangeStart, editorBase: from, drifted: false };
|
|
@@ -26992,8 +27003,14 @@ class EditContextManager {
|
|
|
26992
27003
|
change.from = anchor;
|
|
26993
27004
|
else if (change.to == this.to && anchor > this.to)
|
|
26994
27005
|
change.to = anchor;
|
|
26995
|
-
if (change.from == change.to && !change.insert.length)
|
|
27006
|
+
if (change.from == change.to && !change.insert.length) {
|
|
27007
|
+
let newSel = EditorSelection.single(this.toEditorPos(e.selectionStart), this.toEditorPos(e.selectionEnd));
|
|
27008
|
+
if (!newSel.main.eq(main))
|
|
27009
|
+
view.dispatch({ selection: newSel, userEvent: "select" });
|
|
26996
27010
|
return;
|
|
27011
|
+
}
|
|
27012
|
+
if ((browser.mac || browser.android) && change.from == head - 1 && /^\. ?$/.test(e.text) && view.contentDOM.getAttribute("autocorrect") == "off")
|
|
27013
|
+
change = { from, to, insert: Text.of([e.text.replace(".", " ")]) };
|
|
26997
27014
|
this.pendingContextChange = change;
|
|
26998
27015
|
if (!view.state.readOnly) {
|
|
26999
27016
|
let newLen = this.to - this.from + (change.to - change.from + change.insert.length);
|
|
@@ -42719,7 +42736,7 @@ lodash.exports;
|
|
|
42719
42736
|
return symbolToString ? symbolToString.call(value) : "";
|
|
42720
42737
|
}
|
|
42721
42738
|
var result2 = value + "";
|
|
42722
|
-
return result2 == "0" && 1 / value == -
|
|
42739
|
+
return result2 == "0" && 1 / value == -Infinity ? "-0" : result2;
|
|
42723
42740
|
}
|
|
42724
42741
|
function baseUniq(array, iteratee2, comparator) {
|
|
42725
42742
|
var index2 = -1, includes2 = arrayIncludes, length = array.length, isCommon = true, result2 = [], seen = result2;
|
|
@@ -43271,7 +43288,7 @@ lodash.exports;
|
|
|
43271
43288
|
bitmask |= isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG;
|
|
43272
43289
|
bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
|
|
43273
43290
|
if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
|
|
43274
|
-
bitmask &=
|
|
43291
|
+
bitmask &= -4;
|
|
43275
43292
|
}
|
|
43276
43293
|
var newData = [
|
|
43277
43294
|
func,
|
|
@@ -43327,7 +43344,7 @@ lodash.exports;
|
|
|
43327
43344
|
}
|
|
43328
43345
|
var length = partials ? partials.length : 0;
|
|
43329
43346
|
if (!length) {
|
|
43330
|
-
bitmask &=
|
|
43347
|
+
bitmask &= -97;
|
|
43331
43348
|
partials = holders = undefined$1;
|
|
43332
43349
|
}
|
|
43333
43350
|
ary2 = ary2 === undefined$1 ? ary2 : nativeMax(toInteger(ary2), 0);
|
|
@@ -43360,7 +43377,7 @@ lodash.exports;
|
|
|
43360
43377
|
holders = newData[4];
|
|
43361
43378
|
arity = newData[9] = newData[9] === undefined$1 ? isBindKey ? 0 : func.length : nativeMax(newData[9] - length, 0);
|
|
43362
43379
|
if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
|
|
43363
|
-
bitmask &=
|
|
43380
|
+
bitmask &= -25;
|
|
43364
43381
|
}
|
|
43365
43382
|
if (!bitmask || bitmask == WRAP_BIND_FLAG) {
|
|
43366
43383
|
var result2 = createBind(func, bitmask, thisArg);
|
|
@@ -43926,7 +43943,7 @@ lodash.exports;
|
|
|
43926
43943
|
return value;
|
|
43927
43944
|
}
|
|
43928
43945
|
var result2 = value + "";
|
|
43929
|
-
return result2 == "0" && 1 / value == -
|
|
43946
|
+
return result2 == "0" && 1 / value == -Infinity ? "-0" : result2;
|
|
43930
43947
|
}
|
|
43931
43948
|
function toSource(func) {
|
|
43932
43949
|
if (func != null) {
|
|
@@ -44990,7 +45007,7 @@ lodash.exports;
|
|
|
44990
45007
|
}
|
|
44991
45008
|
var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
|
|
44992
45009
|
function isSafeInteger(value) {
|
|
44993
|
-
return isInteger(value) && value >= -
|
|
45010
|
+
return isInteger(value) && value >= -9007199254740991 && value <= MAX_SAFE_INTEGER;
|
|
44994
45011
|
}
|
|
44995
45012
|
var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
|
|
44996
45013
|
function isString(value) {
|
|
@@ -45031,7 +45048,7 @@ lodash.exports;
|
|
|
45031
45048
|
return value === 0 ? value : 0;
|
|
45032
45049
|
}
|
|
45033
45050
|
value = toNumber(value);
|
|
45034
|
-
if (value === INFINITY || value === -
|
|
45051
|
+
if (value === INFINITY || value === -Infinity) {
|
|
45035
45052
|
var sign = value < 0 ? -1 : 1;
|
|
45036
45053
|
return sign * MAX_INTEGER;
|
|
45037
45054
|
}
|
|
@@ -45066,7 +45083,7 @@ lodash.exports;
|
|
|
45066
45083
|
return copyObject(value, keysIn(value));
|
|
45067
45084
|
}
|
|
45068
45085
|
function toSafeInteger(value) {
|
|
45069
|
-
return value ? baseClamp(toInteger(value), -
|
|
45086
|
+
return value ? baseClamp(toInteger(value), -9007199254740991, MAX_SAFE_INTEGER) : value === 0 ? value : 0;
|
|
45070
45087
|
}
|
|
45071
45088
|
function toString(value) {
|
|
45072
45089
|
return value == null ? "" : baseToString(value);
|
|
@@ -53492,12 +53509,8 @@ const NavigationItemForm = ({
|
|
|
53492
53509
|
);
|
|
53493
53510
|
}
|
|
53494
53511
|
};
|
|
53495
|
-
const renderError = (
|
|
53496
|
-
|
|
53497
|
-
if (errorOccurence) {
|
|
53498
|
-
return formatMessage(getTrad(error));
|
|
53499
|
-
}
|
|
53500
|
-
return void 0;
|
|
53512
|
+
const renderError = (field, messageKey) => {
|
|
53513
|
+
return lodash$1.get(formError, field) ? formatMessage(getTrad(messageKey ?? field)) : void 0;
|
|
53501
53514
|
};
|
|
53502
53515
|
const initialRelatedTypeSelected = current.type === "INTERNAL" ? current.relatedType : void 0;
|
|
53503
53516
|
const {
|
|
@@ -53839,7 +53852,7 @@ const NavigationItemForm = ({
|
|
|
53839
53852
|
label: formatMessage(
|
|
53840
53853
|
getTrad(`popup.item.form.${pathSourceName}.label`, "Path")
|
|
53841
53854
|
),
|
|
53842
|
-
error: renderError(pathSourceName),
|
|
53855
|
+
error: renderError(pathSourceName, `popup.item.form.${pathSourceName}.validation.type`),
|
|
53843
53856
|
hint: [
|
|
53844
53857
|
formatMessage(
|
|
53845
53858
|
getTrad(`popup.item.form.${pathSourceName}.placeholder`, "e.g. Blog")
|
|
@@ -54603,10 +54616,10 @@ const TextArrayInput = ({ onChange, initialValue, ...props }) => {
|
|
|
54603
54616
|
const [value, setValue] = React.useState(
|
|
54604
54617
|
lodash$1.isArray(initialValue) ? initialValue.reduce((acc, cur2) => `${acc}${cur2}; `, "") : ""
|
|
54605
54618
|
);
|
|
54606
|
-
const handleOnChange = (
|
|
54607
|
-
const newValue =
|
|
54608
|
-
const valuesArray = newValue.split(";").map((
|
|
54609
|
-
setValue(
|
|
54619
|
+
const handleOnChange = (event) => {
|
|
54620
|
+
const newValue = event?.target.value ?? "";
|
|
54621
|
+
const valuesArray = newValue.split(";").map((value2) => value2.trim()).filter((value2) => !!value2.length);
|
|
54622
|
+
setValue(newValue ?? "");
|
|
54610
54623
|
onChange(valuesArray);
|
|
54611
54624
|
};
|
|
54612
54625
|
return /* @__PURE__ */ jsxRuntime.jsx(TextInput, { ...props, onChange: handleOnChange, value });
|
package/dist/admin/index.mjs
CHANGED
|
@@ -2499,7 +2499,7 @@ function isTopLayer(element) {
|
|
|
2499
2499
|
function isContainingBlock(elementOrCss) {
|
|
2500
2500
|
const webkit2 = isWebKit();
|
|
2501
2501
|
const css2 = isElement(elementOrCss) ? getComputedStyle$1(elementOrCss) : elementOrCss;
|
|
2502
|
-
return
|
|
2502
|
+
return ["transform", "translate", "scale", "rotate", "perspective"].some((value) => css2[value] ? css2[value] !== "none" : false) || (css2.containerType ? css2.containerType !== "normal" : false) || !webkit2 && (css2.backdropFilter ? css2.backdropFilter !== "none" : false) || !webkit2 && (css2.filter ? css2.filter !== "none" : false) || ["transform", "translate", "scale", "rotate", "perspective", "filter"].some((value) => (css2.willChange || "").includes(value)) || ["paint", "layout", "strict", "content"].some((value) => (css2.contain || "").includes(value));
|
|
2503
2503
|
}
|
|
2504
2504
|
function getContainingBlock(element) {
|
|
2505
2505
|
let currentNode = getParentNode(element);
|
|
@@ -3005,6 +3005,9 @@ const platform = {
|
|
|
3005
3005
|
isElement,
|
|
3006
3006
|
isRTL
|
|
3007
3007
|
};
|
|
3008
|
+
function rectsAreEqual(a, b) {
|
|
3009
|
+
return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
|
|
3010
|
+
}
|
|
3008
3011
|
function observeMove(element, onMove) {
|
|
3009
3012
|
let io = null;
|
|
3010
3013
|
let timeoutId;
|
|
@@ -3023,12 +3026,13 @@ function observeMove(element, onMove) {
|
|
|
3023
3026
|
threshold = 1;
|
|
3024
3027
|
}
|
|
3025
3028
|
cleanup();
|
|
3029
|
+
const elementRectForRootMargin = element.getBoundingClientRect();
|
|
3026
3030
|
const {
|
|
3027
3031
|
left,
|
|
3028
3032
|
top: top2,
|
|
3029
3033
|
width,
|
|
3030
3034
|
height
|
|
3031
|
-
} =
|
|
3035
|
+
} = elementRectForRootMargin;
|
|
3032
3036
|
if (!skip) {
|
|
3033
3037
|
onMove();
|
|
3034
3038
|
}
|
|
@@ -3059,6 +3063,9 @@ function observeMove(element, onMove) {
|
|
|
3059
3063
|
refresh(false, ratio);
|
|
3060
3064
|
}
|
|
3061
3065
|
}
|
|
3066
|
+
if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
|
|
3067
|
+
refresh();
|
|
3068
|
+
}
|
|
3062
3069
|
isFirstUpdate = false;
|
|
3063
3070
|
}
|
|
3064
3071
|
try {
|
|
@@ -3122,7 +3129,7 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
3122
3129
|
}
|
|
3123
3130
|
function frameLoop() {
|
|
3124
3131
|
const nextRefRect = getBoundingClientRect(reference);
|
|
3125
|
-
if (prevRefRect && (
|
|
3132
|
+
if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
|
|
3126
3133
|
update();
|
|
3127
3134
|
}
|
|
3128
3135
|
prevRefRect = nextRefRect;
|
|
@@ -5275,9 +5282,9 @@ var handleScroll$2 = function(axis, endTarget, event, sourceDelta, noOverscroll)
|
|
|
5275
5282
|
!targetInLock && target !== document.body || // self content
|
|
5276
5283
|
targetInLock && (endTarget.contains(target) || endTarget === target)
|
|
5277
5284
|
);
|
|
5278
|
-
if (isDeltaPositive && (Math.abs(availableScroll) < 1 ||
|
|
5285
|
+
if (isDeltaPositive && (Math.abs(availableScroll) < 1 || false)) {
|
|
5279
5286
|
shouldCancelScroll = true;
|
|
5280
|
-
} else if (!isDeltaPositive && (Math.abs(availableScrollTop) < 1 ||
|
|
5287
|
+
} else if (!isDeltaPositive && (Math.abs(availableScrollTop) < 1 || false)) {
|
|
5281
5288
|
shouldCancelScroll = true;
|
|
5282
5289
|
}
|
|
5283
5290
|
return shouldCancelScroll;
|
|
@@ -5359,7 +5366,7 @@ function RemoveScrollSideCar$2(props) {
|
|
|
5359
5366
|
return true;
|
|
5360
5367
|
}
|
|
5361
5368
|
var cancelingAxis = activeAxis.current || currentAxis;
|
|
5362
|
-
return handleScroll$2(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY
|
|
5369
|
+
return handleScroll$2(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY);
|
|
5363
5370
|
}, []);
|
|
5364
5371
|
var shouldPrevent = React.useCallback(function(_event) {
|
|
5365
5372
|
var event = _event;
|
|
@@ -10742,9 +10749,9 @@ var handleScroll$1 = function(axis, endTarget, event, sourceDelta, noOverscroll)
|
|
|
10742
10749
|
!targetInLock && target !== document.body || // self content
|
|
10743
10750
|
targetInLock && (endTarget.contains(target) || endTarget === target)
|
|
10744
10751
|
);
|
|
10745
|
-
if (isDeltaPositive && (availableScroll === 0 ||
|
|
10752
|
+
if (isDeltaPositive && (availableScroll === 0 || false)) {
|
|
10746
10753
|
shouldCancelScroll = true;
|
|
10747
|
-
} else if (!isDeltaPositive && (availableScrollTop === 0 ||
|
|
10754
|
+
} else if (!isDeltaPositive && (availableScrollTop === 0 || false)) {
|
|
10748
10755
|
shouldCancelScroll = true;
|
|
10749
10756
|
}
|
|
10750
10757
|
return shouldCancelScroll;
|
|
@@ -10828,7 +10835,7 @@ function RemoveScrollSideCar$1(props) {
|
|
|
10828
10835
|
return true;
|
|
10829
10836
|
}
|
|
10830
10837
|
var cancelingAxis = activeAxis.current || currentAxis;
|
|
10831
|
-
return handleScroll$1(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY
|
|
10838
|
+
return handleScroll$1(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY);
|
|
10832
10839
|
}, []);
|
|
10833
10840
|
var shouldPrevent = React.useCallback(function(_event) {
|
|
10834
10841
|
var event = _event;
|
|
@@ -12567,9 +12574,9 @@ var handleScroll = function(axis, endTarget, event, sourceDelta, noOverscroll) {
|
|
|
12567
12574
|
!targetInLock && target !== document.body || // self content
|
|
12568
12575
|
targetInLock && (endTarget.contains(target) || endTarget === target)
|
|
12569
12576
|
);
|
|
12570
|
-
if (isDeltaPositive && (Math.abs(availableScroll) < 1 ||
|
|
12577
|
+
if (isDeltaPositive && (Math.abs(availableScroll) < 1 || false)) {
|
|
12571
12578
|
shouldCancelScroll = true;
|
|
12572
|
-
} else if (!isDeltaPositive && (Math.abs(availableScrollTop) < 1 ||
|
|
12579
|
+
} else if (!isDeltaPositive && (Math.abs(availableScrollTop) < 1 || false)) {
|
|
12573
12580
|
shouldCancelScroll = true;
|
|
12574
12581
|
}
|
|
12575
12582
|
return shouldCancelScroll;
|
|
@@ -12651,7 +12658,7 @@ function RemoveScrollSideCar(props) {
|
|
|
12651
12658
|
return true;
|
|
12652
12659
|
}
|
|
12653
12660
|
var cancelingAxis = activeAxis.current || currentAxis;
|
|
12654
|
-
return handleScroll(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY
|
|
12661
|
+
return handleScroll(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY);
|
|
12655
12662
|
}, []);
|
|
12656
12663
|
var shouldPrevent = React.useCallback(function(_event) {
|
|
12657
12664
|
var event = _event;
|
|
@@ -16745,26 +16752,26 @@ const jsonHighlighting = styleTags({
|
|
|
16745
16752
|
"True False": tags.bool,
|
|
16746
16753
|
PropertyName: tags.propertyName,
|
|
16747
16754
|
Null: tags.null,
|
|
16748
|
-
",": tags.separator,
|
|
16755
|
+
", :": tags.separator,
|
|
16749
16756
|
"[ ]": tags.squareBracket,
|
|
16750
16757
|
"{ }": tags.brace
|
|
16751
16758
|
});
|
|
16752
16759
|
const parser = LRParser.deserialize({
|
|
16753
16760
|
version: 14,
|
|
16754
|
-
states: "$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#
|
|
16755
|
-
stateData: "#O~
|
|
16756
|
-
goto: "!
|
|
16757
|
-
nodeNames: "⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array",
|
|
16761
|
+
states: "$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",
|
|
16762
|
+
stateData: "#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",
|
|
16763
|
+
goto: "!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",
|
|
16764
|
+
nodeNames: "⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",
|
|
16758
16765
|
maxTerm: 25,
|
|
16759
16766
|
nodeProps: [
|
|
16760
16767
|
["isolate", -2, 6, 11, ""],
|
|
16761
|
-
["openedBy", 7, "{",
|
|
16762
|
-
["closedBy", 8, "}",
|
|
16768
|
+
["openedBy", 7, "{", 14, "["],
|
|
16769
|
+
["closedBy", 8, "}", 15, "]"]
|
|
16763
16770
|
],
|
|
16764
16771
|
propSources: [jsonHighlighting],
|
|
16765
16772
|
skippedNodes: [0],
|
|
16766
16773
|
repeatNodeCount: 2,
|
|
16767
|
-
tokenData: "(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]
|
|
16774
|
+
tokenData: "(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",
|
|
16768
16775
|
tokenizers: [0],
|
|
16769
16776
|
topRules: { "JsonText": [0, 1] },
|
|
16770
16777
|
tokenPrec: 0
|
|
@@ -20153,7 +20160,7 @@ function findMinIndex(value, array) {
|
|
|
20153
20160
|
}
|
|
20154
20161
|
function countColumn(string2, tabSize, to = string2.length) {
|
|
20155
20162
|
let n = 0;
|
|
20156
|
-
for (let i = 0; i < to; ) {
|
|
20163
|
+
for (let i = 0; i < to && i < string2.length; ) {
|
|
20157
20164
|
if (string2.charCodeAt(i) == 9) {
|
|
20158
20165
|
n += tabSize - n % tabSize;
|
|
20159
20166
|
i++;
|
|
@@ -20805,7 +20812,7 @@ class ContentView {
|
|
|
20805
20812
|
child.reuseDOM(next);
|
|
20806
20813
|
}
|
|
20807
20814
|
child.sync(view, track);
|
|
20808
|
-
child.flags &=
|
|
20815
|
+
child.flags &= -8;
|
|
20809
20816
|
}
|
|
20810
20817
|
next = prev ? prev.nextSibling : parent.firstChild;
|
|
20811
20818
|
if (track && !track.written && track.node == parent && next != child.dom)
|
|
@@ -20827,7 +20834,7 @@ class ContentView {
|
|
|
20827
20834
|
for (let child of this.children)
|
|
20828
20835
|
if (child.flags & 7) {
|
|
20829
20836
|
child.sync(view, track);
|
|
20830
|
-
child.flags &=
|
|
20837
|
+
child.flags &= -8;
|
|
20831
20838
|
}
|
|
20832
20839
|
}
|
|
20833
20840
|
}
|
|
@@ -22978,13 +22985,13 @@ class DocView extends ContentView {
|
|
|
22978
22985
|
this.dom.style.flexBasis = this.minWidth ? this.minWidth + "px" : "";
|
|
22979
22986
|
let track = browser.chrome || browser.ios ? { node: observer.selectionRange.focusNode, written: false } : void 0;
|
|
22980
22987
|
this.sync(this.view, track);
|
|
22981
|
-
this.flags &=
|
|
22988
|
+
this.flags &= -8;
|
|
22982
22989
|
if (track && (track.written || observer.selectionRange.focusNode != track.node))
|
|
22983
22990
|
this.forceSelection = true;
|
|
22984
22991
|
this.dom.style.height = "";
|
|
22985
22992
|
});
|
|
22986
22993
|
this.markedForComposition.forEach(
|
|
22987
|
-
(cView) => cView.flags &=
|
|
22994
|
+
(cView) => cView.flags &= -9
|
|
22988
22995
|
/* ViewFlag.Composition */
|
|
22989
22996
|
);
|
|
22990
22997
|
let gaps = [];
|
|
@@ -24001,16 +24008,16 @@ function applyDOMChange(view, domChange) {
|
|
|
24001
24008
|
return false;
|
|
24002
24009
|
if (!change && domChange.typeOver && !sel.empty && newSel && newSel.main.empty) {
|
|
24003
24010
|
change = { from: sel.from, to: sel.to, insert: view.state.doc.slice(sel.from, sel.to) };
|
|
24011
|
+
} else if ((browser.mac || browser.android) && change && change.from == change.to && change.from == sel.head - 1 && /^\. ?$/.test(change.insert.toString()) && view.contentDOM.getAttribute("autocorrect") == "off") {
|
|
24012
|
+
if (newSel && change.insert.length == 2)
|
|
24013
|
+
newSel = EditorSelection.single(newSel.main.anchor - 1, newSel.main.head - 1);
|
|
24014
|
+
change = { from: change.from, to: change.to, insert: Text.of([change.insert.toString().replace(".", " ")]) };
|
|
24004
24015
|
} else if (change && change.from >= sel.from && change.to <= sel.to && (change.from != sel.from || change.to != sel.to) && sel.to - sel.from - (change.to - change.from) <= 4) {
|
|
24005
24016
|
change = {
|
|
24006
24017
|
from: sel.from,
|
|
24007
24018
|
to: sel.to,
|
|
24008
24019
|
insert: view.state.doc.slice(sel.from, change.from).append(change.insert).append(view.state.doc.slice(change.to, sel.to))
|
|
24009
24020
|
};
|
|
24010
|
-
} else if ((browser.mac || browser.android) && change && change.from == change.to && change.from == sel.head - 1 && /^\. ?$/.test(change.insert.toString()) && view.contentDOM.getAttribute("autocorrect") == "off") {
|
|
24011
|
-
if (newSel && change.insert.length == 2)
|
|
24012
|
-
newSel = EditorSelection.single(newSel.main.anchor - 1, newSel.main.head - 1);
|
|
24013
|
-
change = { from: sel.from, to: sel.to, insert: Text.of([" "]) };
|
|
24014
24021
|
} else if (browser.chrome && change && change.from == change.to && change.from == sel.head && change.insert.toString() == "\n " && view.lineWrapping) {
|
|
24015
24022
|
if (newSel)
|
|
24016
24023
|
newSel = EditorSelection.single(newSel.main.anchor - 1, newSel.main.head - 1);
|
|
@@ -25070,7 +25077,7 @@ class HeightMap {
|
|
|
25070
25077
|
return (this.flags & 2) > 0;
|
|
25071
25078
|
}
|
|
25072
25079
|
set outdated(value) {
|
|
25073
|
-
this.flags = (value ? 2 : 0) | this.flags &
|
|
25080
|
+
this.flags = (value ? 2 : 0) | this.flags & -3;
|
|
25074
25081
|
}
|
|
25075
25082
|
setHeight(height) {
|
|
25076
25083
|
if (this.height != height) {
|
|
@@ -25646,6 +25653,10 @@ function visiblePixelRange(dom, paddingTop) {
|
|
|
25646
25653
|
bottom: Math.max(top2, bottom) - (rect.top + paddingTop)
|
|
25647
25654
|
};
|
|
25648
25655
|
}
|
|
25656
|
+
function inWindow(elt) {
|
|
25657
|
+
let rect = elt.getBoundingClientRect(), win = elt.ownerDocument.defaultView || window;
|
|
25658
|
+
return rect.left < win.innerWidth && rect.right > 0 && rect.top < win.innerHeight && rect.bottom > 0;
|
|
25659
|
+
}
|
|
25649
25660
|
function fullPixelRange(dom, paddingTop) {
|
|
25650
25661
|
let rect = dom.getBoundingClientRect();
|
|
25651
25662
|
return {
|
|
@@ -25846,7 +25857,7 @@ class ViewState {
|
|
|
25846
25857
|
if (inView)
|
|
25847
25858
|
measureContent = true;
|
|
25848
25859
|
}
|
|
25849
|
-
if (!this.inView && !this.scrollTarget)
|
|
25860
|
+
if (!this.inView && !this.scrollTarget && !inWindow(view.dom))
|
|
25850
25861
|
return 0;
|
|
25851
25862
|
let contentWidth = domRect.width;
|
|
25852
25863
|
if (this.contentDOMWidth != contentWidth || this.editorHeight != view.scrollDOM.clientHeight) {
|
|
@@ -26963,7 +26974,7 @@ class EditContextManager {
|
|
|
26963
26974
|
selectionEnd: this.toContextPos(view.state.selection.main.head)
|
|
26964
26975
|
});
|
|
26965
26976
|
this.handlers.textupdate = (e) => {
|
|
26966
|
-
let
|
|
26977
|
+
let main = view.state.selection.main, { anchor, head } = main;
|
|
26967
26978
|
let from = this.toEditorPos(e.updateRangeStart), to = this.toEditorPos(e.updateRangeEnd);
|
|
26968
26979
|
if (view.inputState.composing >= 0 && !this.composing)
|
|
26969
26980
|
this.composing = { contextBase: e.updateRangeStart, editorBase: from, drifted: false };
|
|
@@ -26972,8 +26983,14 @@ class EditContextManager {
|
|
|
26972
26983
|
change.from = anchor;
|
|
26973
26984
|
else if (change.to == this.to && anchor > this.to)
|
|
26974
26985
|
change.to = anchor;
|
|
26975
|
-
if (change.from == change.to && !change.insert.length)
|
|
26986
|
+
if (change.from == change.to && !change.insert.length) {
|
|
26987
|
+
let newSel = EditorSelection.single(this.toEditorPos(e.selectionStart), this.toEditorPos(e.selectionEnd));
|
|
26988
|
+
if (!newSel.main.eq(main))
|
|
26989
|
+
view.dispatch({ selection: newSel, userEvent: "select" });
|
|
26976
26990
|
return;
|
|
26991
|
+
}
|
|
26992
|
+
if ((browser.mac || browser.android) && change.from == head - 1 && /^\. ?$/.test(e.text) && view.contentDOM.getAttribute("autocorrect") == "off")
|
|
26993
|
+
change = { from, to, insert: Text.of([e.text.replace(".", " ")]) };
|
|
26977
26994
|
this.pendingContextChange = change;
|
|
26978
26995
|
if (!view.state.readOnly) {
|
|
26979
26996
|
let newLen = this.to - this.from + (change.to - change.from + change.insert.length);
|
|
@@ -42699,7 +42716,7 @@ lodash.exports;
|
|
|
42699
42716
|
return symbolToString ? symbolToString.call(value) : "";
|
|
42700
42717
|
}
|
|
42701
42718
|
var result2 = value + "";
|
|
42702
|
-
return result2 == "0" && 1 / value == -
|
|
42719
|
+
return result2 == "0" && 1 / value == -Infinity ? "-0" : result2;
|
|
42703
42720
|
}
|
|
42704
42721
|
function baseUniq(array, iteratee2, comparator) {
|
|
42705
42722
|
var index2 = -1, includes2 = arrayIncludes, length = array.length, isCommon = true, result2 = [], seen = result2;
|
|
@@ -43251,7 +43268,7 @@ lodash.exports;
|
|
|
43251
43268
|
bitmask |= isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG;
|
|
43252
43269
|
bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
|
|
43253
43270
|
if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
|
|
43254
|
-
bitmask &=
|
|
43271
|
+
bitmask &= -4;
|
|
43255
43272
|
}
|
|
43256
43273
|
var newData = [
|
|
43257
43274
|
func,
|
|
@@ -43307,7 +43324,7 @@ lodash.exports;
|
|
|
43307
43324
|
}
|
|
43308
43325
|
var length = partials ? partials.length : 0;
|
|
43309
43326
|
if (!length) {
|
|
43310
|
-
bitmask &=
|
|
43327
|
+
bitmask &= -97;
|
|
43311
43328
|
partials = holders = undefined$1;
|
|
43312
43329
|
}
|
|
43313
43330
|
ary2 = ary2 === undefined$1 ? ary2 : nativeMax(toInteger(ary2), 0);
|
|
@@ -43340,7 +43357,7 @@ lodash.exports;
|
|
|
43340
43357
|
holders = newData[4];
|
|
43341
43358
|
arity = newData[9] = newData[9] === undefined$1 ? isBindKey ? 0 : func.length : nativeMax(newData[9] - length, 0);
|
|
43342
43359
|
if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
|
|
43343
|
-
bitmask &=
|
|
43360
|
+
bitmask &= -25;
|
|
43344
43361
|
}
|
|
43345
43362
|
if (!bitmask || bitmask == WRAP_BIND_FLAG) {
|
|
43346
43363
|
var result2 = createBind(func, bitmask, thisArg);
|
|
@@ -43906,7 +43923,7 @@ lodash.exports;
|
|
|
43906
43923
|
return value;
|
|
43907
43924
|
}
|
|
43908
43925
|
var result2 = value + "";
|
|
43909
|
-
return result2 == "0" && 1 / value == -
|
|
43926
|
+
return result2 == "0" && 1 / value == -Infinity ? "-0" : result2;
|
|
43910
43927
|
}
|
|
43911
43928
|
function toSource(func) {
|
|
43912
43929
|
if (func != null) {
|
|
@@ -44970,7 +44987,7 @@ lodash.exports;
|
|
|
44970
44987
|
}
|
|
44971
44988
|
var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
|
|
44972
44989
|
function isSafeInteger(value) {
|
|
44973
|
-
return isInteger(value) && value >= -
|
|
44990
|
+
return isInteger(value) && value >= -9007199254740991 && value <= MAX_SAFE_INTEGER;
|
|
44974
44991
|
}
|
|
44975
44992
|
var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
|
|
44976
44993
|
function isString2(value) {
|
|
@@ -45011,7 +45028,7 @@ lodash.exports;
|
|
|
45011
45028
|
return value === 0 ? value : 0;
|
|
45012
45029
|
}
|
|
45013
45030
|
value = toNumber(value);
|
|
45014
|
-
if (value === INFINITY || value === -
|
|
45031
|
+
if (value === INFINITY || value === -Infinity) {
|
|
45015
45032
|
var sign = value < 0 ? -1 : 1;
|
|
45016
45033
|
return sign * MAX_INTEGER;
|
|
45017
45034
|
}
|
|
@@ -45046,7 +45063,7 @@ lodash.exports;
|
|
|
45046
45063
|
return copyObject(value, keysIn(value));
|
|
45047
45064
|
}
|
|
45048
45065
|
function toSafeInteger(value) {
|
|
45049
|
-
return value ? baseClamp(toInteger(value), -
|
|
45066
|
+
return value ? baseClamp(toInteger(value), -9007199254740991, MAX_SAFE_INTEGER) : value === 0 ? value : 0;
|
|
45050
45067
|
}
|
|
45051
45068
|
function toString(value) {
|
|
45052
45069
|
return value == null ? "" : baseToString(value);
|
|
@@ -53472,12 +53489,8 @@ const NavigationItemForm = ({
|
|
|
53472
53489
|
);
|
|
53473
53490
|
}
|
|
53474
53491
|
};
|
|
53475
|
-
const renderError = (
|
|
53476
|
-
|
|
53477
|
-
if (errorOccurence) {
|
|
53478
|
-
return formatMessage(getTrad(error));
|
|
53479
|
-
}
|
|
53480
|
-
return void 0;
|
|
53492
|
+
const renderError = (field, messageKey) => {
|
|
53493
|
+
return get(formError, field) ? formatMessage(getTrad(messageKey ?? field)) : void 0;
|
|
53481
53494
|
};
|
|
53482
53495
|
const initialRelatedTypeSelected = current.type === "INTERNAL" ? current.relatedType : void 0;
|
|
53483
53496
|
const {
|
|
@@ -53819,7 +53832,7 @@ const NavigationItemForm = ({
|
|
|
53819
53832
|
label: formatMessage(
|
|
53820
53833
|
getTrad(`popup.item.form.${pathSourceName}.label`, "Path")
|
|
53821
53834
|
),
|
|
53822
|
-
error: renderError(pathSourceName),
|
|
53835
|
+
error: renderError(pathSourceName, `popup.item.form.${pathSourceName}.validation.type`),
|
|
53823
53836
|
hint: [
|
|
53824
53837
|
formatMessage(
|
|
53825
53838
|
getTrad(`popup.item.form.${pathSourceName}.placeholder`, "e.g. Blog")
|
|
@@ -54583,10 +54596,10 @@ const TextArrayInput = ({ onChange, initialValue, ...props }) => {
|
|
|
54583
54596
|
const [value, setValue] = useState(
|
|
54584
54597
|
isArray(initialValue) ? initialValue.reduce((acc, cur2) => `${acc}${cur2}; `, "") : ""
|
|
54585
54598
|
);
|
|
54586
|
-
const handleOnChange = (
|
|
54587
|
-
const newValue =
|
|
54588
|
-
const valuesArray = newValue.split(";").map((
|
|
54589
|
-
setValue(
|
|
54599
|
+
const handleOnChange = (event) => {
|
|
54600
|
+
const newValue = event?.target.value ?? "";
|
|
54601
|
+
const valuesArray = newValue.split(";").map((value2) => value2.trim()).filter((value2) => !!value2.length);
|
|
54602
|
+
setValue(newValue ?? "");
|
|
54590
54603
|
onChange(valuesArray);
|
|
54591
54604
|
};
|
|
54592
54605
|
return /* @__PURE__ */ jsx(TextInput, { ...props, onChange: handleOnChange, value });
|
package/dist/server/index.js
CHANGED
|
@@ -574,7 +574,7 @@ const getNavigationItemRepository = ___default.once((context) => ({
|
|
|
574
574
|
const { itemModel } = getPluginModels(context);
|
|
575
575
|
return context.strapi.query(itemModel.uid).findMany({
|
|
576
576
|
where: {
|
|
577
|
-
$or: ids.map((
|
|
577
|
+
$or: ids.map((id) => ({ master: id }))
|
|
578
578
|
},
|
|
579
579
|
limit: Number.MAX_SAFE_INTEGER
|
|
580
580
|
}).then(navigationItemsDBSchema.parse);
|
|
@@ -15264,7 +15264,7 @@ const adminService = (context) => ({
|
|
|
15264
15264
|
populate: "*"
|
|
15265
15265
|
});
|
|
15266
15266
|
await cleanNavigationItems(
|
|
15267
|
-
allNavigations.map(({
|
|
15267
|
+
allNavigations.map(({ id }) => id)
|
|
15268
15268
|
);
|
|
15269
15269
|
await navigationRepository.remove({ documentId: navigation2.documentId });
|
|
15270
15270
|
sendAuditLog(auditLog, "onNavigationDeletion", {
|
|
@@ -15521,11 +15521,12 @@ const clientService = (context) => ({
|
|
|
15521
15521
|
return navigations;
|
|
15522
15522
|
},
|
|
15523
15523
|
renderRFRNavigationItem({ item }) {
|
|
15524
|
-
const { uiRouterKey, title, path: path2, type: type2, audience: audience2 } = item;
|
|
15524
|
+
const { uiRouterKey, title, path: path2, type: type2, audience: audience2, additionalFields } = item;
|
|
15525
15525
|
const itemCommon = {
|
|
15526
15526
|
label: title,
|
|
15527
15527
|
type: type2,
|
|
15528
|
-
audience: audience2?.map(({ key }) => key)
|
|
15528
|
+
audience: audience2?.map(({ key }) => key),
|
|
15529
|
+
additionalFields
|
|
15529
15530
|
};
|
|
15530
15531
|
if (type2 === "WRAPPER") {
|
|
15531
15532
|
return { ...itemCommon };
|
|
@@ -15554,7 +15555,11 @@ const clientService = (context) => ({
|
|
|
15554
15555
|
throw new NavigationError("Unknown item type", item);
|
|
15555
15556
|
},
|
|
15556
15557
|
renderRFRPage({ item, parent, enabledCustomFieldsNames }) {
|
|
15557
|
-
const { documentId, uiRouterKey, title, path: path2, related, type: type2, audience: audience2, menuAttached } = item;
|
|
15558
|
+
const { documentId, uiRouterKey, title, path: path2, related, type: type2, audience: audience2, menuAttached, additionalFields } = item;
|
|
15559
|
+
const additionalFieldsRendered = enabledCustomFieldsNames.reduce(
|
|
15560
|
+
(acc, field) => ({ ...acc, [field]: additionalFields?.[field] }),
|
|
15561
|
+
{}
|
|
15562
|
+
);
|
|
15558
15563
|
return {
|
|
15559
15564
|
id: uiRouterKey,
|
|
15560
15565
|
documentId,
|
|
@@ -15567,10 +15572,7 @@ const clientService = (context) => ({
|
|
|
15567
15572
|
parent,
|
|
15568
15573
|
audience: audience2,
|
|
15569
15574
|
menuAttached,
|
|
15570
|
-
|
|
15571
|
-
(acc, field) => ({ ...acc, [field]: ___default.get(item, field) }),
|
|
15572
|
-
{}
|
|
15573
|
-
)
|
|
15575
|
+
additionalFields: additionalFieldsRendered
|
|
15574
15576
|
};
|
|
15575
15577
|
},
|
|
15576
15578
|
renderRFR({
|
|
@@ -15746,7 +15748,7 @@ const clientService = (context) => ({
|
|
|
15746
15748
|
);
|
|
15747
15749
|
const additionalFieldsMapper = (item) => (acc, field) => {
|
|
15748
15750
|
const fieldDefinition = customFieldsDefinitions.find(({ name }) => name === field);
|
|
15749
|
-
let content =
|
|
15751
|
+
let content = item.additionalFields?.[field];
|
|
15750
15752
|
if (content) {
|
|
15751
15753
|
switch (fieldDefinition?.type) {
|
|
15752
15754
|
case "media":
|
|
@@ -15827,22 +15829,18 @@ const clientService = (context) => ({
|
|
|
15827
15829
|
cache.set(documentId, nestedOrders);
|
|
15828
15830
|
return nestedOrders;
|
|
15829
15831
|
};
|
|
15830
|
-
return result.map((
|
|
15831
|
-
const
|
|
15832
|
+
return result.map((item) => {
|
|
15833
|
+
const additionalFieldsMapped = enabledCustomFieldsNames.reduce(
|
|
15832
15834
|
additionalFieldsMapper(item),
|
|
15833
15835
|
{}
|
|
15834
15836
|
);
|
|
15835
15837
|
return {
|
|
15836
15838
|
...item,
|
|
15837
15839
|
audience: item.audience?.map((_) => _.key),
|
|
15838
|
-
title: composeItemTitle(
|
|
15839
|
-
{ ...item, additionalFields: additionalFields2 },
|
|
15840
|
-
contentTypesNameFields2,
|
|
15841
|
-
contentTypes2
|
|
15842
|
-
) || "",
|
|
15840
|
+
title: composeItemTitle(item, contentTypesNameFields2, contentTypes2) || "",
|
|
15843
15841
|
related: wrapContentType(item.related),
|
|
15844
15842
|
items: null,
|
|
15845
|
-
|
|
15843
|
+
additionalFields: additionalFieldsMapped
|
|
15846
15844
|
};
|
|
15847
15845
|
}).sort(
|
|
15848
15846
|
(a, b) => compareArraysOfNumbers(getNestedOrders(a.documentId), getNestedOrders(b.documentId))
|
package/dist/server/index.mjs
CHANGED
|
@@ -536,7 +536,7 @@ const getNavigationItemRepository = once$1((context) => ({
|
|
|
536
536
|
const { itemModel } = getPluginModels(context);
|
|
537
537
|
return context.strapi.query(itemModel.uid).findMany({
|
|
538
538
|
where: {
|
|
539
|
-
$or: ids.map((
|
|
539
|
+
$or: ids.map((id) => ({ master: id }))
|
|
540
540
|
},
|
|
541
541
|
limit: Number.MAX_SAFE_INTEGER
|
|
542
542
|
}).then(navigationItemsDBSchema.parse);
|
|
@@ -15226,7 +15226,7 @@ const adminService = (context) => ({
|
|
|
15226
15226
|
populate: "*"
|
|
15227
15227
|
});
|
|
15228
15228
|
await cleanNavigationItems(
|
|
15229
|
-
allNavigations.map(({
|
|
15229
|
+
allNavigations.map(({ id }) => id)
|
|
15230
15230
|
);
|
|
15231
15231
|
await navigationRepository.remove({ documentId: navigation2.documentId });
|
|
15232
15232
|
sendAuditLog(auditLog, "onNavigationDeletion", {
|
|
@@ -15483,11 +15483,12 @@ const clientService = (context) => ({
|
|
|
15483
15483
|
return navigations;
|
|
15484
15484
|
},
|
|
15485
15485
|
renderRFRNavigationItem({ item }) {
|
|
15486
|
-
const { uiRouterKey, title, path: path2, type: type2, audience: audience2 } = item;
|
|
15486
|
+
const { uiRouterKey, title, path: path2, type: type2, audience: audience2, additionalFields } = item;
|
|
15487
15487
|
const itemCommon = {
|
|
15488
15488
|
label: title,
|
|
15489
15489
|
type: type2,
|
|
15490
|
-
audience: audience2?.map(({ key }) => key)
|
|
15490
|
+
audience: audience2?.map(({ key }) => key),
|
|
15491
|
+
additionalFields
|
|
15491
15492
|
};
|
|
15492
15493
|
if (type2 === "WRAPPER") {
|
|
15493
15494
|
return { ...itemCommon };
|
|
@@ -15516,7 +15517,11 @@ const clientService = (context) => ({
|
|
|
15516
15517
|
throw new NavigationError("Unknown item type", item);
|
|
15517
15518
|
},
|
|
15518
15519
|
renderRFRPage({ item, parent, enabledCustomFieldsNames }) {
|
|
15519
|
-
const { documentId, uiRouterKey, title, path: path2, related, type: type2, audience: audience2, menuAttached } = item;
|
|
15520
|
+
const { documentId, uiRouterKey, title, path: path2, related, type: type2, audience: audience2, menuAttached, additionalFields } = item;
|
|
15521
|
+
const additionalFieldsRendered = enabledCustomFieldsNames.reduce(
|
|
15522
|
+
(acc, field) => ({ ...acc, [field]: additionalFields?.[field] }),
|
|
15523
|
+
{}
|
|
15524
|
+
);
|
|
15520
15525
|
return {
|
|
15521
15526
|
id: uiRouterKey,
|
|
15522
15527
|
documentId,
|
|
@@ -15529,10 +15534,7 @@ const clientService = (context) => ({
|
|
|
15529
15534
|
parent,
|
|
15530
15535
|
audience: audience2,
|
|
15531
15536
|
menuAttached,
|
|
15532
|
-
|
|
15533
|
-
(acc, field) => ({ ...acc, [field]: get$1(item, field) }),
|
|
15534
|
-
{}
|
|
15535
|
-
)
|
|
15537
|
+
additionalFields: additionalFieldsRendered
|
|
15536
15538
|
};
|
|
15537
15539
|
},
|
|
15538
15540
|
renderRFR({
|
|
@@ -15708,7 +15710,7 @@ const clientService = (context) => ({
|
|
|
15708
15710
|
);
|
|
15709
15711
|
const additionalFieldsMapper = (item) => (acc, field) => {
|
|
15710
15712
|
const fieldDefinition = customFieldsDefinitions.find(({ name }) => name === field);
|
|
15711
|
-
let content =
|
|
15713
|
+
let content = item.additionalFields?.[field];
|
|
15712
15714
|
if (content) {
|
|
15713
15715
|
switch (fieldDefinition?.type) {
|
|
15714
15716
|
case "media":
|
|
@@ -15789,22 +15791,18 @@ const clientService = (context) => ({
|
|
|
15789
15791
|
cache.set(documentId, nestedOrders);
|
|
15790
15792
|
return nestedOrders;
|
|
15791
15793
|
};
|
|
15792
|
-
return result.map((
|
|
15793
|
-
const
|
|
15794
|
+
return result.map((item) => {
|
|
15795
|
+
const additionalFieldsMapped = enabledCustomFieldsNames.reduce(
|
|
15794
15796
|
additionalFieldsMapper(item),
|
|
15795
15797
|
{}
|
|
15796
15798
|
);
|
|
15797
15799
|
return {
|
|
15798
15800
|
...item,
|
|
15799
15801
|
audience: item.audience?.map((_) => _.key),
|
|
15800
|
-
title: composeItemTitle(
|
|
15801
|
-
{ ...item, additionalFields: additionalFields2 },
|
|
15802
|
-
contentTypesNameFields2,
|
|
15803
|
-
contentTypes2
|
|
15804
|
-
) || "",
|
|
15802
|
+
title: composeItemTitle(item, contentTypesNameFields2, contentTypes2) || "",
|
|
15805
15803
|
related: wrapContentType(item.related),
|
|
15806
15804
|
items: null,
|
|
15807
|
-
|
|
15805
|
+
additionalFields: additionalFieldsMapped
|
|
15808
15806
|
};
|
|
15809
15807
|
}).sort(
|
|
15810
15808
|
(a, b) => compareArraysOfNumbers(getNestedOrders(a.documentId), getNestedOrders(b.documentId))
|
|
@@ -77,6 +77,7 @@ export default function clientController(context: {
|
|
|
77
77
|
title: string;
|
|
78
78
|
related: any;
|
|
79
79
|
items: null;
|
|
80
|
+
additionalFields: {};
|
|
80
81
|
path?: string | null | undefined;
|
|
81
82
|
type: "INTERNAL" | "EXTERNAL" | "WRAPPER";
|
|
82
83
|
id: number;
|
|
@@ -99,6 +100,7 @@ export default function clientController(context: {
|
|
|
99
100
|
title: string;
|
|
100
101
|
related: any;
|
|
101
102
|
items: null;
|
|
103
|
+
additionalFields: {};
|
|
102
104
|
path?: string | null | undefined;
|
|
103
105
|
type: "INTERNAL" | "EXTERNAL" | "WRAPPER";
|
|
104
106
|
id: number;
|
|
@@ -121,6 +123,7 @@ export default function clientController(context: {
|
|
|
121
123
|
title: string;
|
|
122
124
|
related: any;
|
|
123
125
|
items: null;
|
|
126
|
+
additionalFields: {};
|
|
124
127
|
path?: string | null | undefined;
|
|
125
128
|
type: "INTERNAL" | "EXTERNAL" | "WRAPPER";
|
|
126
129
|
id: number;
|
|
@@ -153,6 +156,7 @@ export default function clientController(context: {
|
|
|
153
156
|
title: string;
|
|
154
157
|
related: any;
|
|
155
158
|
items: null;
|
|
159
|
+
additionalFields: {};
|
|
156
160
|
path?: string | null | undefined;
|
|
157
161
|
type: "INTERNAL" | "EXTERNAL" | "WRAPPER";
|
|
158
162
|
id: number;
|
|
@@ -175,6 +179,7 @@ export default function clientController(context: {
|
|
|
175
179
|
title: string;
|
|
176
180
|
related: any;
|
|
177
181
|
items: null;
|
|
182
|
+
additionalFields: {};
|
|
178
183
|
path?: string | null | undefined;
|
|
179
184
|
type: "INTERNAL" | "EXTERNAL" | "WRAPPER";
|
|
180
185
|
id: number;
|
|
@@ -511,6 +511,7 @@ declare const _default: {
|
|
|
511
511
|
title: string;
|
|
512
512
|
related: any;
|
|
513
513
|
items: null;
|
|
514
|
+
additionalFields: {};
|
|
514
515
|
path?: string | null | undefined;
|
|
515
516
|
type: "INTERNAL" | "EXTERNAL" | "WRAPPER";
|
|
516
517
|
id: number;
|
|
@@ -533,6 +534,7 @@ declare const _default: {
|
|
|
533
534
|
title: string;
|
|
534
535
|
related: any;
|
|
535
536
|
items: null;
|
|
537
|
+
additionalFields: {};
|
|
536
538
|
path?: string | null | undefined;
|
|
537
539
|
type: "INTERNAL" | "EXTERNAL" | "WRAPPER";
|
|
538
540
|
id: number;
|
|
@@ -555,6 +557,7 @@ declare const _default: {
|
|
|
555
557
|
title: string;
|
|
556
558
|
related: any;
|
|
557
559
|
items: null;
|
|
560
|
+
additionalFields: {};
|
|
558
561
|
path?: string | null | undefined;
|
|
559
562
|
type: "INTERNAL" | "EXTERNAL" | "WRAPPER";
|
|
560
563
|
id: number;
|
|
@@ -24,7 +24,7 @@ export declare const getNavigationItemRepository: (context: {
|
|
|
24
24
|
count(where: any): Promise<number>;
|
|
25
25
|
remove(item: NavigationItemRemoveMinimal): Promise<any>;
|
|
26
26
|
removeForIds(ids: string[]): Promise<import("@strapi/database/dist/types").CountResult>;
|
|
27
|
-
findForMasterIds(ids:
|
|
27
|
+
findForMasterIds(ids: number[]): Promise<NavigationItemDBSchema[]>;
|
|
28
28
|
};
|
|
29
29
|
export declare const removeSensitiveFields: ({ related, items, ...item }: NavigationItemDBSchema) => NavigationItemDBSchema;
|
|
30
30
|
export declare const flattenRelated: ({ related, ...item }: any) => any;
|
|
@@ -31,6 +31,7 @@ declare const clientService: (context: {
|
|
|
31
31
|
title: string;
|
|
32
32
|
related: any;
|
|
33
33
|
items: null;
|
|
34
|
+
additionalFields: {};
|
|
34
35
|
path?: string | null | undefined;
|
|
35
36
|
type: "INTERNAL" | "EXTERNAL" | "WRAPPER";
|
|
36
37
|
id: number;
|
|
@@ -53,6 +54,7 @@ declare const clientService: (context: {
|
|
|
53
54
|
title: string;
|
|
54
55
|
related: any;
|
|
55
56
|
items: null;
|
|
57
|
+
additionalFields: {};
|
|
56
58
|
path?: string | null | undefined;
|
|
57
59
|
type: "INTERNAL" | "EXTERNAL" | "WRAPPER";
|
|
58
60
|
id: number;
|
|
@@ -75,6 +77,7 @@ declare const clientService: (context: {
|
|
|
75
77
|
title: string;
|
|
76
78
|
related: any;
|
|
77
79
|
items: null;
|
|
80
|
+
additionalFields: {};
|
|
78
81
|
path?: string | null | undefined;
|
|
79
82
|
type: "INTERNAL" | "EXTERNAL" | "WRAPPER";
|
|
80
83
|
id: number;
|
|
@@ -24,7 +24,7 @@ export interface RenderRFRInput {
|
|
|
24
24
|
enabledCustomFieldsNames: string[];
|
|
25
25
|
}
|
|
26
26
|
export interface RenderRFRNavInput {
|
|
27
|
-
item: Pick<NavigationItemDTO, 'uiRouterKey' | 'title' | 'path' | 'type' | 'audience'>;
|
|
27
|
+
item: Pick<NavigationItemDTO, 'uiRouterKey' | 'title' | 'path' | 'type' | 'audience' | 'additionalFields'>;
|
|
28
28
|
}
|
|
29
29
|
export interface RenderRFRPageInput {
|
|
30
30
|
item: Omit<NavigationItemDTO, 'items' | 'parent' | 'master'>;
|
|
@@ -252,6 +252,7 @@ declare const _default: {
|
|
|
252
252
|
title: string;
|
|
253
253
|
related: any;
|
|
254
254
|
items: null;
|
|
255
|
+
additionalFields: {};
|
|
255
256
|
path?: string | null | undefined;
|
|
256
257
|
type: "INTERNAL" | "EXTERNAL" | "WRAPPER";
|
|
257
258
|
id: number;
|
|
@@ -274,6 +275,7 @@ declare const _default: {
|
|
|
274
275
|
title: string;
|
|
275
276
|
related: any;
|
|
276
277
|
items: null;
|
|
278
|
+
additionalFields: {};
|
|
277
279
|
path?: string | null | undefined;
|
|
278
280
|
type: "INTERNAL" | "EXTERNAL" | "WRAPPER";
|
|
279
281
|
id: number;
|
|
@@ -296,6 +298,7 @@ declare const _default: {
|
|
|
296
298
|
title: string;
|
|
297
299
|
related: any;
|
|
298
300
|
items: null;
|
|
301
|
+
additionalFields: {};
|
|
299
302
|
path?: string | null | undefined;
|
|
300
303
|
type: "INTERNAL" | "EXTERNAL" | "WRAPPER";
|
|
301
304
|
id: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "strapi-plugin-navigation",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.5",
|
|
4
4
|
"description": "Strapi - Navigation plugin",
|
|
5
5
|
"strapi": {
|
|
6
6
|
"name": "navigation",
|
|
@@ -60,11 +60,11 @@
|
|
|
60
60
|
"@sensinum/strapi-utils": "^1.0.4",
|
|
61
61
|
"@strapi/design-system": "2.0.0-rc.14",
|
|
62
62
|
"@strapi/icons": "2.0.0-rc.14",
|
|
63
|
-
"@strapi/plugin-graphql": "^5.
|
|
63
|
+
"@strapi/plugin-graphql": "^5.7.0",
|
|
64
64
|
"@strapi/sdk-plugin": "^5.2.8",
|
|
65
|
-
"@strapi/strapi": "^5.
|
|
66
|
-
"@strapi/types": "^5.
|
|
67
|
-
"@strapi/typescript-utils": "^5.
|
|
65
|
+
"@strapi/strapi": "^5.7.0",
|
|
66
|
+
"@strapi/types": "^5.7.0",
|
|
67
|
+
"@strapi/typescript-utils": "^5.7.0",
|
|
68
68
|
"@types/jest": "^29.5.12",
|
|
69
69
|
"@types/koa": "^2.15.0",
|
|
70
70
|
"@types/koa-bodyparser": "^4.3.12",
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
},
|
|
102
102
|
"peerDependencies": {
|
|
103
103
|
"@strapi/sdk-plugin": "^5.2.8",
|
|
104
|
-
"@strapi/strapi": "^5.
|
|
104
|
+
"@strapi/strapi": "^5.7.0",
|
|
105
105
|
"react": "^18.3.1",
|
|
106
106
|
"react-dom": "^18.3.1",
|
|
107
107
|
"react-router-dom": "^6.26.2",
|